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


Python QPushButton.setMaximumHeight方法代码示例

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


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

示例1: _create_buttons

# 需要导入模块: from python_qt_binding.QtGui import QPushButton [as 别名]
# 或者: from python_qt_binding.QtGui.QPushButton import setMaximumHeight [as 别名]
 def _create_buttons(self, buttons):
     if MessageBox.Ok & buttons:
         self._accept_button = MessageBox.Ok
         bt = QPushButton(self.tr("&ok"))
         bt.clicked.connect(self._on_ok_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Open & buttons:
         self._accept_button = MessageBox.Open
         bt = QPushButton(self.tr("&Open"))
         bt.clicked.connect(self._on_open_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Save & buttons:
         self._accept_button = MessageBox.Save
         bt = QPushButton(self.tr("&Save"))
         bt.clicked.connect(self._on_save_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Cancel & buttons:
         self._reject_button = MessageBox.Cancel
         bt = QPushButton(self.tr("&Cancel"))
         bt.clicked.connect(self._on_cancel_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.RejectRole)
     if MessageBox.Close & buttons:
         self._reject_button = MessageBox.Close
         bt = QPushButton(self.tr("&Close"))
         bt.clicked.connect(self._on_close_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.RejectRole)
     if MessageBox.Discard & buttons:
         bt = QPushButton(self.tr("&Discard"))
         bt.clicked.connect(self._on_discard_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.DestructiveRole)
     if MessageBox.Apply & buttons:
         bt = QPushButton(self.tr("&Apply"))
         bt.clicked.connect(self._on_apply_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.ApplyRole)
     if MessageBox.Reset & buttons:
         bt = QPushButton(self.tr("&Reset"))
         bt.clicked.connect(self._on_reset_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.ResetRole)
     if MessageBox.RestoreDefaults & buttons:
         bt = QPushButton(self.tr("&RestoreDefaults"))
         bt.clicked.connect(self._on_restore_defaults_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.ResetRole)
     if MessageBox.Help & buttons:
         bt = QPushButton(self.tr("&Help"))
         bt.clicked.connect(self._on_help_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.HelpRole)
     if MessageBox.SaveAll & buttons:
         self._accept_button = MessageBox.SaveAll
         bt = QPushButton(self.tr("&SaveAll"))
         bt.clicked.connect(self._on_saveall_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Yes & buttons:
         bt = QPushButton(self.tr("&Yes"))
         bt.clicked.connect(self._on_yes_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.YesRole)
     if MessageBox.YesToAll & buttons:
         bt = QPushButton(self.tr("&YesToAll"))
         bt.clicked.connect(self._on_yestoall_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.YesRole)
     if MessageBox.No & buttons:
         bt = QPushButton(self.tr("&No"))
         bt.clicked.connect(self._on_no_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.NoRole)
     if MessageBox.NoToAll & buttons:
         bt = QPushButton(self.tr("&NoToAll"))
         bt.clicked.connect(self._on_notoall_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.NoRole)
     if MessageBox.Abort & buttons:
         self._reject_button = MessageBox.Abort
         bt = QPushButton(self.tr("&Abort"))
         bt.clicked.connect(self._on_abort_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.RejectRole)
     if MessageBox.Retry & buttons:
         self._accept_button = MessageBox.Retry
         bt = QPushButton(self.tr("&Retry"))
         bt.clicked.connect(self._on_retry_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Ignore & buttons:
         self._accept_button = MessageBox.Ignore
         bt = QPushButton(self.tr("&Ignore"))
         bt.clicked.connect(self._on_ignore_clicked)
         self.buttonBox.addButton(bt, QDialogButtonBox.AcceptRole)
     if MessageBox.Avoid & buttons:
         if self._use_checkbox:
             checkbox = QCheckBox("&Don't show again", self)
             checkbox.stateChanged.connect(self._check_ignore)
             self.buttonBox.addButton(checkbox, QDialogButtonBox.HelpRole)
         else:
             bt = QPushButton(self.tr("&Don't show again"))
             bt.setMaximumHeight(24)
             bt.clicked.connect(self._add_to_ignore)
             self.buttonBox.addButton(bt, QDialogButtonBox.HelpRole)
开发者ID:zhouchengming1,项目名称:multimaster_fkie,代码行数:94,代码来源:detailed_msg_box.py


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