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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # QProgressDialog Class Reference ## [[QtGui](index.htm) module] 該QProgressDialog類提供了一個緩慢的操作進度的反饋。[More...](#details) 繼承[QDialog](qdialog.html)。 ### Methods * `__init__ (self, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0)` * `__init__ (self, QString?labelText, QString?cancelButtonText, int?minimum, int?maximum, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0)` * `bool autoClose (self)` * `bool autoReset (self)` * `cancel (self)` * `changeEvent (self, QEvent)` * `closeEvent (self, QCloseEvent)` * `forceShow (self)` * `QString labelText (self)` * `int maximum (self)` * `int minimum (self)` * `int minimumDuration (self)` * `open (self)` * `open (self, QObject?receiver, SLOT()SLOT()?member)` * `open (self, callable?receiver)` * `reset (self)` * `resizeEvent (self, QResizeEvent)` * `setAutoClose (self, bool?b)` * `setAutoReset (self, bool?b)` * `setBar (self, QProgressBar?bar)` * `setCancelButton (self, QPushButton?button)` * `setCancelButtonText (self, QString)` * `setLabel (self, QLabel?label)` * `setLabelText (self, QString)` * `setMaximum (self, int?maximum)` * `setMinimum (self, int?minimum)` * `setMinimumDuration (self, int?ms)` * `setRange (self, int?minimum, int?maximum)` * `setValue (self, int?progress)` * `showEvent (self, QShowEvent?e)` * `QSize sizeHint (self)` * `int value (self)` * `bool wasCanceled (self)` ### Qt Signals * `void canceled ()` * * * ## Detailed Description 該QProgressDialog類提供了一個緩慢的操作進度的反饋。 使用進度對話框,讓用戶多長時間的操作是要采取一個指示,并證明該應用程序并沒有被凍結。它也可以讓用戶有機會中止操作。 一個常見的問題與進度對話框是,它是很難知道什么時候使用它們;操作需要不同的時間在不同的硬件。 QProgressDialog提供了一個解決這個問題:它估計當時的操作將(基于時間的步驟) ,并只顯示本身,如果這一估計是超越[minimumDuration](qprogressdialog.html#minimumDuration-prop)( ) (4秒默認情況下) 。 使用[setMinimum](qprogressdialog.html#minimum-prop)()和[setMaximum](qprogressdialog.html#maximum-prop)( )或構造函數來設置的“臺階”的數量在操作和調用[setValue](qprogressdialog.html#value-prop)()作為操作進行。步數可以任意選擇。它可以被復制的文件的個數,接收到的字節數,通過您的算法的主循環中,或一些其它合適的單元的迭代次數。進展開始于所設定的值[setMinimum](qprogressdialog.html#minimum-prop)( ) ,和進度對話框顯示,當你調用操作已完成[setValue](qprogressdialog.html#value-prop)( )與設定的值[setMaximum](qprogressdialog.html#maximum-prop)( )作為它的參數。 該對話框會自動復位,并在手術結束隱藏自身。使用[setAutoReset](qprogressdialog.html#autoReset-prop)()和[setAutoClose](qprogressdialog.html#autoClose-prop)()來更改此行為。請注意,如果您設置了新的最大值(使用[setMaximum](qprogressdialog.html#maximum-prop)()或[setRange](qprogressdialog.html#setRange)( ) ) ,等于您當前[value](qprogressdialog.html#value-prop)( ) ,該對話框不會關閉不管。 有使用QProgressDialog的方式有兩種:模式和無模式。 相對于無模式QProgressDialog ,模態QProgressDialog更容易使用的程序員。做的操作在一個循環中,調用[setValue](qprogressdialog.html#value-prop)( )間隔,并檢查與取消[wasCanceled](qprogressdialog.html#wasCanceled-prop)( ) 。例如: ``` QProgressDialog progress("Copying files...", "Abort Copy", 0, numFiles, this); progress.setWindowModality([Qt](qt.html).WindowModal); for (int i = 0; i < numFiles; i++) { progress.setValue(i); if (progress.wasCanceled()) break; //... copy one file } progress.setValue(numFiles); ``` 無模式進度對話框是適用于那些發生在后臺,用戶能夠與應用程序交互操作。這種操作通常是基于[QTimer](qtimer.html)(或[QObject.timerEvent](qobject.html#timerEvent)()),[QSocketNotifier](qsocketnotifier.html)或[QUrlOperator](index.htm#qurloperator);或在單獨的線程執行。一[QProgressBar](qprogressbar.html)在主窗口的狀態欄往往是一種替代一個無模式進度對話框。 你必須要運行一個事件循環,連接[canceled](qprogressdialog.html#canceled)()信號到一個槽,停止的操作,并且呼叫[setValue](qprogressdialog.html#value-prop)( )間隔。例如: ``` // Operation constructor Operation.Operation([QObject](qobject.html) *parent) : [QObject](qobject.html)(parent), steps(0) { pd = new QProgressDialog("Operation in progress.", "Cancel", 0, 100); connect(pd, SIGNAL(canceled()), this, SLOT(cancel())); t = new [QTimer](qtimer.html)(this); connect(t, SIGNAL(timeout()), this, SLOT(perform())); t->start(0); } void Operation.perform() { pd->setValue(steps); //... perform one percent of the operation steps++; if (steps > pd->maximum()) t->stop(); } void Operation.cancel() { t->stop(); //... cleanup } ``` 在這兩種模式的進度對話框可以通過使用自定義小部件更換子部件進行定制[setLabel](qprogressdialog.html#setLabel)( )[setBar](qprogressdialog.html#setBar)()和[setCancelButton](qprogressdialog.html#setCancelButton)( ) 。該功能[setLabelText](qprogressdialog.html#labelText-prop)()和[setCancelButtonText](qprogressdialog.html#setCancelButtonText)( )設置顯示的文本。 ![A progress dialog shown in the Plastique widget style.](https://img.kancloud.cn/2f/3e/2f3ef18417cc836402e9dfe26ebe1e17_379x144.png) * * * ## Method Documentation ``` QProgressDialog.__init__ (self, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個進度對話框。 默認設置: * The label text is empty. * The cancel button text is (translated) "Cancel". * minimum is 0; * maximum is 100 該_parent_參數是對話框的父控件。窗口部件標記,_f_,被傳遞到[QDialog.QDialog](qdialog.html#QDialog)( )構造函數。 **See also** [setLabelText](qprogressdialog.html#labelText-prop)( )[setCancelButtonText](qprogressdialog.html#setCancelButtonText)( )[setCancelButton](qprogressdialog.html#setCancelButton)( )[setMinimum](qprogressdialog.html#minimum-prop)()和[setMaximum](qprogressdialog.html#maximum-prop)( ) 。 ``` QProgressDialog.__init__ (self, QString?labelText, QString?cancelButtonText, int?minimum, int?maximum, QWidget?parent?=?None, Qt.WindowFlags?flags?=?0) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個進度對話框。 該_labelText_是用來提醒什么進展了用戶的文本。 該_cancelButtonText_是上顯示了取消按鈕的文本。如果的QString ()傳遞則不會取消顯示按鈕。 該_minimum_和_maximum_是在步凡本進度對話框顯示正在進行的操作數。例如,如果操作是檢查50個文件,則該值的最小值是0 ,最大值是50 。在檢查的第一個文件,調用的setValue ( 0 ) 。當每個文件處理調用setValue方法( 1 ) , setValue方法( 2 )等,檢查的最后一個文件后,終于調用setValue方法( 50 ) 。 該_parent_參數是對話框的父窗口部件。父,_parent_和窗口部件標記,_f_,被傳遞到[QDialog.QDialog](qdialog.html#QDialog)( )構造函數。 **See also** [setLabelText](qprogressdialog.html#labelText-prop)( )[setLabel](qprogressdialog.html#setLabel)( )[setCancelButtonText](qprogressdialog.html#setCancelButtonText)( )[setCancelButton](qprogressdialog.html#setCancelButton)( )[setMinimum](qprogressdialog.html#minimum-prop)()和[setMaximum](qprogressdialog.html#maximum-prop)( ) 。 ``` bool QProgressDialog.autoClose (self) ``` ``` bool QProgressDialog.autoReset (self) ``` ``` QProgressDialog.cancel (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void cancel()`。 重置進度對話框。[wasCanceled](qprogressdialog.html#wasCanceled-prop)( )為真,直到進度對話框復位。進度對話框被隱藏。 ``` QProgressDialog.changeEvent (self, QEvent) ``` 從重新實現[QWidget.changeEvent](qwidget.html#changeEvent)( ) 。 ``` QProgressDialog.closeEvent (self, QCloseEvent) ``` 從重新實現[QWidget.closeEvent](qwidget.html#closeEvent)( ) 。 ``` QProgressDialog.forceShow (self) ``` 顯示已經啟動,如果它仍然隱藏算法后的對話框[minimumDuration](qprogressdialog.html#minimumDuration-prop)毫秒過去了。 **See also** [setMinimumDuration](qprogressdialog.html#minimumDuration-prop)( ) 。 ``` QString QProgressDialog.labelText (self) ``` ``` int QProgressDialog.maximum (self) ``` ``` int QProgressDialog.minimum (self) ``` ``` int QProgressDialog.minimumDuration (self) ``` ``` QProgressDialog.open (self) ``` 這是一個重載函數。 在打開的對話框并連接其[accepted](qdialog.html#accepted)()信號到由指定的槽_receiver_和_member_。 該信號會從插槽中斷開時,關閉對話框。 此功能被引入Qt的4.5 。 ``` QProgressDialog.open (self, QObject?receiver, SLOT()SLOT()?member) ``` ``` QProgressDialog.open (self, callable?receiver) ``` ``` QProgressDialog.reset (self) ``` 這種方法也是一個Qt槽與C + +的簽名`void reset()`。 重置進度對話框。進度對話框被隱藏,如果[autoClose](qprogressdialog.html#autoClose-prop)()是真實的。 **See also** [setAutoClose](qprogressdialog.html#autoClose-prop)()和[setAutoReset](qprogressdialog.html#autoReset-prop)( ) 。 ``` QProgressDialog.resizeEvent (self, QResizeEvent) ``` 從重新實現[QWidget.resizeEvent](qwidget.html#resizeEvent)( ) 。 ``` QProgressDialog.setAutoClose (self, bool?b) ``` ``` QProgressDialog.setAutoReset (self, bool?b) ``` ``` QProgressDialog.setBar (self, QProgressBar?bar) ``` 該_bar_說法有它的所有權轉移給Qt的。 設置進度欄小工具,_bar_。進度對話框調整大小以適合。進度對話框需要的進度所有權_bar_這將在必要時不要使用在堆棧上分配一個進度條被刪除,所以。 ``` QProgressDialog.setCancelButton (self, QPushButton?button) ``` 該_button_說法有它的所有權轉移給Qt的。 設置取消按鈕,按鈕,_cancelButton_。進度對話框需要這個按鈕將被刪除必要時的所有權,所以不要傳遞一個對象,它是在棧上的地址,即使用新的()來創建按鈕。如果傳遞0則沒有取消按鈕會顯示。 **See also** [setCancelButtonText](qprogressdialog.html#setCancelButtonText)( ) 。 ``` QProgressDialog.setCancelButtonText (self, QString) ``` 這種方法也是一個Qt槽與C + +的簽名`void setCancelButtonText(const QString&)`。 設置取消按鈕的文本_cancelButtonText_。如果文本被設置為的QString ( ),那么它會導致取消按鈕被隱藏和刪除。 **See also** [setCancelButton](qprogressdialog.html#setCancelButton)( ) 。 ``` QProgressDialog.setLabel (self, QLabel?label) ``` 該_label_說法有它的所有權轉移給Qt的。 設置標籤_label_。進度對話框調整大小以適合。標籤變成了進度對話框,并擁有將被刪除必要的時候,所以不要在棧上傳遞一個對象的地址。 **See also** [setLabelText](qprogressdialog.html#labelText-prop)( ) 。 ``` QProgressDialog.setLabelText (self, QString) ``` 這種方法也是一個Qt槽與C + +的簽名`void setLabelText(const QString&)`。 ``` QProgressDialog.setMaximum (self, int?maximum) ``` 這種方法也是一個Qt槽與C + +的簽名`void setMaximum(int)`。 ``` QProgressDialog.setMinimum (self, int?minimum) ``` 這種方法也是一個Qt槽與C + +的簽名`void setMinimum(int)`。 ``` QProgressDialog.setMinimumDuration (self, int?ms) ``` 這種方法也是一個Qt槽與C + +的簽名`void setMinimumDuration(int)`。 ``` QProgressDialog.setRange (self, int?minimum, int?maximum) ``` 將進度對話框的最小值和最大值_minimum_和_maximum_元。 If _maximum_小于_minimum_,_minimum_成為唯一的合法值。 如果當前值超出了新的范圍,進度對話框會重設[reset](qprogressdialog.html#reset)( ) 。 **See also** [minimum](qprogressdialog.html#minimum-prop)和[maximum](qprogressdialog.html#maximum-prop)。 ``` QProgressDialog.setValue (self, int?progress) ``` 這種方法也是一個Qt槽與C + +的簽名`void setValue(int)`。 ``` QProgressDialog.showEvent (self, QShowEvent?e) ``` 從重新實現[QWidget.showEvent](qwidget.html#showEvent)( ) 。 ``` QSize QProgressDialog.sizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.sizeHint](qwidget.html#sizeHint-prop)( ) 。 返回適合的進度對話框中的內容大小。進度對話框調整自身大小的要求,所以你不應該需要自己調用這個函數。 ``` int QProgressDialog.value (self) ``` ``` bool QProgressDialog.wasCanceled (self) ``` * * * ## Qt Signal Documentation ``` void canceled () ``` 這是該信號的默認超載。 被點擊了取消按鈕時,這個信號被發射。它被連接到[cancel](qprogressdialog.html#cancel)()槽的默認。 **See also** [wasCanceled](qprogressdialog.html#wasCanceled-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>

                              哎呀哎呀视频在线观看