Obsolete Members for QInputDialog

以下成員源於類 QInputDialog 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

特性

公共函數

(obsolete) dumpObjectInfo ()
(obsolete) dumpObjectTree ()
(obsolete) QWidget * extension () const
(obsolete) bool isEnabledToTLW () const
(obsolete) bool isTopLevel () const
(obsolete) Qt::Orientation orientation () const
(obsolete) void setExtension (QWidget * extension )
(obsolete) void setOrientation (Qt::Orientation orientation )
(obsolete) QWidget * topLevelWidget () const

公共槽

(obsolete) void showExtension (bool showIt )

靜態公共成員

(obsolete) int getInteger (QWidget * parent , const QString & title , const QString & label , int value = 0, int min = -2147483647, int max = 2147483647, int step = 1, bool * ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())

成員函數文檔編製

[static] int QInputDialog:: getInteger ( QWidget * parent , const QString & title , const QString & label , int value = 0, int min = -2147483647, int max = 2147483647, int step = 1, bool * ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Static convenience function to get an integer input from the user.

title is the text which is displayed in the title bar of the dialog. label is the text which is shown to the user (it should say what should be entered). value is the default integer which the spinbox will be set to. min and max are the minimum and maximum values the user may choose. step is the amount by which the values change as the user presses the arrow buttons to increment or decrement the value.

ok is nonnull * ok will be set to true if the user pressed OK and to false if the user pressed Cancel . The dialog's parent is parent . The dialog will be modal and uses the widget flags .

On success, this function returns the integer which has been entered by the user; on failure, it returns the initial value .

Use this static function like this:

    bool ok;
    int i = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"),
                                 tr("Percentage:"), 25, 0, 100, 1, &ok);
    if (ok)
        integerLabel->setText(tr("%1%").arg(i));
					

另請參閱 getText (), getDouble (), getItem (),和 getMultiLineText ().