本文整理匯總了Python中PyQt5.QtCore.SIGNAL屬性的典型用法代碼示例。如果您正苦於以下問題:Python QtCore.SIGNAL屬性的具體用法?Python QtCore.SIGNAL怎麽用?Python QtCore.SIGNAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類PyQt5.QtCore
的用法示例。
在下文中一共展示了QtCore.SIGNAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: plothist
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def plothist(self, img, fScale=False): #perhaps this should be called in a separate thread?
bins=256
rangetop=1.0 if fScale else 256
imgsize=img.shape
mask = getMask(img, mask_pct)
bwimg=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
bhist = cv2.calcHist([bwimg],[0],mask,[256],[0,rangetop])
bhist[0]=0
over = [0,0,0,0]
over[3]=sum(bhist[:10])
px = imgsize[0]*imgsize[1]*mask_pct*mask_pct
ylim=px/128 #arbitrary value to keep y limit consistent and reasonable
hists=[]
for i in range(0,3):
hist = cv2.calcHist([img],[i],mask,[256],[0,rangetop])
over[i]=sum(hist[252:])
hists.append(hist)
avg=int(cv2.mean(bwimg)[0]*100.0/rangetop)
#logging.debug("Sending Signal")
self.plotHistogramSig.emit(hists,bhist,px)
self.displayWashoutsSig.emit(over, px, avg)
#self.emit(qtcore.SIGNAL("plotHistogram(PyQt_PyObject, PyQt_PyObject, float)"), hists, bhist, px)
#self.emit(qtcore.SIGNAL("displayWashouts(PyQt_PyObject, float, float)"), over, px, avg)
示例2: __init__
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def __init__(self):
super(MainWindow,self).__init__()
self.resize(300, 300)
self.setWindowTitle('GL Cube Test')
self.initActions()
self.initMenus()
glWidget = GLWidget(self)
self.setCentralWidget(glWidget)
timer = QtCore.QTimer(self)
timer.setInterval(20)
QtCore.QObject.connect(timer, QtCore.SIGNAL('timeout()'), glWidget.onTimer)
timer.start()
示例3: set_menu
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def set_menu(self):
menubar = self.menuBar()
fileMenu = menubar.addMenu('&File')
exit = QtWidgets.QAction("Exit", self)
exit.setShortcut("Ctrl+Q")
exit.setStatusTip('Exit application')
exit.triggered.connect(qApp.quit)
fileMenu.addAction(exit)
save = QtWidgets.QAction("Save", self)
save.setShortcut("Ctrl+S")
save.setStatusTip('save obj file')
save.triggered.connect(self.viewer3D.save)
fileMenu.addAction(save)
self.flag_ = 0
self.label_ = "female"
self.mode = {0:"global_mapping", 1:"local_with_mask", 2:"local_with_rfemat"}
for i in range(0, len(self.mode)):
mode = myAction(i, self.mode[i], self)
mode.myact.connect(self.select_mode)
#self.connect(mode, QtCore.SIGNAL('myact(int)'), self.select_mode)
fileMenu.addAction(mode)
self.setToolTip('This is a window, or <b>something</b>')
示例4: setXRotation
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def setXRotation(self, angle):
angle = self.normalizeAngle(angle)
if angle != self.xRot:
self.xRot = angle
#self.emit(QtCore.SIGNAL("xRotationChanged(int)"), angle)
self.update()
示例5: setYRotation
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def setYRotation(self, angle):
angle = self.normalizeAngle(angle)
if angle != self.yRot:
self.yRot = angle
#self.emit(QtCore.SIGNAL("yRotationChanged(int)"), angle)
self.update()
示例6: setZRotation
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def setZRotation(self, angle):
angle = self.normalizeAngle(angle)
if angle != self.zRot:
self.zRot = angle
#self.emit(QtCore.SIGNAL("zRotationChanged(int)"), angle)
self.update()
示例7: updateFrameNum
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def updateFrameNum(self,i):
self.updateFrameNumSig.emit(i)
#self.emit(qtcore.SIGNAL("updateFrameNum(int)"), i)
示例8: updateSS
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def updateSS(self, ss, again, dgain):
self.updateSSSig.emit(ss,again,dgain)
#self.emit(qtcore.SIGNAL("updateSS(int, int, int)"), ss, again, dgain)
示例9: updateGains
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def updateGains(self, r, b):
self.updateGainsSig.emit(r,b)
#self.emit(qtcore.SIGNAL("updateGains(int, int)"), r, b)
示例10: updateStatus
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def updateStatus(self,status):
self.updateStatusSig.emit(status)
#self.emit(qtcore.SIGNAL("updateStatus(QString)"), status)
示例11: initUI
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def initUI(self):
self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
shortcut = QtWidgets.QShortcut(QtGui.QKeySequence("F4"), self, self.close, self.close)
#QtCore.QObject.connect(self.ui.ok, QtCore.SIGNAL('clicked()'), self.onClicked)
示例12: initActions
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def initActions(self):
self.exitAction = QtWidgets.QAction('Quit', self)
self.exitAction.setShortcut('Ctrl+Q')
self.exitAction.setStatusTip('Exit application')
self.connect(self.exitAction, QtCore.SIGNAL('triggered()'), self.close)
示例13: __init__
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def __init__(self, parent):
self.parent = parent
self.statusBar = parent.statusBar()
self.pixmap_green = QtGui.QPixmap("icons/green.png", "PNG")
self.pixmap_yellow = QtGui.QPixmap("icons/yellow.png", "PNG")
self.pixmap_red = QtGui.QPixmap("icons/red.png", "PNG")
self.statusPixmap = QtWidgets.QLabel("image", self.statusBar)
self.statusPixmap.setPixmap(self.pixmap_green)
self.__statusTimer = QtCore.QTimer(self.parent)
# self.parent.connect(self.__statusTimer, QtCore.SIGNAL("timeout()"), self.resetMessage)
self.__statusLabel = QtWidgets.QLabel("Default", self.statusBar)
self.progressbar = QtWidgets.QProgressBar(self.statusBar)
self.progressbar.setMinimum(0)
self.progressbar.setMaximum(100)
self.progressbar.setValue(0)
self.progressbar.setTextVisible(False)
self.lastMessage = ''
self.statusSize = QtWidgets.QLabel("", self.statusBar)
self.statusZoom = QtWidgets.QLabel("", self.statusBar)
self.statusScale = QtWidgets.QLabel("", self.statusBar)
self.statusLevel = QtWidgets.QLabel("", self.statusBar)
self.statusBar.addWidget(self.statusPixmap, 0)
self.statusBar.addWidget(self.__statusLabel, 0)
self.statusBar.addWidget(self.progressbar, 1)
self.statusBar.addWidget(self.statusSize, 0)
self.statusBar.addWidget(self.statusZoom, 0)
self.statusBar.addWidget(self.statusScale, 0)
self.statusBar.addWidget(self.statusLevel, 0)
示例14: __init__
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def __init__(self, *args):
super(CodeView, self).__init__(*args)
from UIManager import UIManager
self.setScene(UIManager.instance().getScene())
self.setViewportUpdateMode(QtWidgets.QGraphicsView.FullViewportUpdate)
self.setCacheMode(QtWidgets.QGraphicsView.CacheNone)
#self.setDragMode(QtWidgets.QGraphicsView.RubberBandDrag)
self.setTransformationAnchor(QtWidgets.QGraphicsView.AnchorUnderMouse)
self.setMouseTracking(True)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setAcceptDrops(True)
self.mousePressPnt = None
self.mouseCurPnt = None
self.isFrameSelectMode = False
self.isMousePressed = False
self.updateTimer = QtCore.QTimer()
self.updateTimer.setInterval(70)
# self.connect(self.updateTimer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT('updateView()'))
self.updateTimer.timeout.connect(self.updateView)
self.centerPnt = QtCore.QPointF()
self.scale(0.6,0.6)
self.brushRadius = 8
self.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(50,50,50)))
self.hudFont = QtGui.QFont('tahoma', 8)
self.hudFontMetric = QtGui.QFontMetrics(self.hudFont)
示例15: __init__
# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import SIGNAL [as 別名]
def __init__(self, *args):
super(CodeScene, self).__init__(*args)
self.itemDict = {}
self.edgeDict = {}
self.stopItem = {} # 不顯示的符號
self.scheme = {} # 保存的call graph,
# {'schemeName': {'node':[node1, node2,...], 'edge':{(node3, node5):{'customEdge':True}, ...}}, ...}
self.curValidScheme = []# 選中物體有關的scheme
self.curValidSchemeColor = []
self.candidateEdge = [] # candidate edge up/down/left/right will select
self.isSourceCandidate = True
self.edgeDataDict = {} # 存放需要保存的邊用戶數據
self.itemDataDict = {} # 存放需要保存的點用戶數據
self.itemLruQueue = []
self.lruMaxLength = 100
self.isLayoutDirty = False
self.setItemIndexMethod(QtWidgets.QGraphicsScene.NoIndex)
self.lock = RecursiveLock()
self.updateThread = SceneUpdateThread(self, self.lock)
self.updateThread.start()
self.cornerItem = []
self.autoFocus = True
self.autoFocusToggle = True
self.selectTimeStamp = 0
for i in range(4):
item = QtWidgets.QGraphicsRectItem(0,0,5,5)
item.setPen(QtGui.QPen(QtGui.QColor(0,0,0,0)))
item.setBrush(QtGui.QBrush())
self.cornerItem.append(item)
self.addItem(item)
# self.connect(self, QtCore.SIGNAL('selectionChanged()'), self, QtCore.SLOT('onSelectItems()'))
self.selectionChanged.connect(self.onSelectItems)
# 添加或修改call graph