本文整理匯總了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
示例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)
示例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()'))
示例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()'))
示例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_()
示例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()")
)
示例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()')
示例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()'))