當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCore.SIGNAL屬性代碼示例

本文整理匯總了Python中PyQt4.QtCore.SIGNAL屬性的典型用法代碼示例。如果您正苦於以下問題:Python QtCore.SIGNAL屬性的具體用法?Python QtCore.SIGNAL怎麽用?Python QtCore.SIGNAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在PyQt4.QtCore的用法示例。


在下文中一共展示了QtCore.SIGNAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: doSettings

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def doSettings(millisecWait, depth, fontSize):
  global ui
  Dialog = QtGui.QDialog()
  settings = uic.loadUi(os.path.join(os.path.dirname(__file__), "./ui/settings.ui"), baseinstance=Dialog)
  ui = settings
  Dialog.setModal(True)
  QtCore.QObject.connect(settings.lineEditNfSamples,  QtCore.SIGNAL('textChanged (const QString&)'), onChange)
  QtCore.QObject.connect(settings.lineEditTimesSecond,  QtCore.SIGNAL('textChanged (const QString&)'), onChange)
  ui.lineEditTimesSecond.setText(str(float(1000.0 / (millisecWait * 1.0))))
  ui.lineEditNfSamples.setText(str(depth))
  ui.lineEditFontSize.setText(str(fontSize))
  Dialog.exec_()
  
  millisecWait = int(1000.0 / float(str(ui.lineEditTimesSecond.displayText())))
  depth = int(str(ui.lineEditNfSamples.displayText()))
  fontSize = int(str(ui.lineEditFontSize.displayText()))
  return(millisecWait, depth, fontSize) 
開發者ID:wolfc01,項目名稱:procexp,代碼行數:19,代碼來源:settings.py

示例2: getTiles

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def getTiles(self, t, i=0):
        t = int(t / 600)*600
        self.getTime = t
        self.getIndex = i
        if i == 0:
            self.tileurls = []
            self.tileQimages = []
            for tt in self.tiletails:
                tileurl = "https://tilecache.rainviewer.com/v2/radar/%d/%s" \
                    % (t, tt)
                self.tileurls.append(tileurl)
        print self.myname + " " + str(self.getIndex) + " " + self.tileurls[i]
        self.tilereq = QNetworkRequest(QUrl(self.tileurls[i]))
        self.tilereply = manager.get(self.tilereq)
        QtCore.QObject.connect(self.tilereply, QtCore.SIGNAL(
                "finished()"), self.getTilesReply) 
開發者ID:n0bel,項目名稱:PiClock,代碼行數:18,代碼來源:PyQtPiClock.py

示例3: doHeavyLifting

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def doHeavyLifting(self):
        """
        UI callback, starts the thread with the proper arguments.
        """
        if self.thread: # Sanity check.
            return

        self.singleProgress.setValue(1)
        self.progressDialog.show();
        self.mytimer.start(1000);
        QtGui.QApplication.setOverrideCursor(
            QtGui.QCursor(QtCore.Qt.WaitCursor))
        self.thread = WorkThread(target=self.display_result)
        QtCore.QObject.connect(self.thread, QtCore.SIGNAL("mainThread"),
                     self.mainThread)
        QtCore.QObject.connect(self.thread, QtCore.SIGNAL("finished()"), self.threadDone)

        self.thread.start() 
開發者ID:linuxscout,項目名稱:mishkal,代碼行數:20,代碼來源:appgui.py

示例4: run

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def run(self):
        self.lastTime = time.time()
        while self.running:
            # Timer
            self.delta = time.time() - self.lastTime
            if self.delta < self.limitDelta:
                time.sleep(self.limitDelta - self.delta)
            # print(1.0/(time.time() - self.lastTime))
            self.lastTime = time.time()

            # Process recieved queues
            if not self.cmdQueue.empty():
                # receive value must be tuple type
                cmd, value = self.cmdQueue.get()
                cmdName = get_command_name(cmd)
                # recieved queues
                if cmd == COMMAND.CLOSE_UI:
                    self.running = False
                # call binded signal event
                self.emit(QtCore.SIGNAL(cmdName), value) 
開發者ID:ubuntunux,項目名稱:PyEngine3D,代碼行數:22,代碼來源:MainWindow.py

示例5: sort

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def sort(self, col, order=None):
        if col in PlayerModel.sortableColumns:
            reverse = False
            if order == QtCore.Qt.DescendingOrder:
                reverse = True
            self.lastSort = col
            self.lastSortOrder = order
            getter = operator.itemgetter(col)
            if col in [PlayerModel.PLAYER, PlayerModel.OPPONENT]:
                keyfunc = lambda x: getter(x).lower()
            else:
                keyfunc = getter
            self.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))
            self.players = sorted(self.players, key=keyfunc, reverse=reverse)
            self.players = sorted(self.players, key=operator.itemgetter(PlayerModel.STATE))
            self.emit(QtCore.SIGNAL("layoutChanged()")) 
開發者ID:doctorguile,項目名稱:pyqtggpo,代碼行數:18,代碼來源:playermodel.py

示例6: setupUi

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def setupUi(self, EmoticonDialog):
        EmoticonDialog.setObjectName(_fromUtf8("EmoticonDialog"))
        EmoticonDialog.resize(300, 500)
        self.verticalLayout = QtGui.QVBoxLayout(EmoticonDialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(EmoticonDialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.uiEmoticonTextEdit = QtGui.QTextEdit(EmoticonDialog)
        self.uiEmoticonTextEdit.setObjectName(_fromUtf8("uiEmoticonTextEdit"))
        self.verticalLayout.addWidget(self.uiEmoticonTextEdit)
        self.buttonBox = QtGui.QDialogButtonBox(EmoticonDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(EmoticonDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EmoticonDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EmoticonDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(EmoticonDialog) 
開發者ID:doctorguile,項目名稱:pyqtggpo,代碼行數:23,代碼來源:customemoticonsdialog_ui.py

示例7: waiting_dialog

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def waiting_dialog(self, f):
        s = Timer()
        s.start()
        w = QDialog()
        w.resize(200, 70)
        w.setWindowTitle('Encompass')
        l = QLabel(_('Sending transaction, please wait.'))
        vbox = QVBoxLayout()
        vbox.addWidget(l)
        w.setLayout(vbox)
        w.show()
        def ff():
            s = f()
            if s: l.setText(s)
            else: w.close()
        w.connect(s, QtCore.SIGNAL('timersignal'), ff)
        w.exec_()
        w.destroy() 
開發者ID:mazaclub,項目名稱:encompass,代碼行數:20,代碼來源:lite_window.py

示例8: dispatch

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def dispatch(self, signal, *args):
		"""
			\remarks	dispatches a string based signal through the system from an application
			\param		signal	<str>
			\param		*args	<tuple> additional arguments
		"""
		if cross3d.application.shouldBlockSignal(signal, self.signalsBlocked()):
			return

		# emit a defined pyqtSignal
		if (hasattr(self, signal) and type(getattr(self, signal)).__name__ == 'pyqtBoundSignal'):
			getattr(self, signal).emit(*args)

		# otherwise emit a custom signal
		else:
			from PyQt4.QtCore import SIGNAL
			self.emit(SIGNAL(signal), *args)

		# emit linked signals
		if (signal in self._linkedSignals):
			for trigger in self._linkedSignals[signal]:
				self.dispatch(trigger) 
開發者ID:blurstudio,項目名稱:cross3d,代碼行數:24,代碼來源:dispatch.py

示例9: dispatchObject

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def dispatchObject(self, signal, *args):
		"""
			\remarks	dispatches a string based signal through the system from an application
			\param		signal	<str>
			\param		*args	<tuple> additional arguments
		"""
		if cross3d.application.shouldBlockSignal(signal, self.signalsBlocked()):
			return

		# emit a defined pyqtSignal
		if (hasattr(self, signal) and type(getattr(self, signal)).__name__ == 'pyqtBoundSignal') and args[0]:
			getattr(self, signal).emit(cross3d.SceneObject(cross3d.Scene.instance(), args[0]))

		# otherwise emit a custom signal
		else:
			from PyQt4.QtCore import SIGNAL
			self.emit(SIGNAL(signal), *args)

		# emit linked signals
		if (signal in self._linkedSignals):
			for trigger in self._linkedSignals[signal]:
				self.dispatch(trigger) 
開發者ID:blurstudio,項目名稱:cross3d,代碼行數:24,代碼來源:dispatch.py

示例10: dispatchEvent

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def dispatchEvent(self, signal, *args):
		print 'Dispatching event', signal
		if ( self.signalsBlocked() ):
			return
			
		# emit a defined pyqtSignal
		if ( hasattr(Dispatch,signal) and type(getattr(Dispatch,signal)).__name__ == 'pyqtBoundSignal' ):
			# this should identify the object type before emiting it if it needs to emit something
			getattr(Dispatch,signal).emit(SceneObject(Scene.instance(), args[0]))
		
		# elif process application specific signals like xsi's value changed
		
		# otherwise emit a custom signal
		else:
			from PyQt4.QtCore import SIGNAL
			self.emit( SIGNAL( signal ), *args )
		
		# emit linked signals
		if ( signal in self._linkedSignals ):
			for trigger in self._linkedSignals[signal]:
				self.dispatch( trigger ) 
開發者ID:blurstudio,項目名稱:cross3d,代碼行數:23,代碼來源:dispatchprocess.py

示例11: updatesection

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def updatesection(self):
        self.y1 = int(self.y1ValueEdit.text())
        self.y2 = int(self.y2ValueEdit.text())
        self.nrows = int(self.nrValueEdit.text())
        self.rstep = int(self.nsValueEdit.text())
        if abs(self.y1 - self.y2) != self.nrows:
            if self.log:
                self.log.warning(
                    "Warning: Update y2 to increase the row sampling")
        ## self.y1line.set_ydata([self.y1, self.y1])
        ## self.y2line.set_ydata([self.y2, self.y2])
        self.y1line.y1 = self.y1
        self.y1line.y2 = self.y1
        self.y2line.y1 = self.y2
        self.y2line.y2 = self.y2
        self.imdisplay.redraw(whence=3)
        self.emit(QtCore.SIGNAL("regionChange(int,int)"), self.y1, self.y2) 
開發者ID:crawfordsm,項目名稱:specidentify,代碼行數:19,代碼來源:interidentify.py

示例12: err_redraw_canvas

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def err_redraw_canvas(self, keepzoom=False):
        if keepzoom:
            # Store current zoom level
            xmin, xmax = self.erraxes.get_xlim()
            ymin, ymax = self.erraxes.get_ylim()
        else:
            self.xmin, self.xmax = self.axes.get_xlim()

        # Clear plot
        self.erraxes.clear()

        # Draw image
        self.plotErr()

        # Restore zoom level
        if keepzoom:
            self.erraxes.set_xlim((xmin, xmax))
            self.erraxes.set_ylim((ymin, ymax))
        else:
            self.erraxes.set_xlim((self.xmin, self.xmax))

        self.errfigure.draw()

        self.emit(QtCore.SIGNAL("fitUpdate()")) 
開發者ID:crawfordsm,項目名稱:specidentify,代碼行數:26,代碼來源:interidentify.py

示例13: __init__

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def __init__(self):
        super(WorkerStack, self).__init__()

        self.workers = []
        self.threads = []
        self.load = {}                                  # {'worker_name': tasks_count}

        # Create workers crew
        for i in range(0, 2):
            worker = Worker(self, 'Slogger-' + str(i))
            thread = QtCore.QThread()

            worker.moveToThread(thread)
            worker.connect(thread, QtCore.SIGNAL("started()"), worker.run)
            worker.task_completed.connect(self.on_task_completed)

            thread.start()

            self.workers.append(worker)
            self.threads.append(thread)
            self.load[worker.name] = 0 
開發者ID:Denvi,項目名稱:FlatCAM,代碼行數:23,代碼來源:FlatCAMWorkerStack.py

示例14: Establish_Connections

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def Establish_Connections(self):
        # loop button and menu action to link to functions
        for ui_name in self.uiList.keys():
            if ui_name.endswith('_btn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_atn'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-4]+"_action", partial(self.default_action,ui_name)))
            elif ui_name.endswith('_btnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("clicked()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
            elif ui_name.endswith('_atnMsg'):
                QtCore.QObject.connect(self.uiList[ui_name], QtCore.SIGNAL("triggered()"), getattr(self, ui_name[:-7]+"_message", partial(self.default_message,ui_name)))
        # custom connection
    
    #=======================================
    # UI Response functions (custom + prebuilt functions)
    #=======================================
    #-- ui actions 
開發者ID:shiningdesign,項目名稱:universal_tool_template.py,代碼行數:19,代碼來源:universal_tool_template_v7.3.py

示例15: run

# 需要導入模塊: from PyQt4 import QtCore [as 別名]
# 或者: from PyQt4.QtCore import SIGNAL [as 別名]
def run(self ):
        # make sure current user have access right to execute shellScriptFile
        try :
            isFileExecuteable = os.access( self.shellScriptFile, os.X_OK )
            if not isFileExecuteable :
                response = "Error: Please make sure your shell script file has execute permission!"
                self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response)

        except OSError as e:
            response = "Error: Cannot read shell script file!"
            self.emit(QtCore.SIGNAL("updateResponseShellScript(QString)"), response)


        if self.shellScriptType == "installer" :
            self.doInstall()

        else:
            self.visitService() 
開發者ID:glamrock,項目名稱:Stormy,代碼行數:20,代碼來源:shellScriptExecutor.py


注:本文中的PyQt4.QtCore.SIGNAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。