📄 qtabdialog.3qt
字号:
.PP\fIlabel\fR is written in the QButton style, where &P makes Qt create an accelerator key on Alt-P for this page. For example:.PP.nf.br td->addTab( graphicsPane, "&Graphics" );.br td->addTab( soundPane, "&Sound" );.fi.PPIf the user presses Alt-S the sound page of the tab dialog is shown, if the user presses Alt-P the graphics page is shown..PPIf you call addTab() after show(), the screen will flicker and the user will be confused..SH "void QTabDialog::applyButtonPressed () \fC[signal]\fR"This signal is emitted when the Apply or OK buttons are clicked..PPIt should be connected to a slot (or several slots) which change the application's state according to the state of the dialog..PPSee also cancelButtonPressed(), defaultButtonPressed() and setApplyButton()..SH "void QTabDialog::cancelButtonPressed () \fC[signal]\fR"This signal is emitted when the Cancel button is clicked. It is automatically connected to QDialog::reject(), which will hide the dialog..PPThe Cancel button should not change the application's state in any way, so generally you should not need to connect it to any slot..PPSee also applyButtonPressed(), defaultButtonPressed() and setCancelButton()..SH "void QTabDialog::changeTab ( QWidget * w, const QIconSet & iconset, const QString & label )"Defines a new \fIiconset\fR and a new \fIlabel\fR for the tab of page \fIw\fR.SH "void QTabDialog::changeTab ( QWidget * w, const QString & label )"Defines a new \fIlabel\fR for the tab of page \fIw\fR.SH "void QTabDialog::currentChanged ( QWidget * ) \fC[signal]\fR"This signal is emitted whenever the current page changes..PPSee also currentPage(), showPage() and tabLabel()..SH "QWidget * QTabDialog::currentPage () const"Returns a pointer to the page currently being displayed by the tab dialog. The tab dialog does its best to make sure that this value is never 0, but if you try hard enough it can be..SH "void QTabDialog::defaultButtonPressed () \fC[signal]\fR"This signal is emitted when the Defaults button is pressed. It should reset the dialog (but not the application) to the "factory defaults.".PPThe application's state should not be changed until the user clicks Apply or OK..PPSee also applyButtonPressed(), cancelButtonPressed() and setDefaultButton()..SH "bool QTabDialog::hasApplyButton () const"Returns TRUE if the tab dialog has an Apply button, FALSE if not..PPSee also setApplyButton(), applyButtonPressed(), hasCancelButton() and hasDefaultButton()..SH "bool QTabDialog::hasCancelButton () const"Returns TRUE if the tab dialog has a Cancel button, FALSE if not..PPSee also setCancelButton(), cancelButtonPressed(), hasApplyButton() and hasDefaultButton()..SH "bool QTabDialog::hasDefaultButton () const"Returns TRUE if the tab dialog has a Defaults button, FALSE if not..PPSee also setDefaultButton(), defaultButtonPressed(), hasApplyButton() and hasCancelButton()..SH "bool QTabDialog::hasHelpButton () const"Returns TRUE if the tab dialog has a Help button, FALSE if not..PPSee also setHelpButton(), helpButtonPressed(), hasApplyButton() and hasCancelButton()..SH "bool QTabDialog::hasOkButton () const"Returns TRUE if the tab dialog has an OK button, FALSE if not..PPSee also setOkButton(), hasApplyButton(), hasCancelButton() and hasDefaultButton()..SH "void QTabDialog::helpButtonPressed () \fC[signal]\fR"This signal is emitted when the Help button is pressed. It should give instructions about how to use the dialog..PPSee also applyButtonPressed(), cancelButtonPressed() and setHelpButton()..SH "void QTabDialog::insertTab ( QWidget * child, QTab * tab, int index = -1 )"This is a lower-level method for inserting tabs, similar to the other insertTab() method. It is useful if you are using setTabBar() to set a QTabBar subclass with an overridden QTabBar::paint() routine for a subclass of QTab..SH "void QTabDialog::insertTab ( QWidget * child, const QIconSet & iconset, const QString & label, int index = -1 )"Inserts another tab and page to the tab view..PPThis function is the same as insertTab() but with an additional iconset..SH "void QTabDialog::insertTab ( QWidget * child, const QString & label, int index = -1 )"Inserts another tab and page to the tab view..PPThe tab will be labelled \fIlabel\fR and \fIchild\fR constitutes the new page. Note the difference between the widget name (which you supply to widget constructors and to e.g. setTabEnabled()) and the tab label: The name is internal to the program and invariant, while the label is shown on screen and may vary according to e.g. language..PP\fIlabel\fR is written in the QButton style, where &P makes Qt create an accelerator key on Alt-P for this page. For example:.PP.nf.br td->insertTab( graphicsPane, "&Graphics" );.br td->insertTab( soundPane, "&Sound" );.fi.PPIf \fIindex\fR is not specified, the tab is simply added. Otherwise it's inserted at the specified position..PPIf the user presses Alt-S the sound page of the tab dialog is shown, if the user presses Alt-P the graphics page is shown..PPIf you call insertTab() after show(), the screen will flicker and the user will be confused..SH "bool QTabDialog::isTabEnabled ( QWidget * w ) const"Returns TRUE if the page \fIw\fR is enabled, and false if it is disabled..PPSee also setTabEnabled() and QWidget::isEnabled()..SH "bool QTabDialog::isTabEnabled ( const char * name ) const"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPReturns TRUE if the page with object name \fIname\fR is enabled, and false if it is disabled..PPIf \fIname\fR is 0 or not the name of any of the pages, isTabEnabled() returns FALSE..PPSee also setTabEnabled() and QWidget::isEnabled()..SH "void QTabDialog::paintEvent ( QPaintEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QTabDialog::removePage ( QWidget * w )"Removes page \fIw\fR from this stack of widgets. Does not delete \fIw.\fR.PPSee also showPage(), QTabWidget::removePage() and QWidgetStack::removeWidget()..SH "void QTabDialog::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QTabDialog::selected ( const QString & tabLabel ) \fC[signal]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPThis signal is emitted whenever a tab is selected (raised), including during the first show()..PPSee also raise()..SH "void QTabDialog::setApplyButton ()"Adds an Apply button to the dialog. The button's text is set to a localizable "Apply"..SH "void QTabDialog::setApplyButton ( const QString & text )"Add an Apply button to the dialog. The button's text is set to \fItext.\fR.PPThe Apply button should apply the current settings in the dialog box to the application, while keeping the dialog visible..PPWhen Apply is clicked, the applyButtonPressed() signal is emitted..PPSee also setCancelButton(), setDefaultButton() and applyButtonPressed()..SH "void QTabDialog::setCancelButton ()"Adds a Cancel button to the dialog. The button's text is set to a localizable "Cancel"..SH "void QTabDialog::setCancelButton ( const QString & text )"Adds a Cancel button to the dialog. The button's text is set to \fItext.\fR.PPThe cancel button should always return the application to the state it was in before the tab view popped up, or if the user has clicked Apply, back the the state immediately after the last Apply..PPWhen Cancel is clicked, the cancelButtonPressed() signal is emitted. The dialog is closed at the same time..PPIf \fItext\fR is a null string, no button is shown..PPSee also setApplyButton(), setDefaultButton() and cancelButtonPressed()..SH "void QTabDialog::setDefaultButton ()"Adds a Defaults button to the dialog. The button's text is set to a localizable "Defaults"..SH "void QTabDialog::setDefaultButton ( const QString & text )"Adds a Defaults button to the dialog. The button's text is set to \fItext.\fR.PPThe Defaults button should set the dialog (but not the application) back to the application defaults..PPWhen Defaults is clicked, the defaultButtonPressed() signal is emitted..PPIf \fItext\fR is a null string, no button is shown..PPSee also setApplyButton(), setCancelButton() and defaultButtonPressed()..SH "void QTabDialog::setFont ( const QFont & font )"Sets the font for the tabs to \fIfont.\fR.PPIf the widget is visible, the display is updated with the new font immediately. There may be some geometry changes, depending on the size of the old and new fonts..SH "void QTabDialog::setHelpButton ()"Adds a Help button to the dialog. The button's text is set to a localizable "Help"..SH "void QTabDialog::setHelpButton ( const QString & text )"Adds a Help button to the dialog. The button's text is set to \fItext.\fR.PPWhen Help is clicked, the helpButtonPressed() signal is emitted..PPIf \fItext\fR is a null string, no button is shown..PPSee also setApplyButton(), setCancelButton() and helpButtonPressed()..SH "void QTabDialog::setOkButton ()"Adds an OK to the dialog. The button's text is set to a localizable "OK"..SH "void QTabDialog::setOkButton ( const QString & text )"Set the OK button's text to \fItext.\fR.PPWhen the OK button is clicked, the applyButtonPressed() signal is emitted, and the current settings in the dialog box should be applied to the application. Then the dialog closes..PPIf \fItext\fR is a null string, no button is shown..PPSee also setCancelButton(), setDefaultButton() and applyButtonPressed()..SH "void QTabDialog::setTabBar ( QTabBar * tb ) \fC[protected]\fR"Replaces the QTabBar heading the dialog by the given tab bar. Note that this must be called \fIbefore\fR any tabs have been added, or the behavior is undefined..PPSee also tabBar()..SH "void QTabDialog::setTabEnabled ( QWidget * w, bool enable )"Enables/disables page \fIw\fR according to the value of \fIenable,\fR and redraws the page's tab appropriately..PPQTabWidget uses QWidget::setEnabled() internally, rather than keep a separate flag..PPNote that even a disabled tab/page may be visible. If the page is visible already, QTabWidget will not hide it, and if all the pages are disabled, QTabWidget will show one of them..PPSee also isTabEnabled() and QWidget::setEnabled()..SH "void QTabDialog::setTabEnabled ( const char * name, bool enable )"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPFinds the page with object name \fIname,\fR enables/disables it according to the value of \fIenable,\fR and redraws the page's tab appropriately..PPQTabDialog uses QWidget::setEnabled() internally, rather than keep a separate flag..PPNote that even a disabled tab/page may be visible. If the page is visible already, QTabDialog will not hide it, and if all the pages are disabled, QTabDialog will show one of them..PPThe object name is used (rather than the tab label) because the tab text may not be invariant in multi-language applications..PPSee also isTabEnabled() and QWidget::setEnabled()..SH "void QTabDialog::show () \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPExamples:.(ltabdialog/main.cpp.)l.PPReimplemented from QWidget..SH "void QTabDialog::showPage ( QWidget * w )"Ensures that \fIw\fR is shown. This is useful mainly for accelerators..PP\fBWarning:\fR Used carelessly, this function can easily surprise or confuse the user..PPSee also QTabBar::setCurrentTab()..SH "void QTabDialog::styleChange ( QStyle & s ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QTabBar* QTabDialog::tabBar () const \fC[protected]\fR"Returns the currently set QTabBar..PPSee also setTabBar()..SH "QString QTabDialog::tabLabel ( QWidget * w )"Returns the text in the tab for page \fIw.\fR.SH "SEE ALSO".BR http://doc.trolltech.com/qtabdialog.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qtabdialog.3qt) and the Qtversion (2.3.8).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -