当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.SLOT属性代码示例

本文整理汇总了Python中PyQt4.QtCore.SLOT属性的典型用法代码示例。如果您正苦于以下问题:Python QtCore.SLOT属性的具体用法?Python QtCore.SLOT怎么用?Python QtCore.SLOT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在PyQt4.QtCore的用法示例。


在下文中一共展示了QtCore.SLOT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createDEToptGroup

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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 
开发者ID:lzx1413,项目名称:LabelImgTool,代码行数:24,代码来源:settingDialog.py

示例2: initUI

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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) 
开发者ID:HatBoy,项目名称:SimpleSniffer,代码行数:42,代码来源:Sniffer.py

示例3: __init__

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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()')) 
开发者ID:fabioz,项目名称:PyDev.Debugger,代码行数:13,代码来源:gui-qt.py

示例4: __init__

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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()')) 
开发者ID:crawfordsm,项目名称:specidentify,代码行数:38,代码来源:interidentify.py

示例5: sleep

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
def sleep(self, time):
        timer = QtCore.QTimer()
        el = QtCore.QEventLoop()

        timer.singleShot(time, el, QtCore.SLOT("quit()"))
        el.exec_() 
开发者ID:Denvi,项目名称:FlatCAM,代码行数:8,代码来源:test_vispy_plot.py

示例6: show_dialog

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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()")
        ) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:13,代码来源:test_version_creator.py

示例7: pushedClear

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
def pushedClear(self):
        self.text.clear()
        self.axes.cla()
        self.canvas.draw()
        QtCore.SLOT('quit()') 
开发者ID:FOSSEE,项目名称:eSim,代码行数:7,代码来源:pythonPlotting.py

示例8: __init__

# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import SLOT [as 别名]
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()')) 
开发者ID:mrknow,项目名称:filmkodi,代码行数:13,代码来源:gui-qt.py


注:本文中的PyQt4.QtCore.SLOT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。