Skip to content

3rd Party Software

Combining Qt with 3rd party libraries or components? Ask here!
1.1k Topics 5.6k Posts
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • [QXmpp] Trying to use sendMessage to a MUC crashes my app.

    Unsolved
    11
    0 Votes
    11 Posts
    212 Views
    S
    Thank you everyone for taking your time to reply me. The mistake was that, the invokation of the functions were in different qml files, and I had used different instances of the class in the 2 files. I finally fixed it :)
  • [SOLVED]QXmpp creating a MUC room (xep--0045) on the server

    qxmpp
    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    @SrisharanVS hi, Since it's a git repository, did you clone it and check the commit history ?
  • Can I use OpenCV YOLO to detect my own objects?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    B
    I completed the code by adding a couple of new functions, taking into account the output of images from the camera and video, and also added logs and improved the display of the detected object self.busy = False self.moves_enabled = False self.cls2cat = { "adjustable_wrench": "Box1", "gear": "Box2", "hammer": "Box3", "screwdriver": "Брак" } self.BtCamera.clicked.connect(self.Camera) self.BtVideo.clicked.connect(self.Video) self.BtDetectObject.clicked.connect(self.toggle_objects) self.BtDetectPeople.clicked.connect(self.toggle_people) self.BtMoveObjects.clicked.connect(self.toggle_moves) self.yolo = YOLO('best.pt') self.cap = None self.videoActive = False self.cameraActive = False self.det_objects = False self.det_was_active = False self.people_present = False self._seen, self._ttl = {}, 2000 self.frame_timer = QtCore.QTimer(self) self.frame_timer.timeout.connect(self.tick) self.people_timer = QtCore.QTimer(self) self.people_timer.timeout.connect(self.tick_people) def Camera(self): if not self.cameraActive: if self.cap: try: self.cap.release() except: pass self.cap = cv2.VideoCapture(0) if not self.cap.isOpened(): self.add_log('Камера: не удалось открыть 0'); return self.videoActive, self.cameraActive = False, True if not self.frame_timer.isActive(): self.frame_timer.start(33) self.add_log('Камера: старт') else: if self.frame_timer.isActive(): self.frame_timer.stop() if self.cap: try: self.cap.release() except: pass self.cap = None self.videoActive = self.cameraActive = False if hasattr(self, 'LCamera1'): self.LCamera1.clear() if hasattr(self, 'LCamera2'): self.LCamera2.clear() self.add_log('Камера: стоп') def Video(self): if not self.videoActive: src = 'Video2.mp4' if self.cap: try: self.cap.release() except: pass self.cap = cv2.VideoCapture(src) if not self.cap.isOpened(): self.add_log(f'Видео: не удалось открыть {src}'); return self.videoActive, self.cameraActive = True, False if not self.frame_timer.isActive(): self.frame_timer.start(33) self.add_log(f'Видео: старт {src}') else: if self.frame_timer.isActive(): self.frame_timer.stop() if self.cap: try: self.cap.release() except: pass self.cap = None self.videoActive = self.cameraActive = False if hasattr(self, 'LCamera1'): self.LCamera1.clear() if hasattr(self, 'LCamera2'): self.LCamera2.clear() self.add_log('Видео: стоп') def toggle_objects(self): self.det_objects = not self.det_objects if hasattr(self, 'BtDetectObject'): self.BtDetectObject.setText("Stop detection" if self.det_objects else "Detect objects") self.add_log("Детекция объектов: ON" if self.det_objects else "Детекция объектов: OFF") def toggle_people(self): if self.people_timer.isActive(): self.people_timer.stop() self.add_log('Мониторинг человека: OFF') else: self.people_timer.start(200) self.add_log('Мониторинг человека: ON') def _dedup(self, name, cx, cy): k, now = (name, cx//10, cy//10), int(time.time()*1000) if now - self._seen.get(k, 0) < self._ttl: return False self._seen[k] = now; return True def _ok(self, name: str) -> bool: name = name.lower() mapping = { 'adjustable_wrench': getattr(self, 'CBBox1', None), 'gear': getattr(self, 'CBBox2', None), 'hammer': getattr(self, 'CBBox3', None), 'screwdriver': getattr(self, 'CBReject', None) } w = mapping.get(name) return bool(w and w.isChecked()) def _to_label(self, label: QtWidgets.QLabel, bgr): if label is None: return rgb = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB) h, w, c = rgb.shape qimg = QtGui.QImage(rgb.data, w, h, w * c, QtGui.QImage.Format_RGB888) label.setPixmap(QtGui.QPixmap.fromImage(qimg).scaled(label.width(), label.height(), QtCore.Qt.KeepAspectRatio)) def tick_people(self): try: if self.smart_camera.getPerson(): self.lamp.setLamp('0001') if self.det_objects: self.det_was_active = True self.det_objects = False if self.frame_timer.isActive(): self.frame_timer.stop() if not self.people_present: self.people_present = True self.add_log('Человек в рабочей зоне! Детекция остановлена') else: self.lamp.setLamp('1000') if self.people_present: self.people_present = False self.add_log('Зона свободна') if not self.frame_timer.isActive() and (self.videoActive or self.cameraActive) and self.cap: self.frame_timer.start(33) if self.det_was_active and not self.det_objects: self.det_objects = True self.det_was_active = False self.add_log('Детекция объектов возобновлена') except Exception as e: self.add_log(f'getPerson() error: {e}') def tick(self): if not self.cap: return ok, frame = self.cap.read() if not ok: if self.videoActive: self.add_log("Видео: конец файла") if self.frame_timer.isActive(): self.frame_timer.stop() if self.cap: try: self.cap.release() except: pass self.cap = None self.videoActive = self.cameraActive = False if hasattr(self, 'LCamera1'): self.LCamera1.clear() if hasattr(self, 'LCamera2'): self.LCamera2.clear() return img2 = frame img1 = frame.copy() if self.det_objects: try: r = self.yolo(frame, verbose=False, device='cpu')[0] if hasattr(r, 'boxes') and r.boxes is not None: keep = [self._ok(str(self.yolo.names[int(b.cls[0])]).lower()) for b in r.boxes] if any(keep): import numpy as np r.boxes = r.boxes[np.array(keep, dtype=bool)] else: r.boxes = r.boxes[:0] for b in r.boxes: cls_id = int(b.cls[0]) name = str(self.yolo.names[cls_id]).lower() x1, y1, x2, y2 = map(int, b.xyxy[0]) cx, cy = (x1 + x2) // 2, (y1 + y2) // 2 if self._dedup(name, cx, cy): self.add_log(f"Detected {name}") if self.moves_enabled and not self.people_present: self.run_session_yolo(name) else: self.add_log("Перемещение отключено" if not self.moves_enabled else "Ожидание: человек в зоне") img1 = r.plot() except Exception as e: self.add_log(f"YOLO error: {e}") if hasattr(self, 'LCamera1'): self._to_label(self.LCamera1, img1) if hasattr(self, 'LCamera2'): self._to_label(self.LCamera2, img2) def run_session_yolo(self, name: str): cat = self.cls2cat.get(name.lower()) if not cat: self.add_log(f"Нет маппинга для класса: {name}") return try: if cat == 'Брак': self._pick_and_place(self.rejectCell, self.rejectTrack) else: slot = self._choose_slot(cat) if slot is None: self.add_log(f"Нет свободных ячеек для {cat}") return self._pick_and_place(self.cells[slot], self.cellTrack[slot]) self.robot.play() while self.robot.getActualStateOut() != InterpreterStates.PROGRAM_IS_DONE.value: QtWidgets.QApplication.processEvents() time.sleep(0.05) self.add_log(f"Перемещено: {name} -> {cat}") except Exception as e: self.add_log(f"Ошибка перемещения: {e}") QtWidgets.QMessageBox.warning(self, "Ошибка", str(e)) def toggle_moves(self): self.moves_enabled = not self.moves_enabled try: self.BtMoveObjects.setText("Moves: ON" if self.moves_enabled else "Moves: OFF") except Exception: pass self.add_log("Перемещения: ON" if self.moves_enabled else "Перемещения: OFF")
  • GammaRay Quick Scenes deep information missing

    Unsolved
    2
    0 Votes
    2 Posts
    6k Views
    S
    you shoule choose Quick Scenes> Items. [image: 171d9f7c-ca85-4766-9747-fde06ca3a995.png]
  • Invalid property name clipPlanes.

    Unsolved
    2
    0 Votes
    2 Posts
    342 Views
    SGaistS
    Hi and welcome to devnet, From a quick look, these last two properties are available through: PerspectiveCamera.
  • Does ROOT (root.cern.ch) combine good with QT for data processing and histogram?

    Unsolved
    1
    0 Votes
    1 Posts
    200 Views
    No one has replied
  • Using Qt Program as a Module, but constantly get critical message

    Unsolved glib
    2
    0 Votes
    2 Posts
    710 Views
    Axel SpoerlA
    @Dream_Helium said in Using Qt Program as a Module, but constantly get critical message: using GModule to load a Qt module just that thought scares me! Which Qt module are you loading and why with GModule? What is the expected result? g_main_context_pop_thread_default: assertion 'stack != NULL' failed As rightfully said: That error message comes from glib, not from Qt. Maybe consult the gtk forum.
  • Qt Creator with pylon

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    Hi, Did you try to build one of the pylon examples ?
  • Can't run the Qt OPC UA example

    Solved opcua
    4
    0 Votes
    4 Posts
    1k Views
    S
    Aha! found what I was looking for on a old blog post! Qt OPC UA will be available directly from the Qt installer for those holding a Qt for Automation license. [...] Users of one of the Open Source licenses will need to compile Qt OPC UA themselves. See here for a list of build recipes. this really should be clearly stated on documentation...
  • Qt SQL driver plugin for SQLCipher ( for Qt 5 )

    Unsolved
    6
    0 Votes
    6 Posts
    3k Views
    P
    check this repo: I've made a fork for this repo to make it work with Qt6 https://github.com/pourjour/qsqlcipher/tree/main
  • Issue connecting SmtpClient

    Solved
    17
    1 Votes
    17 Posts
    4k Views
    M
    @UserNotFound just remove second Q_DECL_IMPORT from smtpmime_global.h : #ifndef SMTPMIME_GLOBAL_H #define SMTPMIME_GLOBAL_H #ifdef SMTP_MIME_LIBRARY #define SMTP_MIME_EXPORT Q_DECL_EXPORT #else #define SMTP_MIME_EXPORT #endif #endif // SMTPMIME_GLOBAL_H
  • Formatting partition with KPMcore

    Unsolved
    2
    0 Votes
    2 Posts
    595 Views
    L
    Found the solution. Added this to the end of the function and now it the partitions filesystems are correctly formatted: newBootFs->create(*rootReport, bootDeviceNode); newRootFs->create(*rootReport, rootDeviceNode); Also I could delete this: if (devicePartitionTable->typeName() == "gpt") { qDebug() << "Setting partition type for GPT table"; newBootPartition->setType("C12A7328-F81F-11D2-BA4B-00A0C93EC93B"); // GPT GUID for EFI System Partition newRootPartition->setType("0FC63DAF-8483-4772-8E79-3D69D8477DE4"); // GPT GUID for Linux Filesystem } else if (devicePartitionTable->typeName() == "msdos") { qDebug() << "Setting partition type for MBR table"; newBootPartition->setType("0xEF"); // MBR type code for EFI System Partition newRootPartition->setType("0x83"); // MBR type code for Linux Filesystem }
  • what about creating a pyside6 ide like qt creator/designer

    Solved
    2
    0 Votes
    2 Posts
    604 Views
    SGaistS
    Hi, WARNING: I am NOT a lawyer. AFAIK, nothing forbids you to create such an application. That said, designer already exists and is language agnostic since it produces only an XML file that is consumed by uic. uic that is able to generate Python code. Also, if memory serves well, there's a new project file for Python projects that helps automate code generation so you might be missing on that for your projects.
  • [QWT] qwt-6.1.4 doesn't compile on Qt6.8.2 / mingw1310_64 on Windows 10

    Solved
    4
    0 Votes
    4 Posts
    991 Views
    C
    It works. Thanks again.
  • InnoMakerUsb2CanLib

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    aha_1980A
    @rzucca have you already seen https://github.com/INNO-MAKER/usb2can/tree/master/For Windows/QT/QT/QTInnoMaker ? That looks like an useful example for you. Regards
  • Compiling with external library failed "Cannot load library...

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    SGaistS
    Good ! Then please mark the thread as solved using the Topic Tool button or the three dotted menu beside the answer you deem correct so other forum members may know a solution has been found :-)
  • QOPCUA Endpoints Request with IPV6 Link-Local Addresses using the Open62541 Backend

    Unsolved
    1
    0 Votes
    1 Posts
    410 Views
    No one has replied
  • QGIS installation from Source with Qt 5 in Windows

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    You can use it the same way it's done for the Qt libraries in your cmake file.
  • LNK1104: cannot open file 'libucrt.lib'

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    jsulmJ
    @Aman55 Qt version is not set in the Kit You should use CMake provided by Qt Online Installer In the screen-shot there is yellow exclamation mark, but the message is cut, check that also