<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國際加速解決方案。 廣告
                # QDialog Class Reference ## [[QtGui](index.htm) module] 對了QDialog類是對話框窗口的基類。[More...](#details) 繼承[QWidget](qwidget.html)。 通過繼承[QAbstractPrintDialog](qabstractprintdialog.html),[QColorDialog](qcolordialog.html),[QErrorMessage](qerrormessage.html),[QFileDialog](qfiledialog.html),[QFontDialog](qfontdialog.html),[QInputDialog](qinputdialog.html),[QMessageBox](qmessagebox.html),[QPageSetupDialog](qpagesetupdialog.html),[QPrintPreviewDialog](qprintpreviewdialog.html),[QProgressDialog](qprogressdialog.html)和[QWizard](qwizard.html)。 ### Types * `enum DialogCode { Rejected, Accepted }` ### Methods * `__init__ (self, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0)` * `accept (self)` * `closeEvent (self, QCloseEvent)` * `contextMenuEvent (self, QContextMenuEvent)` * `done (self, int)` * `bool eventFilter (self, QObject, QEvent)` * `int exec_ (self)` * `QWidget extension (self)` * `bool isSizeGripEnabled (self)` * `keyPressEvent (self, QKeyEvent)` * `QSize minimumSizeHint (self)` * `open (self)` * `Qt.Orientation orientation (self)` * `reject (self)` * `resizeEvent (self, QResizeEvent)` * `int result (self)` * `setExtension (self, QWidget?extension)` * `setModal (self, bool?modal)` * `setOrientation (self, Qt.Orientation?orientation)` * `setResult (self, int?r)` * `setSizeGripEnabled (self, bool)` * `setVisible (self, bool?visible)` * `showEvent (self, QShowEvent)` * `showExtension (self, bool)` * `QSize sizeHint (self)` ### Qt Signals * `void accepted ()` * `void finished (int)` * `void rejected ()` * * * ## Detailed Description 對了QDialog類是對話框窗口的基類。 一個對話窗口是頂層窗口主要用于短期任務和簡要溝通與用戶。 QDialogs可能是模式或無模式。 QDialogs可以提供一個[return value](#return),并且它們可以有[default buttons](#default)。 QDialogs還可以有一個[QSizeGrip](qsizegrip.html)在他們的右下角,使用[setSizeGripEnabled](qdialog.html#sizeGripEnabled-prop)( ) 。 注意的QDialog (并具有類型的任何其它部件`Qt.Dialog`)使用父控件稍微不同于其他類的Qt 。對話始終是一個頂級窗口部件,但是如果它有父,其默認位置是集中在父母的頂層widget的頂部(如果不是頂級本身) 。它也將共享父的任務欄條目。 使用的過載[QWidget.setParent](qwidget.html#setParent)( )函數來改變了QDialog部件的所有權。此功能可以讓您顯式地設置重設父控件的窗口標志;使用重載函數將清除窗口標志指定為插件的窗口 - 系統屬性(尤其是它會重置[Qt.Dialog](qt.html#WindowType-enum)標志) 。 ### Modal Dialogs A **modal**對話框是一個對話框,輸入塊在同一應用程序的其他可見窗口。用來向用戶請求一個文件名,或者用于設置應用優選項對話框通常是模態的。對話框可以[application modal](qt.html#WindowModality-enum)(缺省值)或[window modal](qt.html#WindowModality-enum)。 當打開一個應用程序的模態對話框,用戶必須完成與對話互動,并關閉它才可以訪問任何其他窗口的應用程序。窗口模式對話框只阻止訪問與對話相關的窗口,允許用戶繼續使用其他窗口的應用程序。 顯示一個模式對話框的最常用的方法是調用它的[exec_](qdialog.html#exec)()函數。當用戶關閉該對話框,[exec_](qdialog.html#exec)()將提供一個有用的[return value](#return)。通常情況下,要獲得對話框關閉并返回相應的值,我們連接默認按鈕,如:**OK**,到[accept](qdialog.html#accept)( )插槽和一個**Cancel**按鈕,將[reject](qdialog.html#reject)()槽。另外,您可以撥打[done](qdialog.html#done)( )插槽`Accepted` or `Rejected`。 另一種方法是調用setModal (真)或[setWindowModality](qwidget.html#windowModality-prop)(),然后[show](qwidget.html#show)( ) 。不像[exec_](qdialog.html#exec)( )[show](qwidget.html#show)( )立即返回控制給調用者。調用setModal (真)對進度對話框,用戶必須具有與對話框交互的能力,例如特別有用取消長時間運行的操作。如果你使用[show](qwidget.html#show)()和setModal (真)一起進行長時間的操作,則必須調用[QApplication.processEvents](qcoreapplication.html#processEvents)()周期性地在加工過程中,使用戶能夠與對話交互。 (見[QProgressDialog](qprogressdialog.html)。 ) ### Modeless Dialogs A **modeless**對話框是獨立的在同一個應用程序運行與其他窗口的對話框。在文字處理器中查找和替換對話框是無模式往往以允許用戶同時與應用程序的主窗口和對話框進行交互。 無模式對話框顯示使用[show](qwidget.html#show)(),它立即將控制返回給調用者。 如果你調用[show()](qwidget.html#show)躲在一個對話框功能后,對話框會顯示在原來的位置。這是因為,窗口管理器決定的位置,但沒有明確地由程序員放置窗口。為了保持已移動用戶對話框的位置,保存其位置的[closeEvent()](qwidget.html#closeEvent)處理程序,然后將對話框的位置,再次顯示它。 ### Default Button 對話的_default_按鈕是按下的,當用戶按下Enter鍵(返回)按鈕。此按鈕是用來表示用戶接受對話框的設置,并要關閉對話框。使用[QPushButton.setDefault](qpushbutton.html#default-prop)( )[QPushButton.isDefault](qpushbutton.html#default-prop)()和[QPushButton.autoDefault](qpushbutton.html#autoDefault-prop)( )來設置和控制對話框中的默認按鈕。 ### Escape Key 如果用戶按下Esc鍵在對話框中,[QDialog.reject](qdialog.html#reject)( )將被調用。這將導致窗口關閉:該[close event](qcloseevent.html)不能[ignored](qevent.html#ignore)。 ### Extensibility 可擴展性是顯示在對話框中兩種方法的能力:一個局部對話框,顯示最常用的選項,以及一個完整的對話框,顯示所有選項。通常情況下一個可擴展的對話框最初顯示為部分對話,但與**More**切換按鈕。如果用戶按下**More**按鈕,對話框已展開。該[Extension Example](index.htm)展示了如何使用Qt來實現可擴展的對話框。 ### Return Value (Modal Dialogs) 模態對話框通常在需要返回值的情況下,例如使用以指示用戶是否按下**OK** or **Cancel**。一個對話框可以通過調用被關閉[accept](qdialog.html#accept)()或[reject](qdialog.html#reject)()槽,并[exec_](qdialog.html#exec)( )將返回`Accepted` or `Rejected`(如適用) 。該[exec_](qdialog.html#exec)( )調用返回對話框的結果。該結果也可從[result](qdialog.html#result)( )如果對話框沒有被破壞。 為了修改對話框的親密行為,您可以重新實現的功能[accept](qdialog.html#accept)( )[reject](qdialog.html#reject)()或[done](qdialog.html#done)( ) 。該[closeEvent()](qwidget.html#closeEvent)函數只應重新實現保存對話框的位置或復蓋標準接近或拒絕的行為。 ### Code Examples 模態對話框: ``` void EditorWindow.countWords() { WordCountDialog dialog(this); dialog.setWordCount(document().wordCount()); dialog.exec(); } ``` 無模式對話框: ``` void EditorWindow.find() { if (!findDialog) { findDialog = new FindDialog(this); connect(findDialog, SIGNAL(findNext()), this, SLOT(findNext())); } findDialog->show(); findDialog->raise(); findDialog->activateWindow(); } ``` * * * ## Type Documentation ``` QDialog.DialogCode ``` 由模態對話框的返回值。 | Constant | Value | | --- | --- | | `QDialog.Accepted` | `1` | | `QDialog.Rejected` | `0` | * * * ## Method Documentation ``` QDialog.__init__ (self, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造與家長的對話_parent_。 對話始終是一個頂級窗口部件,但是如果它有父,其默認位置是集中在母公司的頂部。它也將共享父的任務欄條目。 窗口部件標記_f_到傳遞[QWidget](qwidget.html)構造函數。如果,例如,你不想這是什么按鈕,在對話框的標題欄,通[Qt.WindowTitleHint](qt.html#WindowType-enum)|[Qt.WindowSystemMenuHint](qt.html#WindowType-enum)在_f_。 **See also** [QWidget.setWindowFlags](qwidget.html#windowFlags-prop)( ) 。 ``` QDialog.accept (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void accept()`。 隱藏模式對話框并且設置結果代碼`Accepted`。 **See also** [reject](qdialog.html#reject)()和[done](qdialog.html#done)( ) 。 ``` QDialog.closeEvent (self, QCloseEvent) ``` 從重新實現[QWidget.closeEvent](qwidget.html#closeEvent)( ) 。 ``` QDialog.contextMenuEvent (self, QContextMenuEvent) ``` 從重新實現[QWidget.contextMenuEvent](qwidget.html#contextMenuEvent)( ) 。 ``` QDialog.done (self, int) ``` 這種方法也是一個Qt槽與C + +的簽名`void done(int)`。 關閉對話框,并將其結果代碼_r_。如果顯示此對話框[exec_](qdialog.html#exec)( ) , ()完成將導致本地事件循環來完成,并[exec_](qdialog.html#exec)( )返回_r_。 與[QWidget.close](qwidget.html#close)( ) , ()完成刪除的對話框,如果[Qt.WA_DeleteOnClose](qt.html#WidgetAttribute-enum)標志被設置。如果對話框是應用程序的主窗口部件,應用程序終止。如果對話框是最后一個窗口關閉后,[QApplication.lastWindowClosed](qapplication.html#lastWindowClosed)()信號被發射。 **See also** [accept](qdialog.html#accept)( )[reject](qdialog.html#reject)( )[QApplication.activeWindow](qapplication.html#activeWindow)()和[QApplication.quit](qcoreapplication.html#quit)( ) 。 ``` bool QDialog.eventFilter (self, QObject, QEvent) ``` 從重新實現[QObject.eventFilter](qobject.html#eventFilter)( ) 。 ``` int QDialog.exec_ (self) ``` 這種方法也是一個Qt槽與C + +的簽名`int exec()`。 顯示該對話框的[modal dialog](qdialog.html#modal-dialogs),阻塞,直到用戶關閉它。該函數返回一個[DialogCode](qdialog.html#DialogCode-enum)結果。 如果對話是[application modal](qt.html#WindowModality-enum),用戶不能在同一應用程序的任何其他窗口交互,直到他們關閉對話框。如果對話是[window modal](qt.html#WindowModality-enum),只與父窗口的交互被阻塞,而對話是開放的。默認情況下,對話框是應用程序模式。 **See also** [open](qdialog.html#open)( )[show](qwidget.html#show)( )[result](qdialog.html#result)()和[setWindowModality](qwidget.html#windowModality-prop)( ) 。 ``` QWidget QDialog.extension (self) ``` [ ``` bool QDialog.isSizeGripEnabled (self) ``` ``` QDialog.keyPressEvent (self, QKeyEvent) ``` ](qwidget.html) [從重新實現](qwidget.html)[QWidget.keyPressEvent](qwidget.html#keyPressEvent)( ) 。 ``` QSize QDialog.minimumSizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.minimumSizeHint](qwidget.html#minimumSizeHint-prop)( ) 。 ``` QDialog.open (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void open()`。 顯示該對話框的[window modal dialog](qdialog.html#modal-dialogs),立即返回。 此功能被引入Qt的4.5 。 **See also** [exec_](qdialog.html#exec)( )[show](qwidget.html#show)( )[result](qdialog.html#result)()和[setWindowModality](qwidget.html#windowModality-prop)( ) 。 ``` Qt.Orientation QDialog.orientation (self) ``` [ ``` QDialog.reject (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void reject()`。 隱藏模式對話框并且設置結果代碼`Rejected`。 ](qt.html#Orientation-enum) [**See also**](qt.html#Orientation-enum) [accept](qdialog.html#accept)()和[done](qdialog.html#done)( ) 。 ``` QDialog.resizeEvent (self, QResizeEvent) ``` 從重新實現[QWidget.resizeEvent](qwidget.html#resizeEvent)( ) 。 ``` int QDialog.result (self) ``` 一般而言返回模式對話框的結果代碼,`Accepted` or `Rejected`。 **Note:**從使用時[QMessageBox](qmessagebox.html)實例結果代碼類型是[QMessageBox.StandardButton](qmessagebox.html#StandardButton-enum) 不要調用此函數與構建對話[Qt.WA_DeleteOnClose](qt.html#WidgetAttribute-enum)屬性。 **See also** [setResult](qdialog.html#setResult)( ) 。 ``` QDialog.setExtension (self, QWidget?extension) ``` 該_extension_說法有它的所有權轉移給Qt的。 ``` QDialog.setModal (self, bool?modal) ``` ``` QDialog.setOrientation (self, Qt.Orientation?orientation) ``` ``` QDialog.setResult (self, int?r) ``` 設置模式對話框的結果代碼_i_。 **Note:**我們建議您通過使用定義的值之一[QDialog.DialogCode](qdialog.html#DialogCode-enum)。 **See also** [result](qdialog.html#result)( ) 。 ``` QDialog.setSizeGripEnabled (self, bool) ``` ``` QDialog.setVisible (self, bool?visible) ``` 從重新實現[QWidget.setVisible](qwidget.html#visible-prop)( ) 。 ``` QDialog.showEvent (self, QShowEvent) ``` 從重新實現[QWidget.showEvent](qwidget.html#showEvent)( ) 。 ``` QDialog.showExtension (self, bool) ``` 這種方法也是一個Qt槽與C + +的簽名`void showExtension(bool)`。 ``` QSize QDialog.sizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.sizeHint](qwidget.html#sizeHint-prop)( ) 。 * * * ## Qt Signal Documentation ``` void accepted () ``` 這是該信號的默認超載。 當對話框已接受由用戶或通過調用這個信號被發射[accept](qdialog.html#accept)()或[done](qdialog.html#done)()與[QDialog.Accepted](qdialog.html#DialogCode-enum)的說法。 注意,此信號是_not_隱藏的對話框時發出[hide](qwidget.html#hide)( )或者其setVisible (假) 。這包括刪除對話框,而它是可見的。 這個函數是Qt 4.1中引入。 **See also** [finished](qdialog.html#finished)()和[rejected](qdialog.html#rejected)( ) 。 ``` void finished (int) ``` 這是該信號的默認超載。 這個信號被發射時,對話框的_result_碼已經被設置,或者由用戶或通過調用[done](qdialog.html#done)( )[accept](qdialog.html#accept)() ,或[reject](qdialog.html#reject)( ) 。 注意,此信號是_not_隱藏的對話框時發出[hide](qwidget.html#hide)( )或者其setVisible (假) 。這包括刪除對話框,而它是可見的。 這個函數是Qt 4.1中引入。 **See also** [accepted](qdialog.html#accepted)()和[rejected](qdialog.html#rejected)( ) 。 ``` void rejected () ``` 這是該信號的默認超載。 當對話框被拒絕或者由用戶或通過調用這個信號被發射[reject](qdialog.html#reject)()或[done](qdialog.html#done)()與[QDialog.Rejected](qdialog.html#DialogCode-enum)的說法。 注意,此信號是_not_隱藏的對話框時發出[hide](qwidget.html#hide)( )或者其setVisible (假) 。這包括刪除對話框,而它是可見的。 這個函數是Qt 4.1中引入。 **See also** [finished](qdialog.html#finished)()和[accepted](qdialog.html#accepted)( ) 。
                  <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>

                              哎呀哎呀视频在线观看