コード例 #1
0
ファイル: malarmtaskmenu.py プロジェクト: jpburstrom/malarm
 def updateWidget(self):
 
     formWindow = QDesignerFormWindowInterface.findFormWindow(self.widget)
     
     if formWindow:
         formWindow.cursor().setProperty("paramPath", QVariant(self.address.text()))
         if self.widget.length is 1 and self.min[0] is not None:
             formWindow.cursor().setProperty("standardAction", QVariant(self.standardActions[0].currentIndex() - 1))
             formWindow.cursor().setProperty("paramMin", QVariant(self.min[0].value()))
             formWindow.cursor().setProperty("paramMax", QVariant(self.max[0].value()))
             formWindow.cursor().setProperty("paramDefault", QVariant(self.default[0].value()))
         elif self.type == "str":
             formWindow.cursor().setProperty("standardAction", QVariant(self.standardActions[0].currentIndex() - 1))
             formWindow.cursor().setProperty("paramDefault", QVariant(self.default[0].text()))
         elif self.type == "bool":
             formWindow.cursor().setProperty("standardAction", QVariant(self.standardActions[0].currentIndex() - 1))
             formWindow.cursor().setProperty("paramDefault", QVariant(self.default[0].isChecked()))
         elif self.type == "QPointF":
             formWindow.cursor().setProperty("standardAction", QVariant(
                 QPoint(self.standardActions[0].currentIndex() - 1, self.standardActions[1].currentIndex() - 1)))
             formWindow.cursor().setProperty("paramMin", QVariant(
                 QPointF(self.min[0].value(), self.min[1].value())))
             formWindow.cursor().setProperty("paramMax", QVariant(
                 QPointF(self.max[0].value(), self.max[1].value())))
             formWindow.cursor().setProperty("paramDefault", QVariant(
                 QPointF(self.default[0].value(), self.default[1].value())))
     self.accept()
コード例 #2
0
 def updateWidget(self):
     """Update the widget"""
     formWindow = QDesignerFormWindowInterface.findFormWindow(self.widget)
     if formWindow:
         formWindow.cursor().setProperty(
             "objectName", QVariant(self.name.text()))
         # callback FIXME
         formWindow.cursor().setProperty(
             "text", QVariant(self.button_text.text()))
         formWindow.cursor().setProperty(
             "colorscheme", QVariant(self.color_scheme.currentText()))
         formWindow.cursor().setProperty(
             "text", QVariant(self.button_text.text()))
         formWindow.cursor().setProperty(
             "checked", QVariant(self.initial_state.isChecked()))
     self.accept()