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


Python QDialogButtonBox.Close方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, parent=None, flags=Qt.Dialog | Qt.WindowCloseButtonHint):
        super(ConsoleWidget, self).__init__(parent, flags)
        self.parent = parent
        self.edit = VideoConsole(self)
        buttons = QDialogButtonBox()
        buttons.setCenterButtons(True)
        clearButton = buttons.addButton('Clear', QDialogButtonBox.ResetRole)
        clearButton.clicked.connect(self.edit.clear)
        closeButton = buttons.addButton(QDialogButtonBox.Close)
        closeButton.clicked.connect(self.close)
        closeButton.setDefault(True)
        layout = QVBoxLayout()
        layout.addWidget(self.edit)
        layout.addWidget(buttons)
        self.setLayout(layout)
        self.setWindowTitle('{0} Console'.format(qApp.applicationName()))
        self.setWindowModality(Qt.NonModal) 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:19,代码来源:videoconsole.py

示例2: setupUi

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def setupUi(self):
        ui_cmd_console_dlg.Ui_CmdConsoleDlg.setupUi(self, self)
        self.setWindowTitle("Command console")
        self.restore_cache_settings()
        btn = self.buttonBox.button(QDialogButtonBox.Close)
        btn.setAutoDefault(False)
        self.edtCommand.setFocus()
        self.edtCommand.installEventFilter(self) 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:10,代码来源:cmd_console_dlg.py

示例3: _buttonsWidget

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def _buttonsWidget(self):
        buttons = QDialogButtonBox()
        buttons.addButton(QDialogButtonBox.Close)
        # Like above, this will be served as a separate detailed report dialog if the application has not yet been
        # fully loaded. In this case, "send report" will be a check box in the early crash dialog, so there is no
        # need for this extra button.
        if self.has_started:
            buttons.addButton(catalog.i18nc("@action:button", "Send report"), QDialogButtonBox.AcceptRole)
            buttons.accepted.connect(self._sendCrashReport)
        buttons.rejected.connect(self.dialog.close)

        return buttons 
开发者ID:Ultimaker,项目名称:Cura,代码行数:14,代码来源:CrashHandler.py

示例4: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, parent=None):
        super(Changelog, self).__init__(parent, Qt.Dialog | Qt.WindowCloseButtonHint)
        self.parent = parent
        self.setWindowTitle('{} changelog'.format(qApp.applicationName()))
        changelog = QFile(':/CHANGELOG')
        changelog.open(QFile.ReadOnly | QFile.Text)
        content = QTextStream(changelog).readAll()
        label = QLabel(content, self)
        label.setWordWrap(True)
        label.setTextFormat(Qt.PlainText)
        buttons = QDialogButtonBox(QDialogButtonBox.Close, self)
        buttons.rejected.connect(self.close)
        scrollarea = QScrollArea(self)
        scrollarea.setStyleSheet('QScrollArea { background:transparent; }')
        scrollarea.setWidgetResizable(True)
        scrollarea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        scrollarea.setFrameShape(QScrollArea.NoFrame)
        scrollarea.setWidget(label)
        if sys.platform in {'win32', 'darwin'}:
            scrollarea.setStyle(QStyleFactory.create('Fusion'))
        # noinspection PyUnresolvedReferences
        if parent.parent.stylename == 'fusion' or sys.platform in {'win32', 'darwin'}:
            self.setStyleSheet('''
            QScrollArea {{
                background-color: transparent;
                margin-bottom: 10px;
                border: none;
                border-right: 1px solid {};
            }}'''.format('#4D5355' if parent.theme == 'dark' else '#C0C2C3'))
        else:
            self.setStyleSheet('''
            QScrollArea {{
                background-color: transparent;
                margin-bottom: 10px;
                border: none;
            }}''')
        layout = QVBoxLayout()
        layout.addWidget(scrollarea)
        layout.addWidget(buttons)
        self.setLayout(layout)
        self.setMinimumSize(self.sizeHint()) 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:43,代码来源:changelog.py

示例5: initUI

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def initUI(self):
        self.setWindowTitle("查看回收站文件夹内容")
        self.form = QVBoxLayout()
        for item in iter(self.files):
            ico = QPushButton(set_file_icon(item.name), item.name)
            ico.setStyleSheet("QPushButton {border:none; background:transparent; color:black;}")
            ico.adjustSize()
            it = QLabel(f"<font color='#CCCCCC'>({item.size})</font>")
            hbox = QHBoxLayout()
            hbox.addWidget(ico)
            hbox.addStretch(1)
            hbox.addWidget(it)
            self.form.addLayout(hbox)

        self.form.setSpacing(10)
        self.buttonBox = QDialogButtonBox()
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Close)
        self.buttonBox.button(QDialogButtonBox.Close).setText("关闭")
        self.buttonBox.setStyleSheet(btn_style)
        self.buttonBox.rejected.connect(self.reject)

        vbox = QVBoxLayout()
        vbox.addLayout(self.form)
        vbox.addStretch(1)
        vbox.addWidget(self.buttonBox)
        self.setLayout(vbox) 
开发者ID:rachpt,项目名称:lanzou-gui,代码行数:29,代码来源:rec_folder.py

示例6: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, device, *args, **kwargs):
        super(GPIODialog, self).__init__(*args, **kwargs)
        self.setWindowTitle("GPIO [{}]".format(device.p['FriendlyName1']))
        self.setMinimumWidth(300)
        self.device = device

        self.gb = {}

        btns = QDialogButtonBox(QDialogButtonBox.Close)
        btns.rejected.connect(self.reject)

        gbxGPIO = QGroupBox("Select GPIO")
        fl = QFormLayout()
        if self.device.gpio:
            btns.addButton(QDialogButtonBox.Save)
            btns.accepted.connect(self.accept)

            for gp_name, gp_id in self.device.gpio.items():
                gb = DictComboBox(self.device.gpios)
                gb.setCurrentText(self.device.gpios[gp_id])
                self.gb[gp_name] = gb
                fl.addRow(gp_name, gb)
        else:
            fl.addWidget(QLabel("No configurable GPIOs"))
        gbxGPIO.setLayout(fl)

        vl = VLayout()
        vl.addWidgets([gbxGPIO, btns])
        self.setLayout(vl) 
开发者ID:jziolkowski,项目名称:tdm,代码行数:31,代码来源:GPIO.py

示例7: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, env, *args, **kwargs):
        super(ClearLWTDialog, self).__init__(*args, **kwargs)
        self.setWindowTitle("Clear obsolete retained LWTs")
        self.setMinimumSize(QSize(320, 480))

        self.env = env

        vl = VLayout()

        sel_btns = QDialogButtonBox()
        sel_btns.setCenterButtons(True)
        btnSelAll = sel_btns.addButton("Select all", QDialogButtonBox.ActionRole)
        btnSelNone = sel_btns.addButton("Select none", QDialogButtonBox.ActionRole)

        self.lw = QListWidget()

        for lwt in self.env.lwts:
            itm = QListWidgetItem(lwt)
            itm.setCheckState(Qt.Unchecked)
            self.lw.addItem(itm)

        btnSelAll.clicked.connect(lambda: self.select(Qt.Checked))
        btnSelNone.clicked.connect(lambda: self.select(Qt.Unchecked))

        btns = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close)
        btns.accepted.connect(self.accept)
        btns.rejected.connect(self.reject)

        vl.addWidgets([sel_btns, self.lw, btns])
        self.setLayout(vl) 
开发者ID:jziolkowski,项目名称:tdm,代码行数:32,代码来源:ClearLWT.py

示例8: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, device, *args, **kwargs):
        super(ButtonsDialog, self).__init__(*args, **kwargs)
        self.setWindowTitle("Buttons settings [{}]".format(device.p['FriendlyName1']))
        self.setMinimumWidth(300)
        self.device = device

        self.commands_list = ["ButtonDebounce", "ButtonRetain"]
        self.command_widgets = {}

        self.setoption_list = [11, 13, 32, 40, 61]
        self.setoption_widgets = {}

        vl = VLayout()
        vl_cmd = VLayout(0, 0)
        for cmd in self.commands_list:
            cw = Command(cmd, commands[cmd], self.device.p.get(cmd))
            vl_cmd.addWidget(cw)
            self.command_widgets[cmd] = cw
        vl_cmd.addStretch(1)

        vl_so = VLayout(0, 0)
        for so in self.setoption_list:
            cw = Command("SetOption{}".format(so), setoptions[str(so)], self.device.setoption(so))
            vl_so.addWidget(cw)
            self.setoption_widgets[so] = cw

        tabs = QTabWidget()
        tab_cm = QWidget()
        tab_cm.setLayout(vl_cmd)
        tabs.addTab(tab_cm, "Settings")

        tab_so = QWidget()
        tab_so.setLayout(vl_so)
        tabs.addTab(tab_so, "SetOptions")
        vl.addWidget(tabs)

        btns = QDialogButtonBox(QDialogButtonBox.Save | QDialogButtonBox.Close)
        btns.accepted.connect(self.accept)
        btns.rejected.connect(self.reject)
        vl.addWidgets([HTMLLabel("<a href=https://github.com/arendst/Sonoff-Tasmota/wiki/Buttons-and-Switches>Buttons and Switches</a>"), btns])
        self.setLayout(vl) 
开发者ID:jziolkowski,项目名称:tdm,代码行数:43,代码来源:Buttons.py

示例9: _createEarlyCrashDialog

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def _createEarlyCrashDialog(self):
        dialog = QDialog()
        dialog.setMinimumWidth(500)
        dialog.setMinimumHeight(170)
        dialog.setWindowTitle(catalog.i18nc("@title:window", "Cura can't start"))
        dialog.finished.connect(self._closeEarlyCrashDialog)

        layout = QVBoxLayout(dialog)

        label = QLabel()
        label.setText(catalog.i18nc("@label crash message", """<p><b>Oops, Ultimaker Cura has encountered something that doesn't seem right.</p></b>
                    <p>We encountered an unrecoverable error during start up. It was possibly caused by some incorrect configuration files. We suggest to backup and reset your configuration.</p>
                    <p>Backups can be found in the configuration folder.</p>
                    <p>Please send us this Crash Report to fix the problem.</p>
                """))
        label.setWordWrap(True)
        layout.addWidget(label)

        # "send report" check box and show details
        self._send_report_checkbox = QCheckBox(catalog.i18nc("@action:button", "Send crash report to Ultimaker"), dialog)
        self._send_report_checkbox.setChecked(True)

        show_details_button = QPushButton(catalog.i18nc("@action:button", "Show detailed crash report"), dialog)
        show_details_button.setMaximumWidth(200)
        show_details_button.clicked.connect(self._showDetailedReport)

        show_configuration_folder_button = QPushButton(catalog.i18nc("@action:button", "Show configuration folder"), dialog)
        show_configuration_folder_button.setMaximumWidth(200)
        show_configuration_folder_button.clicked.connect(self._showConfigurationFolder)

        layout.addWidget(self._send_report_checkbox)
        layout.addWidget(show_details_button)
        layout.addWidget(show_configuration_folder_button)

        # "backup and start clean" and "close" buttons
        buttons = QDialogButtonBox()
        buttons.addButton(QDialogButtonBox.Close)
        buttons.addButton(catalog.i18nc("@action:button", "Backup and Reset Configuration"), QDialogButtonBox.AcceptRole)
        buttons.rejected.connect(self._closeEarlyCrashDialog)
        buttons.accepted.connect(self._backupAndStartClean)

        layout.addWidget(buttons)

        return dialog 
开发者ID:Ultimaker,项目名称:Cura,代码行数:46,代码来源:CrashHandler.py

示例10: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, device, *args, **kwargs):
        super(SwitchesDialog, self).__init__(*args, **kwargs)
        self.setWindowTitle("Switches settings [{}]".format(device.p['FriendlyName1']))
        self.setMinimumWidth(300)
        self.device = device

        self.commands_list = ["SwitchDebounce", "SwitchRetain"]
        self.command_widgets = {}

        self.setoption_list = [32]
        self.setoption_widgets = {}

        vl = VLayout()

        vl_cmd = VLayout(0, 0)
        for cmd in self.commands_list:
            cw = Command(cmd, commands[cmd], self.device.p.get(cmd))
            vl_cmd.addWidget(cw)
            self.command_widgets[cmd] = cw
        self.sm = CommandMultiSelect("SwitchMode", commands["SwitchMode"], self.device.p.get("SwitchMode"))
        vl_cmd.addWidget(self.sm)
        vl_cmd.addStretch(1)

        vl_so = VLayout(0, 0)
        for so in self.setoption_list:
            cw = Command("SetOption{}".format(so), setoptions[str(so)], self.device.setoption(so))
            vl_so.addWidget(cw)
            self.setoption_widgets[so] = cw
        vl_so.addStretch(1)

        tabs = QTabWidget()
        tab_cm = QWidget()
        tab_cm.setLayout(vl_cmd)
        tabs.addTab(tab_cm, "Settings")

        tab_so = QWidget()
        tab_so.setLayout(vl_so)
        tabs.addTab(tab_so, "SetOptions")
        vl.addWidget(tabs)

        btns = QDialogButtonBox(QDialogButtonBox.Save | QDialogButtonBox.Close)
        btns.accepted.connect(self.accept)
        btns.rejected.connect(self.reject)
        vl.addWidgets([HTMLLabel("<a href=https://github.com/arendst/Sonoff-Tasmota/wiki/Buttons-and-Switches>Buttons and Switches</a>"), btns])
        self.setLayout(vl) 
开发者ID:jziolkowski,项目名称:tdm,代码行数:47,代码来源:Switches.py

示例11: __init__

# 需要导入模块: from PyQt5.QtWidgets import QDialogButtonBox [as 别名]
# 或者: from PyQt5.QtWidgets.QDialogButtonBox import Close [as 别名]
def __init__(self, device, *args, **kwargs):
        super(PowerDialog, self).__init__(*args, **kwargs)
        self.setWindowTitle("Power settings [{}]".format(device.p['FriendlyName1']))
        self.setMinimumWidth(300)
        self.device = device

        self.commands_list = ["BlinkCount", "BlinkTime", "PowerOnState", "PowerRetain"]
        self.command_widgets = {}

        self.setoption_list = [0, 26, 63]
        self.setoption_widgets = {}

        vl = VLayout()
        vl_cmd = VLayout(0, 0)
        for cmd in self.commands_list:
            cw = Command(cmd, commands[cmd], self.device.p.get(cmd))
            vl_cmd.addWidget(cw)
            self.command_widgets[cmd] = cw

        self.ci = Interlock("Interlock", commands["Interlock"], {"Interlock": self.device.p.get("Interlock", "OFF"), "Groups": self.device.p.get("Groups", "")})
        vl_cmd.addWidget(self.ci)

        self.cpt = PulseTime("PulseTime", commands["PulseTime"], self.device.pulsetime())
        vl_cmd.addWidget(self.cpt)

        vl_cmd.addStretch(1)

        vl_so = VLayout(0, 0)
        for so in self.setoption_list:
            cw = Command("SetOption{}".format(so), setoptions[str(so)], self.device.setoption(so))
            vl_so.addWidget(cw)
            self.setoption_widgets[so] = cw
        vl_so.addStretch(1)

        tabs = QTabWidget()
        tab_cm = QWidget()
        tab_cm.setLayout(vl_cmd)
        tabs.addTab(tab_cm, "Settings")

        tab_so = QWidget()
        tab_so.setLayout(vl_so)
        tabs.addTab(tab_so, "SetOptions")
        vl.addWidget(tabs)

        btns = QDialogButtonBox(QDialogButtonBox.Save | QDialogButtonBox.Close)
        btns.accepted.connect(self.accept)
        btns.rejected.connect(self.reject)
        vl.addWidgets([HTMLLabel("<a href=https://github.com/arendst/Sonoff-Tasmota/wiki/Buttons-and-Switches>Buttons and Switches</a>"), btns])
        self.setLayout(vl) 
开发者ID:jziolkowski,项目名称:tdm,代码行数:51,代码来源:Power.py


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