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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QFontDialog Class Reference ## [[QtGui](index.htm) module] 該QFontDialog類提供了一個對話框控件用于選擇字體。[More...](#details) 繼承[QDialog](qdialog.html)。 ### Types * `enum FontDialogOption { NoButtons, DontUseNativeDialog }` * `class **[FontDialogOptions](index.htm)**` ### Methods * `__init__ (self, QWidget?parent?=?None)` * `__init__ (self, QFont?initial, QWidget?parent?=?None)` * `changeEvent (self, QEvent?e)` * `QFont currentFont (self)` * `done (self, int?result)` * `open (self)` * `open (self, QObject?receiver, SLOT()SLOT()?member)` * `open (self, callable?receiver)` * `FontDialogOptions options (self)` * `QFont selectedFont (self)` * `setCurrentFont (self, QFont?font)` * `setOption (self, FontDialogOption?option, bool?on?=?True)` * `setOptions (self, FontDialogOptions?options)` * `setVisible (self, bool?visible)` * `bool testOption (self, FontDialogOption?option)` ### Static Methods * `(QFont, bool?ok) getFont (QFont?initial, QWidget?parent, QString?title, FontDialogOptions?options)` * `(QFont, bool?ok) getFont (QFont?def, QWidget?parent, QString?caption)` * `(QFont, bool?ok) getFont (QFont?initial, QWidget?parent?=?None)` * `(QFont, bool?ok) getFont (QWidget?parent?=?None)` ### Qt Signals * `void currentFontChanged (const QFont&)` * `void fontSelected (const QFont&)` * * * ## Detailed Description 該QFontDialog類提供了一個對話框控件用于選擇字體。 通過靜態之一創建一個字體對話框[getFont](qfontdialog.html#getFont)()函數。 示例: ``` bool ok; [QFont](qfont.html) font = QFontDialog.getFont( &ok, [QFont](qfont.html)("Helvetica [Cronyx]", 10), this); if (ok) { // the user clicked OK and font is set to the font the user selected } else { // the user canceled the dialog; font is set to the initial // value, in this case Helvetica [Cronyx], 10 } ``` 也可以用該對話框直接設置控件的字體: ``` myWidget.setFont(QFontDialog.getFont(0, myWidget.font())); ``` 如果用戶單擊OK(確定) ,他們選擇的字體將用于進myWidget ,如果他們單擊取消原來的字體。 ![A font dialog in the Plastique widget style.](https://img.kancloud.cn/2f/dd/2fddfab55bab034bed8e5be13d6da52e_520x401.png) * * * ## Type Documentation ``` QFontDialog.FontDialogOption ``` 此枚舉指定影響的字體對話框的外觀和感覺的各種選項。 | Constant | Value | Description | | --- | --- | --- | | `QFontDialog.NoButtons` | `0x00000001` | 不顯示**OK**和**Cancel**按鈕。 (有用的“現場對話” 。 ) | | `QFontDialog.DontUseNativeDialog` | `0x00000002` | 使用Qt的Mac上的標準字體對話框,而不是蘋果的本地字體面板。 (目前,本土對話框是從未使用過,但是這是有可能在未來的Qt版本中更改。 ) | 這個枚舉被引入或修改的Qt 4.5 。 該FontDialogOptions類型是一個typedef為[QFlags](index.htm)\u003cFontDialogOption\u003e 。它存儲FontDialogOption值的或組合。 **See also** [options](qfontdialog.html#options-prop),[setOption](qfontdialog.html#setOption)()和[testOption](qfontdialog.html#testOption)( ) 。 * * * ## Method Documentation ``` QFontDialog.__init__ (self, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個標準的字體對話框。 使用[setCurrentFont](qfontdialog.html#currentFont-prop)()來設置初始字體屬性。 該_parent_參數被傳遞給[QDialog](qdialog.html)構造函數。 此功能被引入Qt的4.5 。 **See also** [getFont](qfontdialog.html#getFont)( ) 。 ``` QFontDialog.__init__ (self, QFont?initial, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個標準字體對話框,給定_parent_并指定_initial_字體。 此功能被引入Qt的4.5 。 ``` QFontDialog.changeEvent (self, QEvent?e) ``` 從重新實現[QWidget.changeEvent](qwidget.html#changeEvent)( ) 。 ``` QFont QFontDialog.currentFont (self) ``` [ ``` QFontDialog.done (self, int?result) ``` ](qfont.html) [從重新實現](qfont.html)[QDialog.done](qdialog.html#done)( ) 。 關閉對話框,并將其結果代碼_result_。如果顯示此對話框[exec_](qdialog.html#exec)( ) , ()完成將導致本地事件循環來完成,并[exec_](qdialog.html#exec)( )返回_result_。 **See also** [QDialog.done](qdialog.html#done)( ) 。 ``` (QFont, bool?ok) QFontDialog.getFont (QFont?initial, QWidget?parent, QString?title, FontDialogOptions?options) ``` 執行一個模式字體對話框并返回一個字體。 如果用戶點擊**OK**,則返回所選字體。如果用戶點擊**Cancel**時,_initial_字體返回。 該對話框與給定的構造_parent_并在指定的選項_options_。_title_顯示為對話框的窗口標題和_initial_是最初選定的字體。如果_ok_參數不為空,它指的是該值設置為True,如果用戶點擊**OK**,并設置為False,如果用戶點擊**Cancel**。 示例: ``` bool ok; [QFont](qfont.html) font = [QFontDialog](qfontdialog.html).getFont(&ok, [QFont](qfont.html)("Times", 12), this); if (ok) { // font is set to the font the user selected } else { // the user canceled the dialog; font is set to the initial // value, in this case Times, 12. } ``` 也可以用該對話框直接設置控件的字體: ``` myWidget.setFont([QFontDialog](qfontdialog.html).getFont(0, myWidget.font())); ``` 在這個例子中,如果用戶單擊OK(確定) ,他們選擇的字體將被使用,如果他們單擊取消原來的字體。 **Warning:**不要刪除_parent_在該對話框的執行。如果你想這樣做,你應該用一個自己創建的對話框[QFontDialog](qfontdialog.html)構造函數。 ``` (QFont, bool?ok) QFontDialog.getFont (QFont?def, QWidget?parent, QString?caption) ``` 調用的getFont (_ok_,_initial_,_parent_)代替。 **Warning:**不要刪除_parent_在該對話框的執行。如果你想這樣做,你應該用一個自己創建的對話框[QFontDialog](qfontdialog.html)構造函數。 該_name_參數被忽略。 此功能被引入Qt的4.5 。 ``` (QFont, bool?ok) QFontDialog.getFont (QFont?initial, QWidget?parent?=?None) ``` 調用的getFont (_ok_,_parent_)代替。 **Warning:**不要刪除_parent_在該對話框的執行。如果你想這樣做,你應該用一個自己創建的對話框[QFontDialog](qfontdialog.html)構造函數。 該_name_參數被忽略。 ``` (QFont, bool?ok) QFontDialog.getFont (QWidget?parent?=?None) ``` 這是一個重載函數。 此功能被引入Qt的4.5 。 ``` QFontDialog.open (self) ``` 這是一個重載函數。 在打開的對話框并連接其[fontSelected](qfontdialog.html#fontSelected)()信號到由指定的槽_receiver_和_member_。 該信號會從插槽中斷開時,關閉對話框。 此功能被引入Qt的4.5 。 ``` QFontDialog.open (self, QObject?receiver, SLOT()SLOT()?member) ``` ``` QFontDialog.open (self, callable?receiver) ``` ``` FontDialogOptions QFontDialog.options (self) ``` [](index.htm) ``` QFont QFontDialog.selectedFont (self) ``` [ 返回用戶選擇通過單擊字體**OK**或等效按鈕。 ](qfont.html) [**Note:**此字體并不總是一樣的舉行的字體](qfont.html)[currentFont](qfontdialog.html#currentFont-prop)因為用戶屬性終于可以選擇一個使用之前選擇不同的字體。 ``` QFontDialog.setCurrentFont (self, QFont?font) ``` ``` QFontDialog.setOption (self, FontDialogOption?option, bool?on?=?True) ``` 設置給定_option_被啟用,如果_on_是真的,否則,清除給定的_option_。 **See also** [options](qfontdialog.html#options-prop)和[testOption](qfontdialog.html#testOption)( ) 。 ``` QFontDialog.setOptions (self, FontDialogOptions?options) ``` ``` QFontDialog.setVisible (self, bool?visible) ``` 從重新實現[QWidget.setVisible](qwidget.html#visible-prop)( ) 。 ``` bool QFontDialog.testOption (self, FontDialogOption?option) ``` 返回True如果給定的_option_被啟用,否則返回False 。 **See also** [options](qfontdialog.html#options-prop)和[setOption](qfontdialog.html#setOption)( ) 。 * * * ## Qt Signal Documentation ``` void currentFontChanged (const QFont&) ``` 這是該信號的默認超載。 當當前字體改變這個信號被發射。新字體中指定_font_。 當用戶在選擇字體的信號被發射。最終,所選擇的字體可能不同于當前選擇的字體。 此功能被引入Qt的4.5 。 **See also** [currentFont](qfontdialog.html#currentFont-prop),[fontSelected](qfontdialog.html#fontSelected)()和[selectedFont](qfontdialog.html#selectedFont)( ) 。 ``` void fontSelected (const QFont&) ``` 這是該信號的默認超載。 當字體已被選定,這個信號被發射。選擇的字體在指定_font_。 當用戶已經選擇了最后的字體要使用的信號只發射。當用戶改變當前字體的字體對話框它不發射。 此功能被引入Qt的4.5 。 **See also** [selectedFont](qfontdialog.html#selectedFont)( )[currentFontChanged](qfontdialog.html#currentFontChanged)()和[currentFont](qfontdialog.html#currentFont-prop)。
                  <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>

                              哎呀哎呀视频在线观看