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


Python QtGui.QPushButton方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self, text, icon_path=None, parent=None):

        super(ActionOptionGroupHeader, self).__init__(
            text, icon_path=icon_path, parent=parent)

        font = self._label.font()
        font.setBold(True)
        self._label.setFont(font)

        self._btn = QtGui.QPushButton('+')
        self._btn.setFixedSize(QtCore.QSize(self._size, self._size))
        self._btn.setFocusPolicy(QtCore.Qt.NoFocus)
        self._btn.setCheckable(True)

        self._layout.insertWidget(0, self._btn)
        self._btn.toggled.connect(self._toggle)

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:20,代码来源:options.py

示例2: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def setupUi(self):
        #self.groupBox = QtGui.QGroupBox(self.dockWidgetContents)
        self.setObjectName(_fromUtf8(self.link))
        self.horizontalLayout = QtGui.QHBoxLayout(self)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.pushButton = QtGui.QPushButton(self)
        self.pushButton.setObjectName(_fromUtf8("View"))
        self.horizontalLayout.addWidget(self.pushButton)
        self.pushButton_2 = QtGui.QPushButton(self)
        self.pushButton_2.setObjectName(_fromUtf8("Set"))
        self.horizontalLayout.addWidget(self.pushButton_2)
        self.pushButton.clicked.connect(self.view_link)
        self.pushButton.pressed.connect(self.set_selection)
        self.pushButton.released.connect(self.reset_selection)
        self.pushButton_2.clicked.connect(self.set_link)
        self.setTitle(self.link)
        self.pushButton.setText("View")
        self.pushButton_2.setText("Set") 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:20,代码来源:sublink_edit.py

示例3: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)
    
        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:27,代码来源:renamewindow.py

示例4: setLang

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:27,代码来源:UITranslator.py

示例5: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(241, 367)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
        self.itemTree = QtGui.QTreeWidget(Form)
        self.itemTree.setObjectName("itemTree")
        self.itemTree.headerItem().setText(0, "1")
        self.itemTree.header().setVisible(False)
        self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
        self.formatList = QtGui.QListWidget(Form)
        self.formatList.setObjectName("formatList")
        self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
        self.exportBtn = QtGui.QPushButton(Form)
        self.exportBtn.setObjectName("exportBtn")
        self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
        self.closeBtn = QtGui.QPushButton(Form)
        self.closeBtn.setObjectName("closeBtn")
        self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
        self.paramTree = ParameterTree(Form)
        self.paramTree.setObjectName("paramTree")
        self.paramTree.headerItem().setText(0, "1")
        self.paramTree.header().setVisible(False)
        self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
        self.copyBtn = QtGui.QPushButton(Form)
        self.copyBtn.setObjectName("copyBtn")
        self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:42,代码来源:exportDialogTemplate_pyside.py

示例6: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(224, 117)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(1)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.translateLabel = QtGui.QLabel(Form)
        self.translateLabel.setObjectName("translateLabel")
        self.verticalLayout.addWidget(self.translateLabel)
        self.rotateLabel = QtGui.QLabel(Form)
        self.rotateLabel.setObjectName("rotateLabel")
        self.verticalLayout.addWidget(self.rotateLabel)
        self.scaleLabel = QtGui.QLabel(Form)
        self.scaleLabel.setObjectName("scaleLabel")
        self.verticalLayout.addWidget(self.scaleLabel)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.mirrorImageBtn = QtGui.QPushButton(Form)
        self.mirrorImageBtn.setToolTip("")
        self.mirrorImageBtn.setObjectName("mirrorImageBtn")
        self.horizontalLayout.addWidget(self.mirrorImageBtn)
        self.reflectImageBtn = QtGui.QPushButton(Form)
        self.reflectImageBtn.setObjectName("reflectImageBtn")
        self.horizontalLayout.addWidget(self.reflectImageBtn)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:36,代码来源:TransformGuiTemplate_pyside.py

示例7: OnCreate

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def OnCreate(self, form):
        self.parent = self.FormToPySideWidget(form)
        self.tableWidget = QtGui.QTableWidget()
        self.seg_combo = QtGui.QComboBox()
        self.refcount_box = QtGui.QLineEdit()
        self.export_btn = QtGui.QPushButton("Export")
        self.export_btn.setDisabled(True)
        self.scan_btn = QtGui.QPushButton("Scan")
        self.minfilter_box = QtGui.QLineEdit()
        self.maxfilter_box = QtGui.QLineEdit()
        self.filter_btn = QtGui.QPushButton("Filter")
        self.filter_btn.setDisabled(True)
        self.sort_order = [QtCore.Qt.AscendingOrder, QtCore.Qt.AscendingOrder]
        self.PopulateForm() 
开发者ID:onethawt,项目名称:idapyscripts,代码行数:16,代码来源:dataxrefcounter.py

示例8: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self, parent=None):

        super(HoudiniDarkKnightDialog, self).__init__(parent=parent)

        # ---- controls

        controls_widget = self._setup_controls()

        scroll_area = QtGui.QScrollArea()
        scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
        scroll_area.setWidgetResizable(True)
        scroll_area.setWidget(controls_widget)

        self.main_layout.addWidget(scroll_area)
        self.main_layout.setStretchFactor(scroll_area, 1000)

        # ---- submit btn

        cancel_btn = QtGui.QPushButton("Cancel")
        cancel_btn.clicked.connect(self.close)

        submit_btn = QtGui.QPushButton("Submit")
        submit_btn.clicked.connect(self.accept)

        btn_layout = QtGui.QHBoxLayout()
        btn_layout.setContentsMargins(4, 4, 4, 4)
        btn_layout.addStretch()
        btn_layout.addWidget(cancel_btn)
        btn_layout.addWidget(submit_btn)
        btn_layout.addStretch()

        self.main_layout.addLayout(btn_layout)
        self.main_layout.setStretchFactor(btn_layout, 0)

        self._version_note_edit.setFocus()

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:39,代码来源:houdini.py

示例9: setupUi

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

示例10: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self,winTitle='Rotate WP', icon='rotWP.svg'):
    super(rotWPForm,self).__init__()
    self.move(QPoint(100,250))
    self.setWindowFlags(Qt.WindowStaysOnTopHint)
    self.setWindowTitle(winTitle)
    iconPath=join(dirname(abspath(__file__)),"icons",icon)
    from PySide.QtGui import QIcon
    Icon=QIcon()
    Icon.addFile(iconPath)
    self.setWindowIcon(Icon) 
    self.grid=QGridLayout()
    self.setLayout(self.grid)
    self.radioX=QRadioButton('X')
    self.radioX.setChecked(True)
    self.radioY=QRadioButton('Y')
    self.radioZ=QRadioButton('Z')
    self.lab1=QLabel('Angle:')
    self.edit1=QLineEdit('45')
    self.edit1.setAlignment(Qt.AlignCenter)
    self.edit1.setValidator(QDoubleValidator())
    self.btn1=QPushButton('Rotate working plane')
    self.btn1.clicked.connect(self.rotate)
    self.grid.addWidget(self.radioX,0,0,1,1,Qt.AlignCenter)
    self.grid.addWidget(self.radioY,0,1,1,1,Qt.AlignCenter)
    self.grid.addWidget(self.radioZ,0,2,1,1,Qt.AlignCenter)
    self.grid.addWidget(self.lab1,1,0,1,1)
    self.grid.addWidget(self.edit1,1,1,1,2)
    self.grid.addWidget(self.btn1,2,0,1,3,Qt.AlignCenter)
    self.show()
    self.sg=FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
    s=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetInt("gridSize")
    sc=[float(x*s) for x in [1,1,.2]]
    from polarUtilsCmd import arrow
    self.arrow =arrow(FreeCAD.DraftWorkingPlane.getPlacement(),scale=sc,offset=s) 
开发者ID:oddtopus,项目名称:flamingo,代码行数:36,代码来源:qForms.py

示例11: get_QPushButton

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def get_QPushButton():
    """QPushButton getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QPushButton
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QPushButton 
开发者ID:AirbusCyber,项目名称:grap,代码行数:11,代码来源:QtShim.py

示例12: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self, parent=None, win=None, current_class=None, class_analysis=None):
        super(XrefDialogClass, self).__init__(parent)
        self.current_class = current_class
        self.class_analysis = class_analysis

        title = "Xrefs for the class %s" % current_class

        self.setWindowTitle(title)

        xrefs_list = []

        ref_kind_map = {0:"Class instanciation", 1:"Class reference"}

        xrefs_from = class_analysis.get_xref_from()
        for ref_class in xrefs_from:
            for ref_kind, ref_method in xrefs_from[ref_class]:
                xrefs_list.append(('From', ref_kind_map[ref_kind], ref_method, ref_class.get_vm_class()))

        xrefs_to = class_analysis.get_xref_to()
        for ref_class in xrefs_to:
            for ref_kind, ref_method in xrefs_to[ref_class]:
                xrefs_list.append(('To', ref_kind_map[ref_kind], ref_method, ref_class.get_vm_class()))

        closeButton = QtGui.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtGui.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list, headers=["Origin", "Kind", "Method"])
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtGui.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtGui.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:41,代码来源:xrefwindow.py

示例13: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def __init__(self, *args, **kwargs):
            QtGui.QPushButton.__init__(self)
            Custom.__init__(self, *args, **kwargs)
            self.clicked.connect(self.click) 
开发者ID:mwisslead,项目名称:vfp2py,代码行数:6,代码来源:vfpfunc.py

示例14: height

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def height(self):
            return QtGui.QPushButton.height(self) 
开发者ID:mwisslead,项目名称:vfp2py,代码行数:4,代码来源:vfpfunc.py

示例15: width

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPushButton [as 别名]
def width(self):
            return QtGui.QPushButton.width(self) 
开发者ID:mwisslead,项目名称:vfp2py,代码行数:4,代码来源:vfpfunc.py


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