Python PyQt5.QtCore.SIGNAL Examples

The following are 21 code examples for showing how to use PyQt5.QtCore.SIGNAL(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtCore , or try the search function .

Example 1
Project: rpi-film-capture   Author: jphfilm   File: fcImgThread.py    License: MIT License 6 votes vote down vote up
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) 
Example 2
Project: spimagine   Author: maweigert   File: basic_window.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example 3
Project: 3D-Human-Body-Shape   Author: 1900zyh   File: demo.py    License: MIT License 6 votes vote down vote up
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>') 
Example 4
Project: simnibs   Author: simnibs   File: electrodeGUI.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setXRotation(self, angle):
        angle = self.normalizeAngle(angle)
        if angle != self.xRot:
            self.xRot = angle
            #self.emit(QtCore.SIGNAL("xRotationChanged(int)"), angle)
            self.update() 
Example 5
Project: simnibs   Author: simnibs   File: electrodeGUI.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setYRotation(self, angle):
        angle = self.normalizeAngle(angle)
        if angle != self.yRot:
            self.yRot = angle
            #self.emit(QtCore.SIGNAL("yRotationChanged(int)"), angle)
            self.update() 
Example 6
Project: simnibs   Author: simnibs   File: electrodeGUI.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setZRotation(self, angle):
        angle = self.normalizeAngle(angle)
        if angle != self.zRot:
            self.zRot = angle
            #self.emit(QtCore.SIGNAL("zRotationChanged(int)"), angle)
            self.update() 
Example 7
Project: rpi-film-capture   Author: jphfilm   File: fcImgThread.py    License: MIT License 5 votes vote down vote up
def updateFrameNum(self,i):
        self.updateFrameNumSig.emit(i)
        #self.emit(qtcore.SIGNAL("updateFrameNum(int)"), i) 
Example 8
Project: rpi-film-capture   Author: jphfilm   File: fcImgThread.py    License: MIT License 5 votes vote down vote up
def updateSS(self, ss, again, dgain):
        self.updateSSSig.emit(ss,again,dgain)
        #self.emit(qtcore.SIGNAL("updateSS(int, int, int)"), ss, again, dgain) 
Example 9
Project: rpi-film-capture   Author: jphfilm   File: fcImgThread.py    License: MIT License 5 votes vote down vote up
def updateGains(self, r, b):
        self.updateGainsSig.emit(r,b)
        #self.emit(qtcore.SIGNAL("updateGains(int, int)"), r, b) 
Example 10
Project: rpi-film-capture   Author: jphfilm   File: fcImgThread.py    License: MIT License 5 votes vote down vote up
def updateStatus(self,status):
        self.updateStatusSig.emit(status)
        #self.emit(qtcore.SIGNAL("updateStatus(QString)"), status) 
Example 11
Project: qiew   Author: mtivadar   File: qiew.py    License: GNU General Public License v2.0 5 votes vote down vote up
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) 
Example 12
Project: qiew   Author: mtivadar   File: qiew.py    License: GNU General Public License v2.0 5 votes vote down vote up
def initUI(self):      

        self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)

        shortcut = QtWidgets.QShortcut(QtGui.QKeySequence("F10"), self, self.close, self.close)

        self.ui.rsel.setChecked(True)
        self.ui.rbin.setChecked(True)
        #QtCore.QObject.connect(self.ui.ok, QtCore.SIGNAL('clicked()'), self.onClicked)
        self.ui.ok.clicked.connect(lambda: self.onClicked()) 
Example 13
Project: spimagine   Author: maweigert   File: basic_window.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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) 
Example 14
Project: PyRAT   Author: birgander2   File: StatusBar.py    License: Mozilla Public License 2.0 5 votes vote down vote up
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) 
Example 15
Project: CodeAtlasSublime   Author: league1991   File: codeview.py    License: Eclipse Public License 1.0 5 votes vote down vote up
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) 
Example 16
Project: CodeAtlasSublime   Author: league1991   File: codescene.py    License: Eclipse Public License 1.0 5 votes vote down vote up
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 
Example 17
Project: CodeAtlasSublime   Author: league1991   File: codescene.py    License: Eclipse Public License 1.0 5 votes vote down vote up
def disconnectSignals(self):
		#self.disconnect(self, QtCore.SIGNAL('selectionChanged()'), self, QtCore.SLOT('onSelectItems()'))
		self.selectionChanged.disconnect(self.onSelectItems) 
Example 18
Project: CodeAtlasSublime   Author: league1991   File: codescene.py    License: Eclipse Public License 1.0 5 votes vote down vote up
def connectSignals(self):
		#self.connect(self, QtCore.SIGNAL('selectionChanged()'), self, QtCore.SLOT('onSelectItems()'))
		self.selectionChanged.connect(self.onSelectItems) 
Example 19
Project: ayab-desktop   Author: AllYarnsAreBeautiful   File: dummy_plugin.py    License: GNU General Public License v3.0 5 votes vote down vote up
def onknit(self, e):
    logging.debug("called onknit on DummyKnittingPlugin")
    # Simulating a blocking task.
    for i in range(self._cycle_ammount):
      percent = (i / float(self._cycle_ammount))*100
      print(percent)
      self.parent_ui.emit(QtCore.SIGNAL('updateProgress(int)'), int(percent))
      time.sleep(0.1)
    self.finish()
    return True 
Example 20
Project: qiew   Author: mtivadar   File: qiew.py    License: GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, parent, plugin):
        super(WUnpack, self).__init__(parent)
        
        self.parent = parent
        self.plugin = plugin
        self.oshow = super(WUnpack, self).show

        root = os.path.dirname(sys.argv[0])

        self.ui = PyQt5.uic.loadUi(os.path.join(root, 'unpack.ui'), baseinstance=self)


        self.ui.setWindowTitle('Decrypt/Encrypt')


        self.manager = PluginManager(categories_filter={ "UnpackPlugin": DecryptPlugin})

        root = os.path.dirname(sys.argv[0])
        self.manager.setPluginPlaces([os.path.join(root, 'plugins', 'unpack')])
        #self.manager.setPluginPlaces(["plugins"])

        # Load plugins
        self.manager.locatePlugins()
        self.manager.loadPlugins()

        self.Plugins = {}
        Formats = []
        for plugin in self.manager.getPluginsOfCategory("UnpackPlugin"):
            # plugin.plugin_object is an instance of the plugin
            po = plugin.plugin_object
            if po.init(self.parent.dataModel, self.parent.viewMode):
                self.Plugins[plugin.name] = po
                #self.ui.horizontalLayout.addWidget(po.getUI())
                print('[+] ' + plugin.name)
                self.ui.listWidget.addItem(plugin.name)
                #Formats.append(po)

        self.ui.listWidget.currentItemChanged.connect(self.item_clicked)
        self.ui.listWidget.setCurrentRow(0)

        #self.ui.connect(self.ui.proceed, PyQt5.QtCore.SIGNAL("clicked()"), self.handleProceed)
        self.ui.proceed.clicked.connect(lambda: self.handleProceed())

        self.initUI() 
Example 21
Project: flare-ida   Author: fireeye   File: apply_callee_type_widget.py    License: Apache License 2.0 4 votes vote down vote up
def setupUi(self, ApplyCalleeDialog):
        ApplyCalleeDialog.setObjectName("ApplyCalleeDialog")
        ApplyCalleeDialog.resize(682, 313)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(ApplyCalleeDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(ApplyCalleeDialog)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.te_userTypeText = QtWidgets.QPlainTextEdit(ApplyCalleeDialog)
        self.te_userTypeText.setObjectName("te_userTypeText")
        self.horizontalLayout.addWidget(self.te_userTypeText)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.pb_useStandardType = QtWidgets.QPushButton(ApplyCalleeDialog)
        self.pb_useStandardType.setObjectName("pb_useStandardType")
        self.horizontalLayout_2.addWidget(self.pb_useStandardType)
        self.pb_useLocalType = QtWidgets.QPushButton(ApplyCalleeDialog)
        self.pb_useLocalType.setObjectName("pb_useLocalType")
        self.horizontalLayout_2.addWidget(self.pb_useLocalType)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.buttonBox = QtWidgets.QDialogButtonBox(ApplyCalleeDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(ApplyCalleeDialog)
        #QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), ApplyCalleeDialog.accept)
        #QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), ApplyCalleeDialog.reject)

        self.buttonBox.accepted.connect(ApplyCalleeDialog.accept)
        self.buttonBox.rejected.connect(ApplyCalleeDialog.reject)

        QtCore.QMetaObject.connectSlotsByName(ApplyCalleeDialog)