当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.SIGNAL属性代码示例

本文整理汇总了Python中PySide.QtCore.SIGNAL属性的典型用法代码示例。如果您正苦于以下问题:Python QtCore.SIGNAL属性的具体用法?Python QtCore.SIGNAL怎么用?Python QtCore.SIGNAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在PySide.QtCore的用法示例。


在下文中一共展示了QtCore.SIGNAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def __init__(self):
        super(a2p_ConstraintPanel,self).__init__()
        self.resize(200,250)
        cc = a2p_ConstraintCollection(None)
        self.setWidget(cc)
        self.setWindowTitle("Constraint Tools")
        #
        mw = FreeCADGui.getMainWindow()
        mw.addDockWidget(QtCore.Qt.RightDockWidgetArea,self)
        #
        self.setFloating(True)
        self.activateWindow()
        self.setAllowedAreas(QtCore.Qt.NoDockWidgetArea)
        self.move(getMoveDistToStoredPosition(self))

        a2plib.setConstraintDialogRef(self)
        #
        self.timer = QtCore.QTimer()
        QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.onTimer)
        self.timer.start(100) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:22,代码来源:a2p_constraintDialog.py

示例2: Activated

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def Activated(self):
        self.selectedConstraint = a2plib.getSelectedConstraint()
        if self.selectedConstraint is None:
            QtGui.QMessageBox.information(
                QtGui.QApplication.activeWindow(),
                "Selection Error !",
                "Please select exact one constraint first."
                )
            return

        self.constraintValueBox = a2p_ConstraintValuePanel(
            self.selectedConstraint,
            'editConstraint'
            )
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Deleted()"), self.onDeleteConstraint)
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Accepted()"), self.onAcceptConstraint)
        a2plib.setConstraintEditorRef(self.constraintValueBox) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:19,代码来源:a2p_constraintDialog.py

示例3: initUI

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def initUI(self):
        self.resize(400,100)
        self.setWindowTitle('select a shape to be imported')
        self.mainLayout = QtGui.QGridLayout() # a VBoxLayout for the whole form

        self.shapeCombo = QtGui.QComboBox(self)
        
        l = sorted(self.labelList)
        self.shapeCombo.addItems(l)

        self.buttons = QtGui.QDialogButtonBox(self)
        self.buttons.setOrientation(QtCore.Qt.Horizontal)
        self.buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        self.buttons.addButton("Choose", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(self.buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(self.buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))

        self.mainLayout.addWidget(self.shapeCombo,0,0,1,1)
        self.mainLayout.addWidget(self.buttons,1,0,1,1)
        self.setLayout(self.mainLayout) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:22,代码来源:a2p_importpart.py

示例4: run

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def run(self):
        if self.incoming_file:
            try:
                file_path, file_type = self.incoming_file
                if file_type in ["APK", "DEX", "DEY"]:
                    ret = self.session.add(file_path,
                                           open(file_path, 'r').read())
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), ret)
                elif file_type == "SESSION" :
                    self.session.load(file_path)
                    self.emit(QtCore.SIGNAL("loadedFile(bool)"), True)
            except Exception as e:
                androconf.debug(e)
                androconf.debug(traceback.format_exc())
                self.emit(QtCore.SIGNAL("loadedFile(bool)"), False)

            self.incoming_file = []
        else:
            self.emit(QtCore.SIGNAL("loadedFile(bool)"), False) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:21,代码来源:fileloading.py

示例5: download_button_clicked

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def download_button_clicked(self):

        directory = QtGui.QFileDialog().getExistingDirectory()
        if not directory or len(directory) == 0 or not os.path.exists(directory):
            return
        self.download_button.setVisible(False)
        self.download_progress.setVisible(True)
        filename = os.path.basename(self.link())
        self.full_filename = os.path.join(directory, filename)

        url = QtCore.QUrl(self.link())
        request = QtNetwork.QNetworkRequest(url)
        self.current_download = self.manager.get(request)
        self.current_download.setReadBufferSize(1048576)
        self.connect(self.current_download, QtCore.SIGNAL("downloadProgress(qint64, qint64)"),
                     self.download_hook)
        self.current_download.downloadProgress.connect(self.download_hook)
        self.current_download.finished.connect(self.download_finished)
        self.current_download.readyRead.connect(self.download_ready_read)
        self.current_f = open(self.full_filename, 'wb')
        self.parent.exiting.connect(self.closing) 
开发者ID:glamrock,项目名称:Satori,代码行数:23,代码来源:utils.py

示例6: Establish_Connections

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.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

示例7: setupUi

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtGui.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout.addWidget(self.plainTextEdit)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.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_pyside.py

示例8: setRowCount

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setRowCount(self, count):
        """
        Sets the row count by removing lines / adding empty lines.
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param count: The desired amount of rows
        """

        # If additional rows are needed
        if count > len(self.dataList):
            while len(self.dataList) < count:
                self.dataList.append([])
                # Fill the columns with empty data
                for colIndex in range(self.columnCount()):
                    self.dataList[-1].append("")
        # Rows have to be removed
        elif count < len(self.dataList):
            while len(self.dataList) > count:
                self.dataList.pop()

        self.emit(QtCore.SIGNAL("layoutChanged()")) 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:23,代码来源:PacketTableModel.py

示例9: setData

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setData(self, index, value, role=Qt.EditRole):
        """
        This gets called to change the element on the GUI at the given indexes
        This also emits the ``layoutChanged`` signal to let the GUI know that the layout has been changed.

        :param index: Index object containing row and column index
        :param value: The new value
        :param role: Optional: The role calling this method. Default: EditRole
        :return: True if the operation succeeded
        """

        rowIndex = index.row()
        colIndex = index.column()
        value = re.sub("[^A-Fa-f0-9]+", "", str(value)).upper()
        self.dataList[rowIndex][colIndex] = value

        self.cellChanged.emit(rowIndex, colIndex)
        self.dataChanged.emit(rowIndex, colIndex)
        self.emit(QtCore.SIGNAL("layoutChanged()"))
        return True 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:22,代码来源:PacketTableModel.py

示例10: __init__

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def __init__(self, parent, model=None):
        self.parent = parent
        super(VariablesBrowser, self).__init__(parent)
        ''' Set up the columns '''
        self.setHeaderLabels(('Name', 'Value', 'Unit'))
        self.setColumnWidth(0, 200)
        self.setColumnWidth(1, 70)
        self.setColumnWidth(2, 50)
        self.setIndentation(10)

        self.currentModelItem = None
        self.itemChanged.connect(self.browserItemCheckChanged)

        # Enable Context Menu (by click of right mouse button)
        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.connect(self, QtCore.SIGNAL("customContextMenuRequested(const QPoint &)"), self._menuContextTree)

        ''' If a model is given with the constructor, load it
        '''
        if model is not None:
            self.addModel(model) 
开发者ID:PySimulator,项目名称:PySimulator,代码行数:23,代码来源:VariablesBrowser.py

示例11: setupSortMenu

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setupSortMenu(menu,func,func2):
    action = QtGui.QAction(QtGui.QIcon(),"Sort element A~Z",menu)
    QtCore.QObject.connect(action,QtCore.SIGNAL("triggered()"),func)
    menu.addAction(action)
    action = QtGui.QAction(QtGui.QIcon(),"Sort element Z~A",menu)
    QtCore.QObject.connect(
            action,QtCore.SIGNAL("triggered()"),func2)
    menu.addAction(action) 
开发者ID:realthunder,项目名称:FreeCAD_assembly3,代码行数:10,代码来源:assembly.py

示例12: setupContextMenu

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setupContextMenu(self,vobj,menu):
        obj = vobj.Object
        action = QtGui.QAction(QtGui.QIcon(),
                "Enable constraint" if obj.Disabled else "Disable constraint", menu)
        QtCore.QObject.connect(
                action,QtCore.SIGNAL("triggered()"),self.toggleDisable)
        menu.addAction(action) 
开发者ID:realthunder,项目名称:FreeCAD_assembly3,代码行数:9,代码来源:assembly.py

示例13: setupUi

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setupUi(self, Zebra):
        Zebra.setObjectName(_fromUtf8("Zebra"))
        Zebra.resize(241, 302)
        self.verticalLayoutWidget = QtGui.QWidget(Zebra)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.verticalLayoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
        self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
        self.verticalLayout.addWidget(self.horizontalSlider)
        self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
        self.verticalLayout.addWidget(self.horizontalSlider_2)
        self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
        self.verticalLayout.addWidget(self.horizontalSlider_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)

        self.retranslateUi(Zebra)
#        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
#        QtCore.QMetaObject.connectSlotsByName(Zebra) 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:40,代码来源:Zebra_Gui.py

示例14: manageConstraint

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def manageConstraint(self):
        self.constraintValueBox = a2p_ConstraintValuePanel(
            #self,
            self.activeConstraint.constraintObject,
            'createConstraint'
            )
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Deleted()"), self.onDeleteConstraint)
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Accepted()"), self.onAcceptConstraint)
        a2plib.setConstraintEditorRef(self) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:11,代码来源:a2p_constraintDialog.py

示例15: setupSession

# 需要导入模块: from PySide import QtCore [as 别名]
# 或者: from PySide.QtCore import SIGNAL [as 别名]
def setupSession(self):
        self.session = Session()

        self.fileLoadingThread = FileLoadingThread(self.session)
        self.connect(self.fileLoadingThread,
                QtCore.SIGNAL("loadedFile(bool)"),
                self.loadedFile) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:9,代码来源:mainwindow.py


注:本文中的PySide.QtCore.SIGNAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。