コード例 #1
0
 def name_multisig_account(self):
     return QMetaObject.invokeMethod(
         self,
         "_name_multisig_account",
         Qt.BlockingQueuedConnection,
         Q_RETURN_ARG(str),
     )
コード例 #2
0
    def change_fixationpoint_ring_thickness(self, thickness):
        if int(thickness.Thickness) < 0:
            return ChangeFixationpointRingThicknessResponse(
                'Failure. Only positive values are allowed.')
        else:
            meta = self.qml_fixationpoint.metaObject()
            res = meta.invokeMethod(self.qml_fixationpoint,
                                    "change_fixationpoint_ring_thickness",
                                    Qt.BlockingQueuedConnection,
                                    Q_RETURN_ARG(QVariant),
                                    Q_ARG(QVariant, thickness.Thickness))

        return ChangeFixationpointRingThicknessResponse('Success.')
コード例 #3
0
    def change_fixationpoint_ring_diameter(self, diameter):
        if int(diameter.Diameter) < 0:
            return ChangeFixationpointDiameterResponse(
                'Failure. Only positive values are allowed.')
        else:
            meta = self.qml_fixationpoint.metaObject()
            res = meta.invokeMethod(self.qml_fixationpoint,
                                    "change_fixationpoint_ring_diameter",
                                    Qt.BlockingQueuedConnection,
                                    Q_RETURN_ARG(QVariant),
                                    Q_ARG(QVariant, diameter.Diameter))

            return ChangeFixationpointDiameterResponse('Success.')
コード例 #4
0
 def wrapper(obj, *args):
     qargs = [Q_ARG(t, v) for t, v in zip(self.args, args)]
     invoke_args = [obj._instance, self.name]
     invoke_args.append(Qt.DirectConnection)
     rtype = self.returnType
     if rtype:
         invoke_args.append(Q_RETURN_ARG(rtype))
     invoke_args.extend(qargs)
     try:
         result = QMetaObject.invokeMethod(*invoke_args)
     except RuntimeError as e:
         raise TypeError("%s.%s(%r) call failed: %s" %
                         (obj, self.name, args, e))
     return wrap(result)
コード例 #5
0
 def on_ask( self , msg , btns , default ) :
     """Ask the user a question."""
     # NOTE: We are running in a worker thread, so we need to delegate showing the message box
     # to the GUI thread.
     retarg = Q_RETURN_ARG( QMessageBox.StandardButton )
     QMetaObject.invokeMethod(
         StartupWidget._instance , "on_ask" , Qt.BlockingQueuedConnection ,
         retarg ,
         Q_ARG( str , msg ) ,
         Q_ARG( QMessageBox.StandardButtons , btns ) ,
         Q_ARG( QMessageBox.StandardButton , default ) ,
     )
     # FIXME! How do we get the return value?! :-/
     return StartupWidget._on_ask_retval
コード例 #6
0
    def change_fixationpoint_color(self, color):
        # for x in QColor.colorNames():
        #     print(x)
        if any(x == color.Color for x in QColor.colorNames()):
            meta = self.qml_fixationpoint.metaObject()
            res = meta.invokeMethod(self.qml_fixationpoint,
                                    "change_fixationpoint_color",
                                    Qt.BlockingQueuedConnection,
                                    Q_RETURN_ARG(QVariant),
                                    Q_ARG(QVariant, color.Color))

            return ChangeFixationpointColorResponse('Success.')
        else:
            return ChangeFixationpointColorResponse(
                'Specified color "{}" is not contained in'
                ' "QColor.colorNames()".'.format(color.Color) +
                'See "http://doc.qt.io/qt-5/qcolor.html" for available colors.'
            )
コード例 #7
0
 def wrapper(obj, *args):
     # XXX: support kwargs?
     qargs = [Q_ARG(t, v) for t, v in zip(self.args, args)]
     invoke_args = [obj._instance, self.name]
     invoke_args.append(Qt.DirectConnection)
     rtype = self.returnType
     if rtype:
         invoke_args.append(Q_RETURN_ARG(rtype))
     invoke_args.extend(qargs)
     try:
         result = QMetaObject.invokeMethod(*invoke_args)
         error_msg = str(qApp.property("MIKRO_EXCEPTION").toString())
         if error_msg:
             # clear message
             qApp.setProperty("MIKRO_EXCEPTION", "") # TODO: "" was QVariant(): check that it's correct (ale/20141002)
             raise Exception(error_msg)
     except RuntimeError as e:
         raise TypeError(
             "%s.%s(%r) call failed: %s" % (obj, self.name, args, e))
     return wrap(result)