Python PySide.QtCore.SIGNAL Examples

The following are 30 code examples of PySide.QtCore.SIGNAL(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtCore , or try the search function .
Example #1
Source File: universal_tool_template_v7.3.py    From universal_tool_template.py with MIT License 7 votes vote down vote up
def Establish_Connections(self):
        # loop button and menu action to link to functions
        for ui_name in self.uiList.keys():
            if ui_name.endswith('_btn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_atn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_btnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
            elif ui_name.endswith('_atnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
        # custom connection
    
    #=======================================
    # UI Response functions (custom + prebuilt functions)
    #=======================================
    #-- ui actions 
Example #2
Source File: multiLineInputDialog_UI_pyside.py    From anima with MIT License 6 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtGui.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout.addWidget(self.plainTextEdit)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #3
Source File: VariablesBrowser.py    From PySimulator with GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, model=None):
        self.parent = parent
        super(VariablesBrowser, self).__init__(parent)
        ''' Set up the columns '''
        self.setHeaderLabels(('Name', 'Value', 'Unit'))
        self.setColumnWidth(0, 200)
        self.setColumnWidth(1, 70)
        self.setColumnWidth(2, 50)
        self.setIndentation(10)

        self.currentModelItem = None
        self.itemChanged.connect(self.browserItemCheckChanged)

        # Enable Context Menu (by click of right mouse button)
        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.connect(self, QtCore.SIGNAL("customContextMenuRequested(const QPoint &)"), self._menuContextTree)

        ''' If a model is given with the constructor, load it
        '''
        if model is not None:
            self.addModel(model) 
Example #4
Source File: PacketTableModel.py    From CANalyzat0r with GNU General Public License v3.0 6 votes vote down vote up
def setData(self, index, value, role=Qt.EditRole):
        """
        This gets called to change the element on the GUI at the given indexes
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param index: Index object containing row and column index
        :param value: The new value
        :param role: Optional: The role calling this method. Default: EditRole
        :return: True if the operation succeeded
        """

        rowIndex = index.row()
        colIndex = index.column()
        value = re.sub("[^A-Fa-f0-9]+", "", str(value)).upper()
        self.dataList[rowIndex][colIndex] = value

        self.cellChanged.emit(rowIndex, colIndex)
        self.dataChanged.emit(rowIndex, colIndex)
        self.emit(QtCore.SIGNAL("layoutChanged()"))
        return True 
Example #5
Source File: PacketTableModel.py    From CANalyzat0r with GNU General Public License v3.0 6 votes vote down vote up
def setRowCount(self, count):
        """
        Sets the row count by removing lines / adding empty lines.
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param count: The desired amount of rows
        """

        # If additional rows are needed
        if count > len(self.dataList):
            while len(self.dataList) < count:
                self.dataList.append([])
                # Fill the columns with empty data
                for colIndex in range(self.columnCount()):
                    self.dataList[-1].append("")
        # Rows have to be removed
        elif count < len(self.dataList):
            while len(self.dataList) > count:
                self.dataList.pop()

        self.emit(QtCore.SIGNAL("layoutChanged()")) 
Example #6
Source File: fileloading.py    From MARA_Framework with GNU Lesser General Public License v3.0 6 votes vote down vote up
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False) 
Example #7
Source File: utils.py    From Satori with Artistic License 2.0 6 votes vote down vote up
def download_button_clicked(self):

        directory = QtGui.QFileDialog().getExistingDirectory()
        if not directory or len(directory) == 0 or not os.path.exists(directory):
            return
        self.download_button.setVisible(False)
        self.download_progress.setVisible(True)
        filename = os.path.basename(self.link())
        self.full_filename = os.path.join(directory, filename)

        url = QtCore.QUrl(self.link())
        request = QtNetwork.QNetworkRequest(url)
        self.current_download = self.manager.get(request)
        self.current_download.setReadBufferSize(1048576)
        self.connect(self.current_download, QtCore.SIGNAL("downloadProgress(qint64, qint64)"),
                     self.download_hook)
        self.current_download.downloadProgress.connect(self.download_hook)
        self.current_download.finished.connect(self.download_finished)
        self.current_download.readyRead.connect(self.download_ready_read)
        self.current_f = open(self.full_filename, 'wb')
        self.parent.exiting.connect(self.closing) 
Example #8
Source File: fileloading.py    From AndroBugs_Framework with GNU General Public License v3.0 6 votes vote down vote up
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False) 
Example #9
Source File: fileloading.py    From TimeMachine with GNU Lesser General Public License v3.0 6 votes vote down vote up
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False) 
Example #10
Source File: a2p_importpart.py    From A2plus with GNU Lesser General Public License v2.1 6 votes vote down vote up
def initUI(self):
        self.resize(400,100)
        self.setWindowTitle('select a shape to be imported')
        self.mainLayout = QtGui.QGridLayout() # a VBoxLayout for the whole form

        self.shapeCombo = QtGui.QComboBox(self)
        
        l = sorted(self.labelList)
        self.shapeCombo.addItems(l)

        self.buttons = QtGui.QDialogButtonBox(self)
        self.buttons.setOrientation(QtCore.Qt.Horizontal)
        self.buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        self.buttons.addButton("Choose", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(self.buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(self.buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))

        self.mainLayout.addWidget(self.shapeCombo,0,0,1,1)
        self.mainLayout.addWidget(self.buttons,1,0,1,1)
        self.setLayout(self.mainLayout) 
Example #11
Source File: a2p_constraintDialog.py    From A2plus with GNU Lesser General Public License v2.1 6 votes vote down vote up
def Activated(self):
        self.selectedConstraint = a2plib.getSelectedConstraint()
        if self.selectedConstraint is None:
            QtGui.QMessageBox.information(
                QtGui.QApplication.activeWindow(),
                "Selection Error !",
                "Please select exact one constraint first."
                )
            return

        self.constraintValueBox = a2p_ConstraintValuePanel(
            self.selectedConstraint,
            'editConstraint'
            )
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Deleted()"), self.onDeleteConstraint)
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Accepted()"), self.onAcceptConstraint)
        a2plib.setConstraintEditorRef(self.constraintValueBox) 
Example #12
Source File: a2p_constraintDialog.py    From A2plus with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self):
        super(a2p_ConstraintPanel,self).__init__()
        self.resize(200,250)
        cc = a2p_ConstraintCollection(None)
        self.setWidget(cc)
        self.setWindowTitle("Constraint Tools")
        #
        mw = FreeCADGui.getMainWindow()
        mw.addDockWidget(QtCore.Qt.RightDockWidgetArea,self)
        #
        self.setFloating(True)
        self.activateWindow()
        self.setAllowedAreas(QtCore.Qt.NoDockWidgetArea)
        self.move(getMoveDistToStoredPosition(self))

        a2plib.setConstraintDialogRef(self)
        #
        self.timer = QtCore.QTimer()
        QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.onTimer)
        self.timer.start(100) 
Example #13
Source File: assembly.py    From FreeCAD_assembly3 with GNU General Public License v3.0 6 votes vote down vote up
def setupContextMenu(self,vobj,menu):
        obj = vobj.Object
        action = QtGui.QAction(QtGui.QIcon(),
                "Unfreeze assembly" if obj.Freeze else "Freeze assembly", menu)
        QtCore.QObject.connect(
                action,QtCore.SIGNAL("triggered()"),self.toggleFreeze)
        menu.addAction(action) 
Example #14
Source File: test_version_mover.py    From anima with MIT License 5 votes vote down vote up
def show_dialog(self, dialog):
        """show the given dialog
        """
        dialog.show()
        self.app.exec_()
        self.app.connect(
            self.app,
            QtCore.SIGNAL("lastWindowClosed()"),
            self.app,
            QtCore.SLOT("quit()")
        ) 
Example #15
Source File: mainwindow.py    From TimeMachine with GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupSession(self):
        self.session = Session()

        self.fileLoadingThread = FileLoadingThread(self.session)
        self.connect(self.fileLoadingThread,
                QtCore.SIGNAL("loadedFile(bool)"),
                self.loadedFile) 
Example #16
Source File: test_edl_importer.py    From anima with MIT License 5 votes vote down vote up
def show_dialog(self, dialog):
        """show the given dialog
        """
        dialog.show()
        self.app.exec_()
        self.app.connect(
            self.app,
            QtCore.SIGNAL("lastWindowClosed()"),
            self.app,
            QtCore.SLOT("quit()")
        ) 
Example #17
Source File: mainwindow.py    From MARA_Framework with GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupSession(self):
        self.session = Session()

        self.fileLoadingThread = FileLoadingThread(self.session)
        self.connect(self.fileLoadingThread,
                QtCore.SIGNAL("loadedFile(bool)"),
                self.loadedFile) 
Example #18
Source File: Zebra_Gui.py    From CurvesWB with GNU Lesser General Public License v2.1 5 votes vote down vote up
def setupUi(self, Zebra):
        Zebra.setObjectName(_fromUtf8("Zebra"))
        Zebra.resize(241, 302)
        self.verticalLayoutWidget = QtGui.QWidget(Zebra)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.verticalLayoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
        self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
        self.verticalLayout.addWidget(self.horizontalSlider)
        self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
        self.verticalLayout.addWidget(self.horizontalSlider_2)
        self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
        self.verticalLayout.addWidget(self.horizontalSlider_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)

        self.retranslateUi(Zebra)
#        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
#        QtCore.QMetaObject.connectSlotsByName(Zebra) 
Example #19
Source File: PacketTableModel.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def clear(self):
        """
        Clears all managed data from the ``dataList``.
        This is a shortcut to :func:`setRowCount` with parameter ``0``.
        """

        self.dataList = []
        self.emit(QtCore.SIGNAL("layoutChanged()")) 
Example #20
Source File: PacketTableModel.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def removeRow(self, rowIndex):
        """
        Removes the specified row from the table model.
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param rowIndex: The row index to delete
        """

        del self.dataList[rowIndex]
        self.emit(QtCore.SIGNAL("layoutChanged()")) 
Example #21
Source File: assembly.py    From FreeCAD_assembly3 with GNU General Public License v3.0 5 votes vote down vote up
def setupContextMenu(self,vobj,menu):
        obj = vobj.Object
        action = QtGui.QAction(QtGui.QIcon(),
                "Enable constraint" if obj.Disabled else "Disable constraint", menu)
        QtCore.QObject.connect(
                action,QtCore.SIGNAL("triggered()"),self.toggleDisable)
        menu.addAction(action) 
Example #22
Source File: PacketTableModel.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def sort(self, colIndex, order):
        """
        Sort the data by given column number.
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param colIndex: The column index to sort for
        :param order: Either ``DescendingOrder`` or ``AscendingOrder``
        """

        self.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))
        self.dataList = sorted(
            self.dataList, key=operator.itemgetter(colIndex))
        if order == QtCore.Qt.DescendingOrder:
            self.dataList.reverse()
        self.emit(QtCore.SIGNAL("layoutChanged()")) 
Example #23
Source File: SheetMetalBend.py    From FreeCAD_SheetMetal with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
      
      self.obj = None
      self.form = QtGui.QWidget()
      self.form.setObjectName("SMBendTaskPanel")
      self.form.setWindowTitle("Binded faces/edges list")
      self.grid = QtGui.QGridLayout(self.form)
      self.grid.setObjectName("grid")
      self.title = QtGui.QLabel(self.form)
      self.grid.addWidget(self.title, 0, 0, 1, 2)
      self.title.setText("Select new face(s)/Edge(s) and press Update")

      # tree
      self.tree = QtGui.QTreeWidget(self.form)
      self.grid.addWidget(self.tree, 1, 0, 1, 2)
      self.tree.setColumnCount(2)
      self.tree.setHeaderLabels(["Name","Subelement"])

      # buttons
      self.addButton = QtGui.QPushButton(self.form)
      self.addButton.setObjectName("addButton")
      self.addButton.setIcon(QtGui.QIcon(os.path.join( iconPath , 'SMUpdate.svg')))
      self.grid.addWidget(self.addButton, 3, 0, 1, 2)

      QtCore.QObject.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.updateElement)
      self.update() 
Example #24
Source File: SheetMetalJunction.py    From FreeCAD_SheetMetal with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
      
      self.obj = None
      self.form = QtGui.QWidget()
      self.form.setObjectName("SMJunctionTaskPanel")
      self.form.setWindowTitle("Binded edges list")
      self.grid = QtGui.QGridLayout(self.form)
      self.grid.setObjectName("grid")
      self.title = QtGui.QLabel(self.form)
      self.grid.addWidget(self.title, 0, 0, 1, 2)
      self.title.setText("Select new Edge(s) and press Update")

      # tree
      self.tree = QtGui.QTreeWidget(self.form)
      self.grid.addWidget(self.tree, 1, 0, 1, 2)
      self.tree.setColumnCount(2)
      self.tree.setHeaderLabels(["Name","Subelement"])

      # buttons
      self.addButton = QtGui.QPushButton(self.form)
      self.addButton.setObjectName("addButton")
      self.addButton.setIcon(QtGui.QIcon(os.path.join( iconPath , 'SMUpdate.svg')))
      self.grid.addWidget(self.addButton, 3, 0, 1, 2)

      QtCore.QObject.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.updateElement)
      self.update() 
Example #25
Source File: SheetMetalRelief.py    From FreeCAD_SheetMetal with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
      
      self.obj = None
      self.form = QtGui.QWidget()
      self.form.setObjectName("SMReliefTaskPanel")
      self.form.setWindowTitle("Binded vertexes list")
      self.grid = QtGui.QGridLayout(self.form)
      self.grid.setObjectName("grid")
      self.title = QtGui.QLabel(self.form)
      self.grid.addWidget(self.title, 0, 0, 1, 2)
      self.title.setText("Select new vertex(es) and press Update")

      # tree
      self.tree = QtGui.QTreeWidget(self.form)
      self.grid.addWidget(self.tree, 1, 0, 1, 2)
      self.tree.setColumnCount(2)
      self.tree.setHeaderLabels(["Name","Subelement"])

      # buttons
      self.addButton = QtGui.QPushButton(self.form)
      self.addButton.setObjectName("addButton")
      self.addButton.setIcon(QtGui.QIcon(os.path.join( iconPath , 'SMUpdate.svg')))
      self.grid.addWidget(self.addButton, 3, 0, 1, 2)

      QtCore.QObject.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.updateElement)
      self.update() 
Example #26
Source File: SheetMetalCmd.py    From FreeCAD_SheetMetal with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
      
      self.obj = None
      self.form = QtGui.QWidget()
      self.form.setObjectName("SMBendWallTaskPanel")
      self.form.setWindowTitle("Binded faces/edges list")
      self.grid = QtGui.QGridLayout(self.form)
      self.grid.setObjectName("grid")
      self.title = QtGui.QLabel(self.form)
      self.grid.addWidget(self.title, 0, 0, 1, 2)
      self.title.setText("Select new face(s)/Edge(s) and press Update")

      # tree
      self.tree = QtGui.QTreeWidget(self.form)
      self.grid.addWidget(self.tree, 1, 0, 1, 2)
      self.tree.setColumnCount(2)
      self.tree.setHeaderLabels(["Name","Subelement"])

      # buttons
      self.addButton = QtGui.QPushButton(self.form)
      self.addButton.setObjectName("addButton")
      self.addButton.setIcon(QtGui.QIcon(os.path.join( iconPath , 'SMUpdate.svg')))
      self.grid.addWidget(self.addButton, 3, 0, 1, 2)

      QtCore.QObject.connect(self.addButton, QtCore.SIGNAL("clicked()"), self.updateElement)
      self.update() 
Example #27
Source File: exportPartToVRML.py    From kicad-3d-models-in-freecad with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 164)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(30, 110, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.comboBox = QtGui.QComboBox(Dialog)
        self.comboBox.setGeometry(QtCore.QRect(180, 40, 191, 22))
        self.comboBox.setMaxVisibleItems(25)
        self.comboBox.setObjectName("comboBox")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(180, 20, 53, 16))
        self.label.setObjectName("label")
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(20, 20, 53, 16))
        self.label_2.setObjectName("label_2")
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setEnabled(False)
        self.plainTextEdit.setGeometry(QtCore.QRect(20, 40, 31, 31))
        self.plainTextEdit.setBackgroundVisible(False)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.plainTextEdit_2 = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit_2.setEnabled(False)
        self.plainTextEdit_2.setGeometry(QtCore.QRect(120, 40, 31, 31))
        self.plainTextEdit_2.setBackgroundVisible(False)
        self.plainTextEdit_2.setObjectName("plainTextEdit_2")
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(120, 20, 41, 16))
        self.label_3.setObjectName("label_3")
        self.label_4 = QtGui.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(20, 80, 351, 16))
        self.label_4.setObjectName("label_4")
        QtCore.QObject.connect(self.comboBox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.SIGNAL_comboBox_Changed)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #28
Source File: exportPartToVRML.py    From kicad-3d-models-in-freecad with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 164)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(30, 110, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.comboBox = QtGui.QComboBox(Dialog)
        self.comboBox.setGeometry(QtCore.QRect(180, 40, 191, 22))
        self.comboBox.setMaxVisibleItems(25)
        self.comboBox.setObjectName("comboBox")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(180, 20, 53, 16))
        self.label.setObjectName("label")
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(20, 20, 53, 16))
        self.label_2.setObjectName("label_2")
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setEnabled(False)
        self.plainTextEdit.setGeometry(QtCore.QRect(20, 40, 31, 31))
        self.plainTextEdit.setBackgroundVisible(False)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.plainTextEdit_2 = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit_2.setEnabled(False)
        self.plainTextEdit_2.setGeometry(QtCore.QRect(120, 40, 31, 31))
        self.plainTextEdit_2.setBackgroundVisible(False)
        self.plainTextEdit_2.setObjectName("plainTextEdit_2")
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(120, 20, 41, 16))
        self.label_3.setObjectName("label_3")
        self.label_4 = QtGui.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(20, 80, 351, 16))
        self.label_4.setObjectName("label_4")
        QtCore.QObject.connect(self.comboBox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.SIGNAL_comboBox_Changed)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #29
Source File: GDT.py    From FreeCAD-GDT with GNU Lesser General Public License v2.1 5 votes vote down vote up
def generateWidget( self, idGDT, ContainerOfData ):
        self.idGDT = idGDT
        self.ContainerOfData = ContainerOfData
        if hasattr(FreeCADGui,"Snapper"):
            if FreeCADGui.Snapper.grid:
                FreeCAD.DraftWorkingPlane.alignToPointAndAxis(self.ContainerOfData.p1, self.ContainerOfData.Direction, 0.0)
                FreeCADGui.Snapper.grid.set()
        self.FORMAT = makeFormatSpec(0,'Length')
        self.uiloader = FreeCADGui.UiLoader()
        self.inputfield = self.uiloader.createWidget("Gui::InputField")
        self.inputfield.setText(self.FORMAT % 0)
        self.ContainerOfData.OffsetValue = 0
        QtCore.QObject.connect(self.inputfield,QtCore.SIGNAL("valueChanged(double)"),self.valueChanged)

        return GDTDialog_hbox(self.Text,self.inputfield) 
Example #30
Source File: test_version_creator.py    From anima with MIT License 5 votes vote down vote up
def show_dialog(self, dialog):
        """show the given dialog
        """
        dialog.show()
        self.app.exec_()
        self.app.connect(
            self.app,
            QtCore.SIGNAL("lastWindowClosed()"),
            self.app,
            QtCore.SLOT("quit()")
        )