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


Python QtCore.SIGNAL屬性代碼示例

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


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

示例1: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__(self):
        QObject.__init__(self, None)
        self._mainthread = QThread.currentThread()

        self._signalthread = SignalThread()
        QObject.connect(self._signalthread, SIGNAL("triggerSignal()"),
                        self.sensorQueueChanged)

        self._idletimer = QTimer()
        self._delaytimer = QTimer()
        self._timerqueuetimer = QTimer()

        self._idletimer.setSingleShot(True)
        self._delaytimer.setSingleShot(True)
        self._timerqueuetimer.setSingleShot(True)

        self.connect(self._idletimer, SIGNAL("timeout()"), self.idleTimeout)
        self.connect(self._delaytimer, SIGNAL("timeout()"), self.delayTimeout)
        self.connect(self._timerqueuetimer, SIGNAL("timeout()"), self.timerQueueTimeout)

        SoDB.getSensorManager().setChangedCallback(self.sensorQueueChangedCB, self)
        SoDB.setRealTimeInterval(1.0 / 25.0)
        SoRenderManager.enableRealTimeUpdate(False) 
開發者ID:coin3d,項目名稱:pivy,代碼行數:25,代碼來源:SensorManager.py

示例2: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__(self, parent=None):
        super(AccountWidget, self).__init__(parent)

        self.create_account_button = QPushButton("Create Account")
        self.create_account_button.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        self.connect(self.create_account_button, SIGNAL('clicked()'), self.createNewAccount)

        self.accounts_layout = QVBoxLayout()

        accounts = blockchain.get_accounts()

        for account, balance in accounts:
            self._addAccountToWindow(account, balance)

        layout = QGridLayout()

        layout.addWidget(self.create_account_button, 0, 0)
        layout.addLayout(self.accounts_layout, 1, 0)

        self.setLayout(layout)

        self.balance_thread = BalanceThread()
        self.balance_thread.get_balance_transaction.connect(self._updateBalances)
        self.balance_thread.start() 
開發者ID:PacktPublishing,項目名稱:Hands-On-Blockchain-for-Python-Developers,代碼行數:26,代碼來源:account_widget.py

示例3: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__(self, parent=None):
        super(TokenWidget, self).__init__(parent)

        self.watch_token_button = QPushButton("Watch Token")

        tokens = blockchain.get_tokens()

        self.tokens_layout = QVBoxLayout()

        for address, token_from_json in tokens.items():
            token_information = blockchain.get_token_named_tuple(token_from_json, address)
            self._addTokenToWindow(token_information)

        layout = QGridLayout()

        self.watch_token_button.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        self.connect(self.watch_token_button, SIGNAL('clicked()'), self.watchNewToken)

        layout.addWidget(self.watch_token_button, 0, 0)
        layout.addLayout(self.tokens_layout, 1, 0)

        self.setLayout(layout) 
開發者ID:PacktPublishing,項目名稱:Hands-On-Blockchain-for-Python-Developers,代碼行數:24,代碼來源:token_widget.py

示例4: createTweetsGroupBox

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def createTweetsGroupBox(self):
        self.tweets_group_box = QtWidgets.QGroupBox("Tweets")
        self.account_address = QtWidgets.QLineEdit()
        self.fetch_button = QtWidgets.QPushButton("Fetch")
        self.add_to_bookmark_button = QtWidgets.QPushButton("Bookmark it!")

        self.connect(self.fetch_button, QtCore.SIGNAL('clicked()'), self.fetchTweets)
        self.connect(self.add_to_bookmark_button, QtCore.SIGNAL('clicked()'), self.bookmarkAddress)

        account_address_layout = QtWidgets.QHBoxLayout()
        account_address_layout.addWidget(self.account_address)
        account_address_layout.addWidget(self.fetch_button)
        account_address_layout.addWidget(self.add_to_bookmark_button)

        self.tweets_layout = QtWidgets.QVBoxLayout()

        self.tweets_main_layout = QtWidgets.QVBoxLayout()
        self.tweets_main_layout.addWidget(QtWidgets.QLabel("Address:"))
        self.tweets_main_layout.addLayout(account_address_layout)
        self.tweets_main_layout.addSpacing(20)
        self.tweets_main_layout.addLayout(self.tweets_layout)
        self.tweets_group_box.setLayout(self.tweets_main_layout) 
開發者ID:PacktPublishing,項目名稱:Hands-On-Blockchain-for-Python-Developers,代碼行數:24,代碼來源:twitter_dapp.py

示例5: setupUi

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 300)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout.addWidget(self.plainTextEdit)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
開發者ID:eoyilmaz,項目名稱:anima,代碼行數:23,代碼來源:multiLineInputDialog_UI_pyside2.py

示例6: _onMediaStatusChanged

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def _onMediaStatusChanged(self, status):
		if status == QtMultimedia.QMediaPlayer.MediaStatus.LoadedMedia:
			QtCore.QObject.disconnect(
				self.content,
				QtCore.SIGNAL("mediaStatusChanged()"),
				self.content._mediaStatusChangedSlot
			)
			QtCore.QObject.disconnect(
				self.content,
				QtCore.SIGNAL("error()"),
				self.content._errorSlot
			)
			
			e = Event(LoaderEvent.COMPLETE)
			e.target = self.content
			self.dispatchEvent(e) 
開發者ID:yuehaowang,項目名稱:pylash_engine,代碼行數:18,代碼來源:loaders.py

示例7: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__(self, qApp):
        QMainWindow.__init__(self)
        self._firstwidget = None
        self._workspace = QWorkspace()
        self.setCentralWidget(self._workspace)
        self.setAcceptDrops(True)
        self.setWindowTitle("Pivy Quarter MDI example")

        filemenu = self.menuBar().addMenu("&File")
        windowmenu = self.menuBar().addMenu("&Windows")

        fileopenaction = QAction("&Open", self)
        fileexitaction = QAction("E&xit", self)
        tileaction = QAction("Tile", self)
        cascadeaction = QAction("Cascade", self)

        filemenu.addAction(fileopenaction)
        filemenu.addAction(fileexitaction)
        windowmenu.addAction(tileaction)
        windowmenu.addAction(cascadeaction)

        self.connect(fileopenaction, QtCore.SIGNAL("triggered()"), self.open)
        self.connect(fileexitaction, QtCore.SIGNAL("triggered()"), QtGui.qApp.closeAllWindows)
        self.connect(tileaction, QtCore.SIGNAL("triggered()"), self._workspace.tile)
        self.connect(cascadeaction, QtCore.SIGNAL("triggered()"), self._workspace.cascade)

        windowmapper = QtCore.QSignalMapper(self)
        self.connect(windowmapper, QtCore.SIGNAL("mapped(QWidget *)"), self._workspace.setActiveWindow)

        self.dirname = os.curdir 
開發者ID:coin3d,項目名稱:pivy,代碼行數:32,代碼來源:mdi.py

示例8: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__(self, parent = None):
        QMainWindow.__init__(self, parent)
        self.setupUi(self)
        self.setupSoQt()
        self.buttonGroup = QButtonGroup(self.groupBox)
        self.buttonGroup.addButton(self.button_x, 0)
        self.buttonGroup.addButton(self.button_y, 1)
        self.buttonGroup.addButton(self.button_z, 2)
        self.connect(self.buttonGroup, SIGNAL("buttonClicked(int)"), self.change_axis)
        self.connect(self.button, SIGNAL("clicked()"), self.change_color)
        self.connect(self.checkbox, SIGNAL("clicked()"), self.rotate) 
開發者ID:coin3d,項目名稱:pivy,代碼行數:13,代碼來源:mainwindow.py

示例9: run

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def run(self):
        self.mutex.lock()
        while not self.isstopped:
            # just wait, and trigger every time we receive a signal
            self.waitcond.wait(self.mutex)
            if not self.isstopped:
                self.emit(SIGNAL("triggerSignal()"))
        self.mutex.unlock() 
開發者ID:coin3d,項目名稱:pivy,代碼行數:10,代碼來源:SignalThread.py

示例10: createWidget

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def createWidget(self, parent):
        widget = quarter.QuarterWidget(parent, self._firstwidget)
        
        if not self._firstwidget:
            self._firstwidget = widget
            self.connect(widget, QtCore.SIGNAL("destroyed(QObject*)"),
                         self, QtCore.SLOT("widgetDestroyed(QObject*)"))        
        
        widget.setSceneGraph(coin.SoCube())
        return widget 
開發者ID:coin3d,項目名稱:pivy,代碼行數:12,代碼來源:PyQuarterWidgetPlugin.py

示例11: _addAccountToWindow

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def _addAccountToWindow(self, account, balance, resize_parent=False):
        wrapper_layout = QVBoxLayout()
        account_layout = QHBoxLayout()
        rows_layout = QVBoxLayout()
        address_layout = QHBoxLayout()
        account_label = QLabel(account)
        account_label.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        copy_button = QPushButton()
        copy_button.setAutoFillBackground(True)
        copy_button.setIcon(QIcon('icons/copy.svg'))
        self.connect(copy_button, SIGNAL('clicked()'), lambda: self.copyAddress(account))
        address_layout.addWidget(account_label)
        address_layout.addWidget(copy_button)
        balance_label = QLabel('Balance: %.5f ethers' % balance)
        balance_label.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        self.balance_widgets[account] = balance_label
        rows_layout.addLayout(address_layout)
        rows_layout.addWidget(balance_label)
        avatar = QLabel()
        img_filename = render_avatar(account)
        pixmap = QPixmap(img_filename)
        avatar.setPixmap(pixmap)
        account_layout.addWidget(avatar)
        account_layout.addLayout(rows_layout)
        wrapper_layout.addLayout(account_layout)
        wrapper_layout.addSpacing(20)
        self.accounts_layout.addLayout(wrapper_layout)

        if resize_parent:
            sizeHint = self.sizeHint()
            self.parentWidget().parentWidget().resize(QSize(sizeHint.width(), sizeHint.height() + 40)) 
開發者ID:PacktPublishing,項目名稱:Hands-On-Blockchain-for-Python-Developers,代碼行數:33,代碼來源:account_widget.py

示例12: createWritingTweetGroupBox

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def createWritingTweetGroupBox(self):
        self.tweet_button = QtWidgets.QPushButton("Write a new tweet")
        self.tweet_button.setMaximumSize(200,40)
        self.write_button_layout = QtWidgets.QHBoxLayout()
        self.write_button_layout.addWidget(self.tweet_button)
        self.connect(self.tweet_button, QtCore.SIGNAL('clicked()'), self.writeANewTweet) 
開發者ID:PacktPublishing,項目名稱:Hands-On-Blockchain-for-Python-Developers,代碼行數:8,代碼來源:twitter_dapp.py

示例13: __init__

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

        self.node = node

        self.show_help = True

        self.layout = QGridLayout()
        self.setLayout(self.layout)

        self.output_area = QTextEdit()
        self.output_area.setReadOnly(True)
        self.output_area.acceptRichText = True
        self.output_area.document().setMaximumBlockCount(5000)
        self.layout.addWidget(self.output_area)

        self.input_area = QLineEdit()
        self.completer = QCompleter()
        # noinspection PyUnresolvedReferences
        self.completer.setCaseSensitivity(Qt.CaseInsensitive)
        self.input_area.setCompleter(self.completer)
        self.input_area.setFocus()
        self.layout.addWidget(self.input_area)

        self.connect(self.input_area, SIGNAL("returnPressed(void)"),
                     self.execute_user_command) 
開發者ID:lightning-power-users,項目名稱:node-launcher,代碼行數:28,代碼來源:console.py

示例14: __init__

# 需要導入模塊: from PySide2 import QtCore [as 別名]
# 或者: from PySide2.QtCore import SIGNAL [as 別名]
def __init__ (self, parent):
        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle("Export depth maps")

        self.btnQuit = QtWidgets.QPushButton("&Close")
        self.btnP1 = QtWidgets.QPushButton("&Export")
        self.pBar = QtWidgets.QProgressBar()
        self.pBar.setTextVisible(False)

        # self.selTxt =QtWidgets.QLabel()
        # self.selTxt.setText("Apply to:")
        self.radioBtn_all = QtWidgets.QRadioButton("Apply to all cameras")
        self.radioBtn_sel = QtWidgets.QRadioButton("Apply to selected")
        self.radioBtn_all.setChecked(True)
        self.radioBtn_sel.setChecked(False)

        self.formTxt = QtWidgets.QLabel()
        self.formTxt.setText("Export format:")
        self.formCmb = QtWidgets.QComboBox()
        self.formCmb.addItem("1-band F32")
        self.formCmb.addItem("Grayscale 8-bit")
        self.formCmb.addItem("Grayscale 16-bit")

        # creating layout
        layout = QtWidgets.QGridLayout()
        layout.setSpacing(10)
        layout.addWidget(self.radioBtn_all, 0, 0)
        layout.addWidget(self.radioBtn_sel, 1, 0)
        layout.addWidget(self.formTxt, 0, 1)
        layout.addWidget(self.formCmb, 1, 1)
        layout.addWidget(self.btnP1, 2, 0)
        layout.addWidget(self.btnQuit, 2, 1)
        layout.addWidget(self.pBar, 3, 0, 1, 2)
        self.setLayout(layout)  

        QtCore.QObject.connect(self.btnP1, QtCore.SIGNAL("clicked()"), self.export_depth)
        QtCore.QObject.connect(self.btnQuit, QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("reject()"))    

        self.exec() 
開發者ID:agisoft-llc,項目名稱:metashape-scripts,代碼行數:41,代碼來源:export_depth_maps_dialog.py

示例15: __init__

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

        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle("Copy bounding box")

        self.labelFrom = QtWidgets.QLabel("From")
        self.labelTo = QtWidgets.QLabel("To")

        self.fromChunk = QtWidgets.QComboBox()
        for chunk in Metashape.app.document.chunks:
            self.fromChunk.addItem(chunk.label)

        self.toChunks = QtWidgets.QListWidget()
        self.toChunks.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        for chunk in Metashape.app.document.chunks:
            self.toChunks.addItem(chunk.label)

        self.btnOk = QtWidgets.QPushButton("Ok")
        self.btnOk.setFixedSize(90, 50)
        self.btnOk.setToolTip("Copy bounding box to all selected chunks")

        self.btnQuit = QtWidgets.QPushButton("Close")
        self.btnQuit.setFixedSize(90, 50)

        layout = QtWidgets.QGridLayout()  # creating layout
        layout.addWidget(self.labelFrom, 0, 0)
        layout.addWidget(self.fromChunk, 0, 1)

        layout.addWidget(self.labelTo, 0, 2)
        layout.addWidget(self.toChunks, 0, 3)

        layout.addWidget(self.btnOk, 1, 1)
        layout.addWidget(self.btnQuit, 1, 3)

        self.setLayout(layout)

        QtCore.QObject.connect(self.btnOk, QtCore.SIGNAL("clicked()"), self.copyBoundingBox)
        QtCore.QObject.connect(self.btnQuit, QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("reject()"))

        self.exec() 
開發者ID:agisoft-llc,項目名稱:metashape-scripts,代碼行數:42,代碼來源:copy_bounding_box_dialog.py


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