<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # QCheckBox Class Reference ## [[QtGui](index.htm) module] 該QCheckBox控件提供了一個文本標籤的復選框。[More...](#details) 繼承[QAbstractButton](qabstractbutton.html)。 ### Methods * `__init__ (self, QWidget?parent?=?None)` * `__init__ (self, QString?text, QWidget?parent?=?None)` * `Qt.CheckState checkState (self)` * `checkStateSet (self)` * `bool event (self, QEvent?e)` * `bool hitButton (self, QPoint?pos)` * `initStyleOption (self, QStyleOptionButton?option)` * `bool isTristate (self)` * `QSize minimumSizeHint (self)` * `mouseMoveEvent (self, QMouseEvent)` * `nextCheckState (self)` * `paintEvent (self, QPaintEvent)` * `setCheckState (self, Qt.CheckState?state)` * `setTristate (self, bool?on?=?True)` * `QSize sizeHint (self)` ### Qt Signals * `void stateChanged (int)` * * * ## Detailed Description 該QCheckBox控件提供了一個文本標籤的復選框。 一個QCheckBox是一個選項按鈕,可以打開(選中)或關閉(未選中) 。復選框通常用于表示可以啟用或禁用,而不會影響其他應用程序的功能,但不同類型的行為可以實施。例如,一個[QButtonGroup](qbuttongroup.html)可以用來檢查組在邏輯上的按鈕,允許獨家復選框。但是,[QButtonGroup](qbuttongroup.html)不提供任何視覺表示。 下面進一步的圖像顯示了獨家及非獨家復選框之間的差異。 | ![](https://img.kancloud.cn/7a/79/7a7900ab1b5ef320c0d16a05a53373a3_188x134.png) | ![](https://img.kancloud.cn/b5/b3/b5b3bef3a69cb5b4f9dde95a9ff335b0_224x134.png) | 每當一個復選框被選中或清除它發出的信號[stateChanged](qcheckbox.html#stateChanged)( ) 。連接到這個信號,如果你想每次復選框的狀態發生改變來觸發一個動作。您可以使用[isChecked](qabstractbutton.html#checked-prop)( )來查詢一個復選框是否被選中。 除了通常的選中和未選中狀態, QCheckBox選擇提供第三狀態表示“沒有變化” 。每當你需要給用戶既不檢查也不是取消選中的復選框的選擇,這是很有用的。如果您需要這第三狀態,與啟用[setTristate](qcheckbox.html#tristate-prop)() ,并使用[checkState](qcheckbox.html#checkState)( )查詢當前的切換狀態。 一樣[QPushButton](qpushbutton.html),一個復選框顯示文本和可選的小圖標。該圖標設置[setIcon](qabstractbutton.html#icon-prop)( ) 。該文本可以在構造函數或設置[setText](qabstractbutton.html#text-prop)( ) 。快捷鍵可以通過首選字符與前面的符號來指定。例如: ``` QCheckBox *checkbox = new QCheckBox("C&ase sensitive", this); ``` 在這個例子中,快捷鍵是_Alt+A_。請參閱[QShortcut](qshortcut.html#mnemonic)有關詳細信息的文檔(顯示的實際符號,使用“\u0026\u0026” ) 。 重要的繼承功能:[text](qabstractbutton.html#text-prop)( )[setText](qabstractbutton.html#text-prop)( )[text](qabstractbutton.html#text-prop)( )[pixmap](index.htm#pixmap)( )[setPixmap](index.htm#setPixmap)( )[accel](index.htm#accel)( )[setAccel](index.htm#setAccel)( )[isToggleButton](index.htm#isToggleButton)( )[setDown](qabstractbutton.html#down-prop)( )[isDown](qabstractbutton.html#down-prop)( )[isOn](index.htm#isOn)( )[checkState](qcheckbox.html#checkState)( )[autoRepeat](qabstractbutton.html#autoRepeat-prop)( ) , isExclusiveToggle ( ) ,[group](qabstractbutton.html#group)( )[setAutoRepeat](qabstractbutton.html#autoRepeat-prop)( )[toggle](qabstractbutton.html#toggle)( )[pressed](qabstractbutton.html#pressed)( )[released](qabstractbutton.html#released)( )[clicked](qabstractbutton.html#clicked)( )[toggled](qabstractbutton.html#toggled)( )[checkState](qcheckbox.html#checkState)()和[stateChanged](qcheckbox.html#stateChanged)( ) 。 | ![Screenshot of a Macintosh style checkbox](https://img.kancloud.cn/98/b9/98b9b4ce32cac105c135240ce92c9743_183x33.png) | A checkbox shown in the [Macintosh widget style](index.htm). | | ![Screenshot of a Windows XP style checkbox](https://img.kancloud.cn/cd/13/cd13000f4c0ba3b2061a474453135c89_191x31.png) | A checkbox shown in the [Windows XP widget style](index.htm). | | ![Screenshot of a Plastique style checkbox](https://img.kancloud.cn/dc/07/dc07c745da7cea8f3ea75b93a8bdd1d3_191x34.png) | A checkbox shown in the [Plastique widget style](index.htm). | * * * ## Method Documentation ``` QCheckBox.__init__ (self, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個復選框與給定_parent_,但沒有文字。 _parent_到傳遞[QAbstractButton](qabstractbutton.html)構造函數。 ``` QCheckBox.__init__ (self, QString?text, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個復選框與給定_parent_和_text_。 _parent_到傳遞[QAbstractButton](qabstractbutton.html)構造函數。 ``` Qt.CheckState QCheckBox.checkState (self) ``` [](qt.html#CheckState-enum) [返回復選框的選中狀態。如果您不需要三態的支持,您還可以使用](qt.html#CheckState-enum)[QAbstractButton.isChecked](qabstractbutton.html#checked-prop)( )返回一個布爾值。 **See also** [setCheckState](qcheckbox.html#setCheckState)()和[Qt.CheckState](qt.html#CheckState-enum)。 ``` QCheckBox.checkStateSet (self) ``` 從重新實現[QAbstractButton.checkStateSet](qabstractbutton.html#checkStateSet)( ) 。 ``` bool QCheckBox.event (self, QEvent?e) ``` 從重新實現[QObject.event](qobject.html#event)( ) 。 ``` bool QCheckBox.hitButton (self, QPoint?pos) ``` 從重新實現[QAbstractButton.hitButton](qabstractbutton.html#hitButton)( ) 。 ``` QCheckBox.initStyleOption (self, QStyleOptionButton?option) ``` 初始化_option_與其它的值[QCheckBox](qcheckbox.html)。這種方法對于那些需要子類有用[QStyleOptionButton](qstyleoptionbutton.html),但不希望在所有的信息填寫自己。 **See also** [QStyleOption.initFrom](qstyleoption.html#initFrom)( ) 。 ``` bool QCheckBox.isTristate (self) ``` ``` QSize QCheckBox.minimumSizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.minimumSizeHint](qwidget.html#minimumSizeHint-prop)( ) 。 此功能被引入Qt的4.8 。 ``` QCheckBox.mouseMoveEvent (self, QMouseEvent) ``` 從重新實現[QWidget.mouseMoveEvent](qwidget.html#mouseMoveEvent)( ) 。 ``` QCheckBox.nextCheckState (self) ``` 從重新實現[QAbstractButton.nextCheckState](qabstractbutton.html#nextCheckState)( ) 。 ``` QCheckBox.paintEvent (self, QPaintEvent) ``` 從重新實現[QWidget.paintEvent](qwidget.html#paintEvent)( ) 。 ``` QCheckBox.setCheckState (self, Qt.CheckState?state) ``` 設置復選框的選中狀態,以_state_。如果您不需要三態的支持,您還可以使用[QAbstractButton.setChecked](qabstractbutton.html#checked-prop)( ) ,它接受一個布爾值。 **See also** [checkState](qcheckbox.html#checkState)()和[Qt.CheckState](qt.html#CheckState-enum)。 ``` QCheckBox.setTristate (self, bool?on?=?True) ``` ``` QSize QCheckBox.sizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.sizeHint](qwidget.html#sizeHint-prop)( ) 。 * * * ## Qt Signal Documentation ``` void stateChanged (int) ``` 這是該信號的默認超載。 這個信號被發射時該復選框的狀態發生變化,即每當用戶選中或取消選中它。 _state_包含復選框的新[Qt.CheckState](qt.html#CheckState-enum)。
                  <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>

                              哎呀哎呀视频在线观看