<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QDialogButtonBox Class Reference ## [[QtGui](index.htm) module] 該QDialogButtonBox類是一個小部件,呈現在布局是適合當前控件樣式按鈕。[More...](#details) 繼承[QWidget](qwidget.html)。 ### Types * `enum ButtonLayout { WinLayout, MacLayout, KdeLayout, GnomeLayout }` * `enum ButtonRole { InvalidRole, AcceptRole, RejectRole, DestructiveRole, ..., ApplyRole }` * `enum StandardButton { NoButton, Ok, Save, SaveAll, ..., RestoreDefaults }` * `class **[StandardButtons](index.htm)**` ### Methods * `__init__ (self, QWidget?parent?=?None)` * `__init__ (self, Qt.Orientation?orientation, QWidget?parent?=?None)` * `__init__ (self, StandardButtons?buttons, Qt.Orientation?orientation?=?Qt.Horizontal, QWidget?parent?=?None)` * `addButton (self, QAbstractButton?button, ButtonRole?role)` * `QPushButton addButton (self, QString?text, ButtonRole?role)` * `QPushButton addButton (self, StandardButton?button)` * `QPushButton button (self, StandardButton?which)` * `ButtonRole buttonRole (self, QAbstractButton?button)` * `list-of-QAbstractButton buttons (self)` * `bool centerButtons (self)` * `changeEvent (self, QEvent?event)` * `clear (self)` * `bool event (self, QEvent?event)` * `Qt.Orientation orientation (self)` * `removeButton (self, QAbstractButton?button)` * `setCenterButtons (self, bool?center)` * `setOrientation (self, Qt.Orientation?orientation)` * `setStandardButtons (self, StandardButtons?buttons)` * `StandardButton standardButton (self, QAbstractButton?button)` * `StandardButtons standardButtons (self)` ### Qt Signals * `void accepted ()` * `void clicked (QAbstractButton *)` * `void helpRequested ()` * `void rejected ()` * * * ## Detailed Description 該QDialogButtonBox類是一個小部件,呈現在布局是適合當前控件樣式按鈕。 在布局符合該平臺的界面指南對話框和消息框通常存在按鈕。不變的是,不同的平臺有不同的布局他們的對話。 QDialogButtonBox允許開發人員添加按鈕,并會自動使用適當的布局,為用戶的桌面環境。 大多數按鈕的對話框遵循一定的角色。這樣的角色包括: * Accepting or rejecting the dialog. * Asking for help. * Performing actions on the dialog itself (such as resetting fields or applying changes). 此外,還可以解僱這可能會導致破壞性的結果的對話框的替代方式。 大多數對話框有一個幾乎可以被認為是標準的(比如按鈕**OK**和**Cancel**按鈕)。它有時是方便的,以一種標準的方式創建這些按鈕。 有使用QDialogButtonBox的幾種方法。其中一個方法是創建按鈕(或按鈕文本)自己并把它們添加到按鈕盒,指定他們的角色。 ``` findButton = new [QPushButton](qpushbutton.html)(tr("&Find")); findButton->setDefault(true); moreButton = new [QPushButton](qpushbutton.html)(tr("&More")); moreButton->setCheckable(true); moreButton->setAutoDefault(false); buttonBox = new QDialogButtonBox([Qt](qt.html).Vertical); buttonBox->addButton(findButton, QDialogButtonBox.ActionRole); buttonBox->addButton(moreButton, QDialogButtonBox.ActionRole); ``` 另外, QDialogButtonBox提供了幾個標準按鈕(例如確定,取消,保存),您可以使用。他們共同存在的標志使你可以或它們的構造函數。 ``` buttonBox = new QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); ``` 你可以混合和匹配正常的按鈕和標準按鈕。 目前的按鈕被布置在下面的方式,如果該按鈕框是水平的: | ![GnomeLayout Horizontal](https://img.kancloud.cn/b5/66/b566361e48a9f96831cf3c3a75b692cd_1000x49.png) | Button box laid out in horizontal [GnomeLayout](qdialogbuttonbox.html#ButtonLayout-enum) | | ![KdeLayout Horizontal](https://img.kancloud.cn/72/10/72102e7949b0050e3b158e77d0e488fd_1000x48.png) | Button box laid out in horizontal [KdeLayout](qdialogbuttonbox.html#ButtonLayout-enum) | | ![MacLayout Horizontal](https://img.kancloud.cn/cc/5a/cc5a62099827f8cd4ad45d25f781cbcd_1000x54.png) | Button box laid out in horizontal [MacLayout](qdialogbuttonbox.html#ButtonLayout-enum) | | ![WinLayout Horizontal](https://img.kancloud.cn/b7/b9/b7b9f86a0f2cae74aca80a4a76247858_1000x46.png) | Button box laid out in horizontal [WinLayout](qdialogbuttonbox.html#ButtonLayout-enum) | 這些按鈕的布局方式如下,如果按鈕盒是垂直的: | [GnomeLayout](qdialogbuttonbox.html#ButtonLayout-enum) | [KdeLayout](qdialogbuttonbox.html#ButtonLayout-enum) | [MacLayout](qdialogbuttonbox.html#ButtonLayout-enum) | [WinLayout](qdialogbuttonbox.html#ButtonLayout-enum) | | ![GnomeLayout Vertical](https://img.kancloud.cn/ab/de/abde991cd8e7b29f5ef5067b941bbd70_97x350.png) | ![KdeLayout Vertical](https://img.kancloud.cn/47/c9/47c9b566603ef89661f9bb94d801b720_85x350.png) | ![MacLayout Vertical](https://img.kancloud.cn/00/b6/00b67dd1e14e1730f711ac1218c1011a_126x350.png) | ![WinLayout Vertical](https://img.kancloud.cn/c4/13/c41340c210757ef111525e30c9d8102f_100x353.png) | 此外,按鈕盒僅包含有按鈕[ActionRole](qdialogbuttonbox.html#ButtonRole-enum) or [HelpRole](qdialogbuttonbox.html#ButtonRole-enum)可以考慮無模式,并有備用看看Mac OS X上: | modeless horizontal [MacLayout](qdialogbuttonbox.html#ButtonLayout-enum) | ![Screenshot of modeless horizontal MacLayout](https://img.kancloud.cn/1c/e0/1ce0136a9becabd40955bc2e8b88f596_1000x54.png) | 當單擊該按鈕中的按鈕時,[clicked](qdialogbuttonbox.html#clicked)()信號被發射的實際按鈕被按下。為方便起見,如果按鈕有[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum),[RejectRole](qdialogbuttonbox.html#ButtonRole-enum)或[HelpRole](qdialogbuttonbox.html#ButtonRole-enum)時,[accepted](qdialogbuttonbox.html#accepted)( )[rejected](qdialogbuttonbox.html#rejected)() ,或[helpRequested](qdialogbuttonbox.html#helpRequested)()信號被分別發射。 如果你想要一個特定的按鈕被默認你需要調用[QPushButton.setDefault](qpushbutton.html#default-prop)( )就可以了你自己。但是,如果沒有默認按鈕設置,并保存在使用哪個按鈕是默認按鈕跨平臺的[QPushButton.autoDefault](qpushbutton.html#autoDefault-prop)物業,第一按鈕與接受角色成為默認按鈕QDialogButtonBox顯示時, * * * ## Type Documentation ``` QDialogButtonBox.ButtonLayout ``` 該枚舉描述配置中包含的按鈕中的按鈕時所要使用的布局策略。 | Constant | Value | Description | | --- | --- | --- | | `QDialogButtonBox.WinLayout` | `0` | 使用原則適用于在Windows應用程序。 | | `QDialogButtonBox.MacLayout` | `1` | 使用策略適用于Mac OS X上的應用 | | `QDialogButtonBox.KdeLayout` | `2` | 使用策略適合在KDE應用程序。 | | `QDialogButtonBox.GnomeLayout` | `3` | 使用策略適合在GNOME應用程序。 | 按鍵布局由指定的[current style](qwidget.html#style)。然而, X11的平臺上,也可以通過在桌面環境的影響。 ``` QDialogButtonBox.ButtonRole ``` 該枚舉描述了可用于描述按鍵在按鈕框的作用。這些角色的組合作為標志用來形容他們的行為的不同方面。 | Constant | Value | Description | | --- | --- | --- | | `QDialogButtonBox.InvalidRole` | `-1` | 該按鈕是無效的。 | | `QDialogButtonBox.AcceptRole` | `0` | 單擊該按鈕被接受的對話框(如確定)。 | | `QDialogButtonBox.RejectRole` | `1` | 單擊該按鈕會導致被拒絕的對話框(例如取消) 。 | | `QDialogButtonBox.DestructiveRole` | `2` | 單擊該按鈕會導致破壞性的變化(例如,用于舍棄變更) ,然后關閉對話框。 | | `QDialogButtonBox.ActionRole` | `3` | 單擊該按鈕使更改對話框中的元素。 | | `QDialogButtonBox.HelpRole` | `4` | 該按鈕可點擊,請求幫助。 | | `QDialogButtonBox.YesRole` | `5` | 該按鈕是一個“是”形按鈕。 | | `QDialogButtonBox.NoRole` | `6` | 該按鈕是一個“無”形按鈕。 | | `QDialogButtonBox.ApplyRole` | `8` | 按鈕適用電流的變化。 | | `QDialogButtonBox.ResetRole` | `7` | 按鈕重置對話框的字段默認值。 | **See also** [StandardButton](qdialogbuttonbox.html#StandardButton-enum)。 ``` QDialogButtonBox.StandardButton ``` 這些枚舉描述了標準按鈕標志。每個按鈕都有一個定義[ButtonRole](qdialogbuttonbox.html#ButtonRole-enum)。 | Constant | Value | Description | | --- | --- | --- | | `QDialogButtonBox.Ok` | `0x00000400` | 與定義的一個“OK”按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Open` | `0x00002000` | 與定義的“打開”按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Save` | `0x00000800` | 與定義的“保存”按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Cancel` | `0x00400000` | “取消”的按鈕定義[RejectRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Close` | `0x00200000` | 與定義的“關閉”按鈕[RejectRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Discard` | `0x00800000` | A“放棄”或“不保存”按鈕,根據不同的平臺上,與定義[DestructiveRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Apply` | `0x02000000` | 一個“應用”的定義的按鈕[ApplyRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Reset` | `0x04000000` | “復位”的定義的按鈕[ResetRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.RestoreDefaults` | `0x08000000` | A“還原為默認值”的定義的按鈕[ResetRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Help` | `0x01000000` | 與定義的“幫助”按鈕[HelpRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.SaveAll` | `0x00001000` | 與定義的“全部保存”按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Yes` | `0x00004000` | 與定義的“Yes”按鈕[YesRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.YesToAll` | `0x00008000` | 與定義的“全是”按鈕[YesRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.No` | `0x00010000` | 與定義的“否”按鈕[NoRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.NoToAll` | `0x00020000` | 與定義的“全否”按鈕[NoRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Abort` | `0x00040000` | 與定義的“中止”按鈕[RejectRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Retry` | `0x00080000` | 與定義的“重試”按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.Ignore` | `0x00100000` | 一個“忽略”的定義的按鈕[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum)。 | | `QDialogButtonBox.NoButton` | `0x00000000` | 無效的按鈕。 | 該StandardButtons類型是一個typedef為[QFlags](index.htm)\u003cStandardButton\u003e 。它存儲StandardButton值的或組合。 **See also** [ButtonRole](qdialogbuttonbox.html#ButtonRole-enum)和[standardButtons](qdialogbuttonbox.html#standardButtons-prop)。 * * * ## Method Documentation ``` QDialogButtonBox.__init__ (self, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個空,水平按鈕盒給定的_parent_。 **See also** [orientation](qdialogbuttonbox.html#orientation-prop)和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` QDialogButtonBox.__init__ (self, Qt.Orientation?orientation, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個空按鈕盒給定的_orientation_和_parent_。 **See also** [orientation](qdialogbuttonbox.html#orientation-prop)和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` QDialogButtonBox.__init__ (self, StandardButtons?buttons, Qt.Orientation?orientation?=?Qt.Horizontal, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個按鈕盒給定的_orientation_和_parent_,包含由指定的標準按鈕_buttons_。 **See also** [orientation](qdialogbuttonbox.html#orientation-prop)和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` QDialogButtonBox.addButton (self, QAbstractButton?button, ButtonRole?role) ``` 該_button_說法有它的所有權轉移給Qt的。 將給定_button_與指定的按鈕盒_role_。如果該角色是無效的,不添加該按鈕。 如果按鈕已經被添加,它被刪除,并以新的角色再次添加。 **Note:**按鈕盒采用按鈕的所有權。 **See also** [removeButton](qdialogbuttonbox.html#removeButton)()和[clear](qdialogbuttonbox.html#clear)( ) 。 ``` QPushButton QDialogButtonBox.addButton (self, QString?text, ButtonRole?role) ``` [ 創建一個按鈕與給定的_text_,將其添加到該按鈕框對指定_role_,并返回相應的按鈕。如果_role_是無效的,則不會創建按鈕,則返回0。 ](qpushbutton.html) [**See also**](qpushbutton.html) [removeButton](qdialogbuttonbox.html#removeButton)()和[clear](qdialogbuttonbox.html#clear)( ) 。 ``` QPushButton QDialogButtonBox.addButton (self, StandardButton?button) ``` [ 增加了一個標準_button_在按鈕框,如果它是有效的話,并返回一個按鈕。如果_button_是無效的,它不被添加到該按鈕的框,并返回0。 ](qpushbutton.html) [**See also**](qpushbutton.html) [removeButton](qdialogbuttonbox.html#removeButton)()和[clear](qdialogbuttonbox.html#clear)( ) 。 ``` QPushButton QDialogButtonBox.button (self, StandardButton?which) ``` [](qpushbutton.html) [返回](qpushbutton.html)[QPushButton](qpushbutton.html)對應于標準按鈕_which_,或者0,如果標準按鈕不能在這個按鈕盒存在。 **See also** [standardButton](qdialogbuttonbox.html#standardButton)( )[standardButtons](qdialogbuttonbox.html#standardButtons-prop)()和[buttons](qdialogbuttonbox.html#buttons)( ) 。 ``` ButtonRole QDialogButtonBox.buttonRole (self, QAbstractButton?button) ``` [](qdialogbuttonbox.html#ButtonRole-enum) [返回指定按鈕的作用_button_。這個函數返回](qdialogbuttonbox.html#ButtonRole-enum)[InvalidRole](qdialogbuttonbox.html#ButtonRole-enum)如果_button_是0或未被添加到按鈕框。 **See also** [buttons](qdialogbuttonbox.html#buttons)()和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` list-of-QAbstractButton QDialogButtonBox.buttons (self) ``` 返回所有已被添加到按鈕中的按鈕的列表。 **See also** [buttonRole](qdialogbuttonbox.html#buttonRole)( )[addButton](qdialogbuttonbox.html#addButton)()和[removeButton](qdialogbuttonbox.html#removeButton)( ) 。 ``` bool QDialogButtonBox.centerButtons (self) ``` ``` QDialogButtonBox.changeEvent (self, QEvent?event) ``` 從重新實現[QWidget.changeEvent](qwidget.html#changeEvent)( ) 。 ``` QDialogButtonBox.clear (self) ``` 清除按鈕盒,刪除其中的所有按鈕。 **See also** [removeButton](qdialogbuttonbox.html#removeButton)()和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` bool QDialogButtonBox.event (self, QEvent?event) ``` 從重新實現[QObject.event](qobject.html#event)( ) 。 ``` Qt.Orientation QDialogButtonBox.orientation (self) ``` [ ``` QDialogButtonBox.removeButton (self, QAbstractButton?button) ``` 該_button_爭論 移除_button_從而不刪除它,并設置其父零按鈕盒。 ](qt.html#Orientation-enum) [**See also**](qt.html#Orientation-enum) [clear](qdialogbuttonbox.html#clear)( )[buttons](qdialogbuttonbox.html#buttons)()和[addButton](qdialogbuttonbox.html#addButton)( ) 。 ``` QDialogButtonBox.setCenterButtons (self, bool?center) ``` ``` QDialogButtonBox.setOrientation (self, Qt.Orientation?orientation) ``` ``` QDialogButtonBox.setStandardButtons (self, StandardButtons?buttons) ``` ``` StandardButton QDialogButtonBox.standardButton (self, QAbstractButton?button) ``` [](qdialogbuttonbox.html#StandardButton-enum) [返回對應于給定的標準按鈕枚舉值_button_或](qdialogbuttonbox.html#StandardButton-enum)[NoButton](qdialogbuttonbox.html#StandardButton-enum)如果給定的_button_不是一個標準的按鈕。 **See also** [button](qdialogbuttonbox.html#button)( )[buttons](qdialogbuttonbox.html#buttons)()和[standardButtons](qdialogbuttonbox.html#standardButtons-prop)( ) 。 ``` StandardButtons QDialogButtonBox.standardButtons (self) ``` [ * * * ## Qt Signal Documentation ``` void accepted () ``` 這是該信號的默認超載。 ](index.htm) [按鈕盒內部的按鈕被點擊時,只要它被定義與這個信號被發射](index.htm)[AcceptRole](qdialogbuttonbox.html#ButtonRole-enum) or [YesRole](qdialogbuttonbox.html#ButtonRole-enum)。 **See also** [rejected](qdialogbuttonbox.html#rejected)( )[clicked](qdialogbuttonbox.html#clicked)()和[helpRequested](qdialogbuttonbox.html#helpRequested)( ) 。 ``` void clicked (QAbstractButton *) ``` 這是該信號的默認超載。 單擊該按鈕盒內的按鈕時,這個信號被發射。被指定的被按下的特定鍵_button_。 **See also** [accepted](qdialogbuttonbox.html#accepted)( )[rejected](qdialogbuttonbox.html#rejected)()和[helpRequested](qdialogbuttonbox.html#helpRequested)( ) 。 ``` void helpRequested () ``` 這是該信號的默認超載。 按鈕盒內部的按鈕被點擊時,只要它被定義與這個信號被發射[HelpRole](qdialogbuttonbox.html#ButtonRole-enum)。 **See also** [accepted](qdialogbuttonbox.html#accepted)( )[rejected](qdialogbuttonbox.html#rejected)()和[clicked](qdialogbuttonbox.html#clicked)( ) 。 ``` void rejected () ``` 這是該信號的默認超載。 按鈕盒內部的按鈕被點擊時,只要它被定義與這個信號被發射[RejectRole](qdialogbuttonbox.html#ButtonRole-enum) or [NoRole](qdialogbuttonbox.html#ButtonRole-enum)。 **See also** [accepted](qdialogbuttonbox.html#accepted)( )[helpRequested](qdialogbuttonbox.html#helpRequested)()和[clicked](qdialogbuttonbox.html#clicked)( ) 。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看