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


Python QtGui.QDialogButtonBox方法代码示例

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


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

示例1: initUI

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

示例2: setupUi

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

示例3: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def __init__(self):
        QtGui.QDialog.__init__(self)

        self.protocol_dir = prefs.PROTOCOLDIR

        tabWidget = QtGui.QTabWidget()

        self.bio_tab = self.Biography_Tab()
        tabWidget.addTab(self.bio_tab, "Biography")

        if self.protocol_dir:
            self.task_tab = self.Task_Tab()
            tabWidget.addTab(self.task_tab, "Protocol")

        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)

        mainLayout = QtGui.QVBoxLayout()
        mainLayout.addWidget(tabWidget)
        mainLayout.addWidget(buttonBox)
        self.setLayout(mainLayout)

        self.setWindowTitle("Setup New Subject") 
开发者ID:wehr-lab,项目名称:autopilot,代码行数:26,代码来源:gui.py

示例4: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, onionSkinRendererPreferences):
        onionSkinRendererPreferences.setObjectName("onionSkinRendererPreferences")
        onionSkinRendererPreferences.resize(280, 97)
        self.verticalLayout = QtGui.QVBoxLayout(onionSkinRendererPreferences)
        self.verticalLayout.setObjectName("verticalLayout")
        self.prefs_maxBuffer_layout = QtGui.QHBoxLayout()
        self.prefs_maxBuffer_layout.setObjectName("prefs_maxBuffer_layout")
        self.maxBuffer_label = QtGui.QLabel(onionSkinRendererPreferences)
        self.maxBuffer_label.setObjectName("maxBuffer_label")
        self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_label)
        self.maxBuffer_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences)
        self.maxBuffer_spinBox.setMinimum(1)
        self.maxBuffer_spinBox.setMaximum(10000)
        self.maxBuffer_spinBox.setProperty("value", 200)
        self.maxBuffer_spinBox.setObjectName("maxBuffer_spinBox")
        self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_spinBox)
        self.verticalLayout.addLayout(self.prefs_maxBuffer_layout)
        self.prefs_relativeKeyCount_layout = QtGui.QHBoxLayout()
        self.prefs_relativeKeyCount_layout.setObjectName("prefs_relativeKeyCount_layout")
        self.relativeKeyCount_label = QtGui.QLabel(onionSkinRendererPreferences)
        self.relativeKeyCount_label.setObjectName("relativeKeyCount_label")
        self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_label)
        self.relativeKeyCount_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences)
        self.relativeKeyCount_spinBox.setMinimum(1)
        self.relativeKeyCount_spinBox.setMaximum(10)
        self.relativeKeyCount_spinBox.setProperty("value", 4)
        self.relativeKeyCount_spinBox.setObjectName("relativeKeyCount_spinBox")
        self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_spinBox)
        self.verticalLayout.addLayout(self.prefs_relativeKeyCount_layout)
        self.prefs_dialogButtonBox = QtGui.QDialogButtonBox(onionSkinRendererPreferences)
        self.prefs_dialogButtonBox.setOrientation(QtCore.Qt.Horizontal)
        self.prefs_dialogButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.prefs_dialogButtonBox.setObjectName("prefs_dialogButtonBox")
        self.verticalLayout.addWidget(self.prefs_dialogButtonBox)

        self.retranslateUi(onionSkinRendererPreferences)
        QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("accepted()"), onionSkinRendererPreferences.accept)
        QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("rejected()"), onionSkinRendererPreferences.reject)
        QtCore.QMetaObject.connectSlotsByName(onionSkinRendererPreferences) 
开发者ID:Viele,项目名称:onionSkinRenderer,代码行数:41,代码来源:onionSkinRendererPreferences.py

示例5: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(364, 138)
        Dialog.setModal(True)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setContentsMargins(-1, 10, -1, -1)
        self.formLayout.setObjectName("formLayout")
        self.login_or_email_label = QtGui.QLabel(Dialog)
        self.login_or_email_label.setObjectName("login_or_email_label")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.login_or_email_label)
        self.login_or_email_lineEdit = QtGui.QLineEdit(Dialog)
        self.login_or_email_lineEdit.setInputMask("")
        self.login_or_email_lineEdit.setObjectName("login_or_email_lineEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.login_or_email_lineEdit)
        self.password_label = QtGui.QLabel(Dialog)
        self.password_label.setObjectName("password_label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.password_label)
        self.password_lineEdit = QtGui.QLineEdit(Dialog)
        self.password_lineEdit.setInputMask("")
        self.password_lineEdit.setText("")
        self.password_lineEdit.setEchoMode(QtGui.QLineEdit.Password)
        self.password_lineEdit.setObjectName("password_lineEdit")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.password_lineEdit)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.buttonBox)
        self.verticalLayout.addLayout(self.formLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:37,代码来源:login_dialog_UI_pyside.py

示例6: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(629, 567)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        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,代码行数:17,代码来源:task_picker_dialog_UI_pyside.py

示例7: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(478, 280)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.listView = QtGui.QListView(Dialog)
        self.listView.setObjectName("listView")
        self.horizontalLayout.addWidget(self.listView)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem)
        self.pushButton_2 = QtGui.QPushButton(Dialog)
        self.pushButton_2.setObjectName("pushButton_2")
        self.verticalLayout_2.addWidget(self.pushButton_2)
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setObjectName("pushButton")
        self.verticalLayout_2.addWidget(self.pushButton)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem1)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.listView_2 = QtGui.QListView(Dialog)
        self.listView_2.setObjectName("listView_2")
        self.horizontalLayout.addWidget(self.listView_2)
        self.verticalLayout.addLayout(self.horizontalLayout)
        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,代码行数:39,代码来源:choose_from_list_dialog_UI_pyside.py

示例8: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName('Dialog')
        Dialog.setWindowIcon(get_clamav_icon())
        Dialog.setWindowTitle('Submit Your ClamAV Signature')
        Dialog.resize(430, 300)

        #   Email Body Area
        self.link = QtWidgets.QLabel('')
        self.link.setTextFormat(Qt.RichText)
        self.link.setTextInteractionFlags(Qt.TextBrowserInteraction)
        self.link.setOpenExternalLinks(True)
        self.email_body = QtWidgets.QPlainTextEdit()
        self.email_body.setReadOnly(True)

        #   Ok Button Area
        self.button_box = QtWidgets.QDialogButtonBox()
        self.button_box.setOrientation(Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
        self.button_box.setObjectName('button_box')
        self.hbox_bottom = QtWidgets.QHBoxLayout()
        self.hbox_bottom.addWidget(self.button_box)

        #   Vertical Layout
        self.vbox_outer = QtWidgets.QVBoxLayout(Dialog)
        self.vbox_outer.setObjectName('vbox_outer')
        self.vbox_outer.addWidget(self.link)
        self.vbox_outer.addWidget(self.email_body)
        self.vbox_outer.addLayout(self.hbox_bottom)

        #   Signal Handling
        self.button_box.accepted.connect(Dialog.accept)


#   Class to interface with Dialog GUIs and the back end data
#------------------------------------------------------------------------------- 
开发者ID:Cisco-Talos,项目名称:CASC,代码行数:37,代码来源:casc_plugin.py

示例9: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 164)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(30, 110, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.comboBox = QtGui.QComboBox(Dialog)
        self.comboBox.setGeometry(QtCore.QRect(180, 40, 191, 22))
        self.comboBox.setMaxVisibleItems(25)
        self.comboBox.setObjectName("comboBox")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(180, 20, 53, 16))
        self.label.setObjectName("label")
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(20, 20, 53, 16))
        self.label_2.setObjectName("label_2")
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setEnabled(False)
        self.plainTextEdit.setGeometry(QtCore.QRect(20, 40, 31, 31))
        self.plainTextEdit.setBackgroundVisible(False)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.plainTextEdit_2 = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit_2.setEnabled(False)
        self.plainTextEdit_2.setGeometry(QtCore.QRect(120, 40, 31, 31))
        self.plainTextEdit_2.setBackgroundVisible(False)
        self.plainTextEdit_2.setObjectName("plainTextEdit_2")
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(120, 20, 41, 16))
        self.label_3.setObjectName("label_3")
        self.label_4 = QtGui.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(20, 80, 351, 16))
        self.label_4.setObjectName("label_4")
        QtCore.QObject.connect(self.comboBox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.SIGNAL_comboBox_Changed)

        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:easyw,项目名称:kicad-3d-models-in-freecad,代码行数:42,代码来源:exportPartToVRML.py

示例10: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def __init__(self, title, options_config, icon_path=None, 
        action_button_text=None, modal=False):

        super(SessionActionDialog, self).__init__()

        self.setModal(modal)
        self.setWindowTitle(title)

        icon_lbl = QtGui.QLabel()
        icon_lbl.setPixmap(QtGui.QPixmap(icon_path))
        icon_lbl.setAlignment(QtCore.Qt.AlignRight)

        title = QtGui.QLabel(title)
        title.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        font = title.font()
        font.setPointSize(18)
        title.setFont(font)

        header_layout = QtGui.QHBoxLayout()
        header_layout.addWidget(icon_lbl)
        header_layout.addWidget(title)
        header_layout.setStretchFactor(title, 90)

        self._options = ActionOptionWidget(options_config)

        self._btn_box = QtGui.QDialogButtonBox()
        self._btn_box.addButton(QtGui.QDialogButtonBox.Cancel)
        self._action_btn = self._btn_box.addButton(QtGui.QDialogButtonBox.Ok)

        if action_button_text:
            self._action_btn.setText(action_button_text)

        layout = QtGui.QVBoxLayout(self)
        layout.addLayout(header_layout)
        layout.addWidget(self._options)
        layout.addWidget(self._btn_box)

        self._options.value_changed.connect(self.check_value)

        self._btn_box.accepted.connect(self.accept)
        self._btn_box.rejected.connect(self.reject)

        self.check_value()

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

示例11: initUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def initUI(self):
        fontSize = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetInt("fontSize")
        keybinding = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetString("executeKeybinding")
        executeOnSave = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("executeOnSave")
        showLineNumbers = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("showLineNumbers")
        allowReload = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("allowReload")

        font_size = QtGui.QLabel('Font Size')
        self.ui_font_size = QtGui.QSpinBox()
        self.ui_font_size.setValue(fontSize)

        key_binding = QtGui.QLabel('Execute Key-binding')
        self.ui_key_binding = QtGui.QLineEdit()
        self.ui_key_binding.setText(keybinding)

        execute_on_save = QtGui.QLabel('Execute on Save')
        self.execute_on_save = QtGui.QCheckBox()
        self.execute_on_save.setChecked(executeOnSave)

        show_line_numbers = QtGui.QLabel('Show Line Numbers')
        self.show_line_numbers = QtGui.QCheckBox()
        self.show_line_numbers.setChecked(showLineNumbers)

        allow_reload = QtGui.QLabel('Allow Reload')
        self.allow_reload = QtGui.QCheckBox()
        self.allow_reload.setChecked(allowReload)

        self.buttons = QtGui.QDialogButtonBox();
        self.buttons.setOrientation(QtCore.Qt.Horizontal)
        self.buttons.setStandardButtons(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)
        self.buttons.layout().setDirection(QtGui.QBoxLayout.LeftToRight)
        self.buttons.accepted.connect(self.acceptSettings)
        self.buttons.rejected.connect(self.reject)

        grid = QtGui.QGridLayout()
        grid.setContentsMargins(10, 10, 10, 10)
        grid.addWidget(font_size, 0, 0)
        grid.addWidget(self.ui_font_size, 0, 1)
        grid.addWidget(key_binding, 1, 0)
        grid.addWidget(self.ui_key_binding, 1, 1)
        grid.addWidget(execute_on_save, 2, 0)
        grid.addWidget(self.execute_on_save, 2, 1)
        grid.addWidget(show_line_numbers, 3, 0)
        grid.addWidget(self.show_line_numbers, 3, 1)
        grid.addWidget(allow_reload, 4, 0)
        grid.addWidget(self.allow_reload, 4, 1)
        grid.addWidget(self.buttons, 5, 1)

        self.setLayout(grid) 
开发者ID:jmwright,项目名称:cadquery-freecad-module,代码行数:51,代码来源:SettingsDialog.py

示例12: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(754, 662)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.dialog_label = QtGui.QLabel(Dialog)
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);\n"
"font: 18pt;")
        self.dialog_label.setObjectName("dialog_label")
        self.verticalLayout.addWidget(self.dialog_label)
        self.line = QtGui.QFrame(Dialog)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName("line")
        self.verticalLayout.addWidget(self.line)
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.formLayout.setObjectName("formLayout")
        self.name_label = QtGui.QLabel(Dialog)
        self.name_label.setObjectName("name_label")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.name_label)
        self.name_fields_verticalLayout = QtGui.QVBoxLayout()
        self.name_fields_verticalLayout.setObjectName("name_fields_verticalLayout")
        self.name_validator_label = QtGui.QLabel(Dialog)
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_validator_label.setObjectName("name_validator_label")
        self.name_fields_verticalLayout.addWidget(self.name_validator_label)
        self.formLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.name_fields_verticalLayout)
        self.filenmate_templates_label = QtGui.QLabel(Dialog)
        self.filenmate_templates_label.setObjectName("filenmate_templates_label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.filenmate_templates_label)
        self.filename_template_fields_verticalLayout = QtGui.QVBoxLayout()
        self.filename_template_fields_verticalLayout.setObjectName("filename_template_fields_verticalLayout")
        self.formLayout.setLayout(1, QtGui.QFormLayout.FieldRole, self.filename_template_fields_verticalLayout)
        self.custom_template_label = QtGui.QLabel(Dialog)
        self.custom_template_label.setObjectName("custom_template_label")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.custom_template_label)
        self.custom_template_plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.custom_template_plainTextEdit.setObjectName("custom_template_plainTextEdit")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.custom_template_plainTextEdit)
        self.verticalLayout.addLayout(self.formLayout)
        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.verticalLayout.setStretch(2, 1)

        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,代码行数:54,代码来源:structure_dialog_UI_pyside.py

示例13: init_ui

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialogButtonBox [as 别名]
def init_ui(self):
        self.layout = QtGui.QVBoxLayout()

        # Container Widget
        self.container = QtGui.QWidget()
        # Layout of Container Widget
        self.container_layout = QtGui.QVBoxLayout(self)

        self.container.setLayout(self.container_layout)


        screen_geom = QtGui.QDesktopWidget().availableGeometry()
        # get max pixel value for each subwidget
        widget_height = np.floor(screen_geom.height()-50/float(len(self.pilots)))


        for p in self.pilots:
            self.pilot_widgets[p] = Pilot_Ports(p)
            self.pilot_widgets[p].setMaximumHeight(widget_height)
            self.pilot_widgets[p].setMaximumWidth(screen_geom.width())
            self.pilot_widgets[p].setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)
            self.container_layout.addWidget(self.pilot_widgets[p])

        # Scroll Area Properties
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(False)
        self.scroll.setWidget(self.container)
        self.layout.addWidget(self.scroll)

        # ok/cancel buttons
        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)
        self.layout.addWidget(buttonBox)



        self.setLayout(self.layout)

        # prevent from expanding
        # set max size to screen size

        self.setMaximumHeight(screen_geom.height())
        self.setMaximumWidth(screen_geom.width())
        self.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)

        self.scrollArea = QtGui.QScrollArea(self)
        self.scrollArea.setWidgetResizable(True) 
开发者ID:wehr-lab,项目名称:autopilot,代码行数:50,代码来源:gui.py


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