Python PyQt4.QtCore.SLOT Examples

The following are 12 code examples of PyQt4.QtCore.SLOT(). 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 PyQt4.QtCore , or try the search function .
Example #1
Source File: settingDialog.py    From LabelImgTool with MIT License 6 votes vote down vote up
def createDEToptGroup(self):
        self.detgroupBox = QtGui.QGroupBox("& DET options")
        self.enable_show_label_cb = QtGui.QCheckBox('enable show label name')


        self.label_font_size_sl = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.label_font_size_sl.setRange(5,50)
        self.label_font_size_sp = QtGui.QSpinBox()
        self.label_font_size_sp.setRange(5,50)
        QtCore.QObject.connect(self.label_font_size_sl, QtCore.SIGNAL("valueChanged(int)"),

                               self.label_font_size_sp, QtCore.SLOT("setValue(int)"))
        self.label_font_size_sl.valueChanged.connect(self.change_label_font_size)
        self.label_font_size_sl.setValue(self.__class__.label_font_size)
        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.enable_show_label_cb)
        vbox.addWidget(QtGui.QLabel('label font size'))
        vbox.addWidget(self.label_font_size_sl)
        vbox.addWidget(self.label_font_size_sp)
        vbox.addStretch()
        self.detgroupBox.setLayout(vbox)
        return self.detgroupBox 
Example #2
Source File: Sniffer.py    From SimpleSniffer with GNU General Public License v3.0 5 votes vote down vote up
def initUI(self):
        device_data = get_iface_name()
        iface_num = len(device_data)
        iface_keys = device_data.keys()
        #网卡列表
        self.radio_lists = []
        self.gridlayout = QtGui.QGridLayout()
        self.label_name = QtGui.QLabel(u'接口名')
        self.label_ip = QtGui.QLabel(u'IP地址')
        self.label_receive = QtGui.QLabel(u'接受流量')
        self.label_send = QtGui.QLabel(u'发送流量')
        self.gridlayout.addWidget(self.label_name, 1, 1)
        self.gridlayout.addWidget(self.label_ip, 1, 2)
        self.gridlayout.addWidget(self.label_receive, 1, 3)
        self.gridlayout.addWidget(self.label_send, 1, 4)
        self.setLayout(self.gridlayout)
        for i in range(iface_num):
            iface_name = iface_keys[i]
            self.iface_radio = QtGui.QRadioButton(iface_name)
            if iface_name == 'eth0':
                self.iface_radio.setChecked(True)
            self.gridlayout.addWidget(self.iface_radio, i+2, 1)
            self.radio_lists.append(self.iface_radio)
            self.ip_label = QtGui.QLabel(get_ip_address(iface_name))
            self.gridlayout.addWidget(self.ip_label, i+2, 2)
            data = device_data[iface_name].split(';')
            self.receive_label = QtGui.QLabel(data[0])
            self.send_label = QtGui.QLabel(data[1])
            self.gridlayout.addWidget(self.receive_label, i+2, 3)
            self.gridlayout.addWidget(self.send_label, i+2, 4)
            self.setLayout(self.gridlayout)
        #添加按钮
        self.start_but = QtGui.QPushButton(u'确定', self)
        self.start_but.clicked.connect(self.exit_me)
        self.start_but.setCheckable(False)
        self.gridlayout.addWidget(self.start_but, iface_num + 2, 2)
        self.cancel_but = QtGui.QPushButton(u'取消', self)
        self.connect(self.cancel_but, QtCore.SIGNAL('clicked()'), QtCore.SLOT('close()'))
        self.cancel_but.setCheckable(False)
        self.gridlayout.addWidget(self.cancel_but, iface_num + 2, 3) 
Example #3
Source File: gui-qt.py    From PyDev.Debugger with Eclipse Public License 1.0 5 votes vote down vote up
def __init__(self, parent=None):
            QtGui.QWidget.__init__(self, parent)
    
            self.setGeometry(300, 300, 200, 80)
            self.setWindowTitle('Hello World')
    
            quit = QtGui.QPushButton('Close', self)
            quit.setGeometry(10, 10, 60, 35)
    
            self.connect(quit, QtCore.SIGNAL('clicked()'),
                         self, QtCore.SLOT('close()')) 
Example #4
Source File: interidentify.py    From specidentify with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, xarr, specarr, slines, sfluxes, ws, hmin=150, wmin=400, mdiff=20, wdiff=20,
                 filename=None, res=2.0, dres=0.1, dc=20, ndstep=20, sigma=5, smooth=0, niter=5, istart=None,
                 nrows=1, rstep=100, method='Zeropoint', ivar=None, cmap='gray', scale='zscale', contrast=1.0,
                 subback=0, textcolor='green', log=None, verbose=True, prefer_ginga=True):
        """Default constructor."""

        # Setup widget
        QtGui.QMainWindow.__init__(self)

        # Set main widget
        self.main = InterIdentifyWidget(xarr, specarr, slines, sfluxes, ws,
                                        hmin=150, wmin=400, mdiff=mdiff, wdiff=wdiff,
                                        filename=filename, res=res, dres=dres, dc=dc,
                                        ndstep=ndstep, sigma=sigma, smooth=smooth,
                                        niter=niter, istart=istart, nrows=nrows,
                                        rstep=rstep, method=method, ivar=ivar,
                                        cmap=cmap, scale=scale, contrast=contrast,
                                        subback=subback, textcolor=textcolor,
                                        log=log, verbose=verbose,
                                        prefer_ginga=prefer_ginga)

        # Set window title
        self.setWindowTitle("InterIdentify")

        # Set focus to main widget
        # self.main.setFocus()

        # Set the main widget as the central widget
        self.setCentralWidget(self.main)

        # Destroy widget on close
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        # Close when config dialog is closed
        ## self.connect(self.conf, QtCore.SIGNAL('destroyed()'),
        ##              self, QtCore.SLOT('close()')) 
Example #5
Source File: test_vispy_plot.py    From FlatCAM with MIT License 5 votes vote down vote up
def sleep(self, time):
        timer = QtCore.QTimer()
        el = QtCore.QEventLoop()

        timer.singleShot(time, el, QtCore.SLOT("quit()"))
        el.exec_() 
Example #6
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()")
        ) 
Example #7
Source File: test_reference_editor.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 #8
Source File: test_version_updater.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 #9
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 #10
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 #11
Source File: pythonPlotting.py    From eSim with GNU General Public License v3.0 5 votes vote down vote up
def pushedClear(self):
        self.text.clear()
        self.axes.cla()
        self.canvas.draw()
        QtCore.SLOT('quit()') 
Example #12
Source File: gui-qt.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None):
            QtGui.QWidget.__init__(self, parent)

            self.setGeometry(300, 300, 200, 80)
            self.setWindowTitle('Hello World')

            quit = QtGui.QPushButton('Close', self)
            quit.setGeometry(10, 10, 60, 35)

            self.connect(quit, QtCore.SIGNAL('clicked()'),
                         self, QtCore.SLOT('close()'))