Ejemplo n.º 1
0
 def toggleAcquire(self):
     if self.acquire_button.isChecked():
         self.acquire_button.setText('Starting Acquisition...')
         QtCore.QMetaObject.invokeMethod(
             self.cam, 'start_video',
             QtCore.Q_ARG(object, self.config_widget))
     else:
         self.acquire_button.setText('Stopping Acquisition...')
         QtCore.QMetaObject.invokeMethod(self.cam, 'abort')
Ejemplo n.º 2
0
    def inner(*args):
        if len(types) != len(args):
            raise TypeError(
                f"len(types)={len(types)} != len(args)={len(args)}")

        # https://www.qtcentre.org/threads/29156-Calling-a-slot-from-another-thread?p=137140#post137140
        # QMetaObject.invokeMethod(skypeThread, "startSkypeCall", Qt.QueuedConnection, QtCore.Q_ARG("QString", "someguy"))

        _args = [qc.Q_ARG(typ, typ(arg)) for typ, arg in zip(types, args)]
        return qmo.invokeMethod(obj, member, conn, *_args)
Ejemplo n.º 3
0
 def invoke(self, member, *args, conn=QtCore.Qt.AutoConnection):
     return QtCore.QMetaObject.invokeMethod(member.__self__, member.__func__.__name__, \
         conn, *map(lambda _: QtCore.Q_ARG(object, _), args))