'\" t .TH QTabDialog 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. .\" .ad l .nh .SH NAME QTabDialog \- Stack of tabbed widgets .SH SYNOPSIS \fC#include \fR .PP Inherits QDialog. .PP .SS "Public Members" .in +1c .ti -1c .BI "\fBQTabDialog\fR ( TQWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )" .br .ti -1c .BI "\fB~QTabDialog\fR ()" .br .ti -1c .BI "virtual void \fBsetFont\fR ( const TQFont & font )" .br .ti -1c .BI "void \fBaddTab\fR ( TQWidget * child, const TQString & label )" .br .ti -1c .BI "void \fBaddTab\fR ( TQWidget * child, const TQIconSet & iconset, const TQString & label )" .br .ti -1c .BI "void \fBaddTab\fR ( TQWidget * child, QTab * tab )" .br .ti -1c .BI "void \fBinsertTab\fR ( TQWidget * child, const TQString & label, int index = -1 )" .br .ti -1c .BI "void \fBinsertTab\fR ( TQWidget * child, const TQIconSet & iconset, const TQString & label, int index = -1 )" .br .ti -1c .BI "void \fBinsertTab\fR ( TQWidget * child, QTab * tab, int index = -1 )" .br .ti -1c .BI "void \fBchangeTab\fR ( TQWidget * w, const TQString & label )" .br .ti -1c .BI "void \fBchangeTab\fR ( TQWidget * w, const TQIconSet & iconset, const TQString & label )" .br .ti -1c .BI "bool \fBisTabEnabled\fR ( TQWidget * w ) const" .br .ti -1c .BI "void \fBsetTabEnabled\fR ( TQWidget * w, bool enable )" .br .ti -1c .BI "bool isTabEnabled ( const char * name ) const \fI(obsolete)\fR" .br .ti -1c .BI "void setTabEnabled ( const char * name, bool enable ) \fI(obsolete)\fR" .br .ti -1c .BI "void \fBshowPage\fR ( TQWidget * w )" .br .ti -1c .BI "void \fBremovePage\fR ( TQWidget * w )" .br .ti -1c .BI "TQString \fBtabLabel\fR ( TQWidget * w )" .br .ti -1c .BI "TQWidget * \fBcurrentPage\fR () const" .br .ti -1c .BI "void \fBsetDefaultButton\fR ( const TQString & text )" .br .ti -1c .BI "void \fBsetDefaultButton\fR ()" .br .ti -1c .BI "bool \fBhasDefaultButton\fR () const" .br .ti -1c .BI "void \fBsetHelpButton\fR ( const TQString & text )" .br .ti -1c .BI "void \fBsetHelpButton\fR ()" .br .ti -1c .BI "bool \fBhasHelpButton\fR () const" .br .ti -1c .BI "void \fBsetCancelButton\fR ( const TQString & text )" .br .ti -1c .BI "void \fBsetCancelButton\fR ()" .br .ti -1c .BI "bool \fBhasCancelButton\fR () const" .br .ti -1c .BI "void \fBsetApplyButton\fR ( const TQString & text )" .br .ti -1c .BI "void \fBsetApplyButton\fR ()" .br .ti -1c .BI "bool \fBhasApplyButton\fR () const" .br .ti -1c .BI "void \fBsetOkButton\fR ( const TQString & text )" .br .ti -1c .BI "void \fBsetOkButton\fR ()" .br .ti -1c .BI "bool \fBhasOkButton\fR () const" .br .in -1c .SS "Signals" .in +1c .ti -1c .BI "void \fBaboutToShow\fR ()" .br .ti -1c .BI "void \fBapplyButtonPressed\fR ()" .br .ti -1c .BI "void \fBcancelButtonPressed\fR ()" .br .ti -1c .BI "void \fBdefaultButtonPressed\fR ()" .br .ti -1c .BI "void \fBhelpButtonPressed\fR ()" .br .ti -1c .BI "void \fBcurrentChanged\fR ( TQWidget * )" .br .ti -1c .BI "void selected ( const TQString & ) \fI(obsolete)\fR" .br .in -1c .SS "Protected Members" .in +1c .ti -1c .BI "void \fBsetTabBar\fR ( QTabBar * tb )" .br .ti -1c .BI "QTabBar * \fBtabBar\fR () const" .br .in -1c .SH DESCRIPTION The QTabDialog class provides a stack of tabbed widgets. .PP A tabbed dialog is one in which several "tab pages" are available. By clicking on a tab page's tab or by pressing the indicated Alt+\fIletter\fR key combination, the user can select which tab page they want to use. .PP QTabDialog provides a tab bar consisting of single row of tabs at the top; each tab has an associated widget which is that tab's tab page. In addition, QTabDialog provides an OK button and the following optional buttons: Apply, Cancel, Defaults and Help. .PP The normal way to use QTabDialog is to do the following in the constructor:
    .IP 1 Create a QTabDialog. .IP 2 Create a TQWidget for each of the pages in the tab dialog, insert children into it, set up geometry management for it, and use addTab() (or insertTab()) to set up a tab and keyboard accelerator for it. .IP 3 Set up the buttons for the tab dialog using setOkButton(), setApplyButton(), setDefaultsButton(), setCancelButton() and setHelpButton(). .IP 4 Connect to the signals and slots. .PP If you don't call addTab() the page you have created will not be visible. Don't confuse the object name you supply to the TQWidget constructor and the tab label you supply to addTab(); addTab() takes user-visible name that appears on the widget's tab and may identify an accelerator, whereas the widget name is used primarily for debugging. .PP Almost all applications have to connect the applyButtonPressed() signal to something. applyButtonPressed() is emitted when either OK or Apply is clicked, and your slot must copy the dialog's state into the application. .PP There are also several other signals which may be useful: .TP cancelButtonPressed() is emitted when the user clicks Cancel. .TP defaultButtonPressed() is emitted when the user clicks Defaults; the slot it is connected to should reset the state of the dialog to the application defaults. .TP helpButtonPressed() is emitted when the user clicks Help. .TP aboutToShow() is emitted at the start of show(); if there is any chance that the state of the application may change between the creation of the tab dialog and the time show() is called, you must connect this signal to a slot that resets the state of the dialog. .TP currentChanged() is emitted when the user selects a page. .PP Each tab is either enabled or disabled at any given time (see setTabEnabled()). If a tab is enabled the tab text is drawn in black and the user can select that tab. If it is disabled the tab is drawn in a different way and the user cannot select that tab. Note that even if a tab is disabled, the page can still be visible; for example, if all of the tabs happen to be disabled. .PP You can change a tab's label and iconset using changeTab(). A tab page can be removed with removePage() and shown with showPage(). The current page is given by currentPage(). .PP QTabDialog does not support tabs on the sides or bottom, nor can you set or retrieve the visible page. If you need more functionality than QTabDialog provides, consider creating a QDialog and using a QTabBar with QTabWidgets. .PP Most of the functionality in QTabDialog is provided by a QTabWidget. .PP .ce 1 .B "[Image Omitted]" .PP .ce 1 .B "[Image Omitted]" .PP See also QDialog and Dialog Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "QTabDialog::QTabDialog ( TQWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )" Constructs a QTabDialog with only an OK button. The \fIparent\fR, \fIname\fR, \fImodal\fR and widget flag, \fIf\fR, arguments are passed on to the QDialog constructor. .SH "QTabDialog::~QTabDialog ()" Destroys the tab dialog. .SH "void QTabDialog::aboutToShow ()\fC [signal]\fR" This signal is emitted by show() when it is time to set the state of the dialog's contents. The dialog should reflect the current state of the application when it appears; if there is any possibility that the state of the application may change between the time you call QTabDialog::QTabDialog() and QTabDialog::show(), you should set the dialog's state in a slot and connect this signal to it. .PP This applies mainly to QTabDialog objects that are kept around hidden, rather than being created, shown, and deleted afterwards. .PP See also applyButtonPressed(), show(), and cancelButtonPressed(). .SH "void QTabDialog::addTab ( TQWidget * child, const TQString & label )" Adds another tab and page to the tab view. .PP The new page is \fIchild\fR; the tab's label is \fIlabel\fR. Note the difference between the widget name (which you supply to widget constructors and to setTabEnabled(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors. .PP If the tab's \fIlabel\fR contains an ampersand, the letter following the ampersand is used as an accelerator for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes an accelerator which will move the focus to this tab. .PP If you call addTab() after show() the screen will flicker and the user may be confused. .PP See also insertTab(). .SH "void QTabDialog::addTab ( TQWidget * child, const TQIconSet & iconset, const TQString & label )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP This version of the function shows the \fIiconset\fR as well as the \fIlabel\fR on the tab of \fIchild\fR. .SH "void QTabDialog::addTab ( TQWidget * child, QTab * tab )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP This is a lower-level method for adding tabs, similar to the other addTab() method. It is useful if you are using setTabBar() to set a QTabBar subclass with an overridden QTabBar::paint() function for a subclass of QTab. .PP The \fIchild\fR is the widget to be placed on the new tab page. The \fItab\fR is the tab to display on the tab page -- normally this shows a label or an icon that identifies the tab page. .SH "void QTabDialog::applyButtonPressed ()\fC [signal]\fR" This signal is emitted when either the Apply or OK button is clicked. .PP It should be connected to a slot (or several slots) that change the application's state according to the state of the dialog. .PP See 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. .PP The Cancel button should not change the application's state at all, so you should generally not need to connect it to any slot. .PP See also applyButtonPressed(), defaultButtonPressed(), and setCancelButton(). .SH "void QTabDialog::changeTab ( TQWidget * w, const TQIconSet & iconset, const TQString & label )" Changes tab page \fIw\fR's iconset to \fIiconset\fR and label to \fIlabel\fR. .SH "void QTabDialog::changeTab ( TQWidget * w, const TQString & label )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Defines a new \fIlabel\fR for the tab of page \fIw\fR .SH "void QTabDialog::currentChanged ( TQWidget * )\fC [signal]\fR" This signal is emitted whenever the current page changes. .PP See also currentPage(), showPage(), and tabLabel(). .SH "TQWidget * 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". .PP The application's state should not be changed until the user clicks Apply or OK. .PP See also applyButtonPressed(), cancelButtonPressed(), and setDefaultButton(). .SH "bool QTabDialog::hasApplyButton () const" Returns TRUE if the tab dialog has an Apply button; otherwise returns FALSE. .PP See also setApplyButton(), applyButtonPressed(), hasCancelButton(), and hasDefaultButton(). .SH "bool QTabDialog::hasCancelButton () const" Returns TRUE if the tab dialog has a Cancel button; otherwise returns FALSE. .PP See also setCancelButton(), cancelButtonPressed(), hasApplyButton(), and hasDefaultButton(). .SH "bool QTabDialog::hasDefaultButton () const" Returns TRUE if the tab dialog has a Defaults button; otherwise returns FALSE. .PP See also setDefaultButton(), defaultButtonPressed(), hasApplyButton(), and hasCancelButton(). .SH "bool QTabDialog::hasHelpButton () const" Returns TRUE if the tab dialog has a Help button; otherwise returns FALSE. .PP See also setHelpButton(), helpButtonPressed(), hasApplyButton(), and hasCancelButton(). .SH "bool QTabDialog::hasOkButton () const" Returns TRUE if the tab dialog has an OK button; otherwise returns FALSE. .PP See also setOkButton(), hasApplyButton(), hasCancelButton(), and hasDefaultButton(). .SH "void QTabDialog::helpButtonPressed ()\fC [signal]\fR" This signal is emitted when the Help button is pressed. It could be used to present information about how to use the dialog. .PP See also applyButtonPressed(), cancelButtonPressed(), and setHelpButton(). .SH "void QTabDialog::insertTab ( TQWidget * child, const TQString & label, int index = -1 )" Inserts another tab and page to the tab view. .PP The new page is \fIchild\fR; the tab's label is \fIlabel\fR. Note the difference between the widget name (which you supply to widget constructors and to setTabEnabled(), for example) and the tab label. The name is internal to the program and invariant, whereas the label is shown on-screen and may vary according to language and other factors. .PP If the tab's \fIlabel\fR contains an ampersand, the letter following the ampersand is used as an accelerator for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes an accelerator which will move the focus to this tab. .PP If \fIindex\fR is not specified, the tab is simply added. Otherwise it is inserted at the specified position. .PP If you call insertTab() after show(), the screen will flicker and the user may be confused. .PP See also addTab(). .SH "void QTabDialog::insertTab ( TQWidget * child, const TQIconSet & iconset, const TQString & label, int index = -1 )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP This version of the function shows the \fIiconset\fR as well as the \fIlabel\fR on the tab of \fIchild\fR. .SH "void QTabDialog::insertTab ( TQWidget * child, QTab * tab, int index = -1 )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP 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() function for a subclass of QTab. .PP The \fIchild\fR is the widget to be placed on the new tab page. The \fItab\fR is the tab to display on the tab page -- normally this shows a label or an icon that identifies the tab page. The \fIindex\fR is the position where this tab page should be inserted. .SH "bool QTabDialog::isTabEnabled ( TQWidget * w ) const" Returns TRUE if the page \fIw\fR is enabled; otherwise returns FALSE. .PP See also setTabEnabled() and TQWidget::enabled. .SH "bool QTabDialog::isTabEnabled ( const char * name ) const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Returns TRUE if the page with object name \fIname\fR is enabled and FALSE if it is disabled. .PP If \fIname\fR is 0 or not the name of any of the pages, isTabEnabled() returns FALSE. .PP See also setTabEnabled() and TQWidget::enabled. .SH "void QTabDialog::removePage ( TQWidget * w )" Removes page \fIw\fR from this stack of widgets. Does not delete \fIw\fR. .PP See also showPage(), QTabWidget::removePage(), and TQWidgetStack::removeWidget(). .SH "void QTabDialog::selected ( const TQString & )\fC [signal]\fR" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP This signal is emitted whenever a tab is selected (raised), including during the first show(). .PP See also raise(). .SH "void QTabDialog::setApplyButton ( const TQString & text )" Adds an Apply button to the dialog. The button's text is set to \fItext\fR. .PP The Apply button should apply the current settings in the dialog box to the application while keeping the dialog visible. .PP When Apply is clicked, the applyButtonPressed() signal is emitted. .PP If \fItext\fR is a null string, no button is shown. .PP See also setCancelButton(), setDefaultButton(), and applyButtonPressed(). .SH "void QTabDialog::setApplyButton ()" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Adds an Apply button to the dialog. The button's text is set to a localizable "Apply". .SH "void QTabDialog::setCancelButton ( const TQString & text )" Adds a Cancel button to the dialog. The button's text is set to \fItext\fR. .PP The 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 to the state immediately after the last Apply. .PP When Cancel is clicked, the cancelButtonPressed() signal is emitted. The dialog is closed at the same time. .PP If \fItext\fR is a null string, no button is shown. .PP See also setApplyButton(), setDefaultButton(), and cancelButtonPressed(). .SH "void QTabDialog::setCancelButton ()" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Adds a Cancel button to the dialog. The button's text is set to a localizable "Cancel". .SH "void QTabDialog::setDefaultButton ( const TQString & text )" Adds a Defaults button to the dialog. The button's text is set to \fItext\fR. .PP The Defaults button should set the dialog (but not the application) back to the application defaults. .PP When Defaults is clicked, the defaultButtonPressed() signal is emitted. .PP If \fItext\fR is a null string, no button is shown. .PP See also setApplyButton(), setCancelButton(), and defaultButtonPressed(). .SH "void QTabDialog::setDefaultButton ()" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Adds a Defaults button to the dialog. The button's text is set to a localizable "Defaults". .SH "void QTabDialog::setFont ( const TQFont & font )\fC [virtual]\fR" Sets the font for the tabs to \fIfont\fR. .PP If 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. .PP Reimplemented from TQWidget. .SH "void QTabDialog::setHelpButton ( const TQString & text )" Adds a Help button to the dialog. The button's text is set to \fItext\fR. .PP When Help is clicked, the helpButtonPressed() signal is emitted. .PP If \fItext\fR is a null string, no button is shown. .PP See also setApplyButton(), setCancelButton(), and helpButtonPressed(). .SH "void QTabDialog::setHelpButton ()" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Adds a Help button to the dialog. The button's text is set to a localizable "Help". .SH "void QTabDialog::setOkButton ( const TQString & text )" Adds an OK button to the dialog and sets the button's text to \fItext\fR. .PP When the OK button is clicked, the applyButtonPressed() signal is emitted, and the current settings in the dialog box should be applied to the application. The dialog then closes. .PP If \fItext\fR is a null string, no button is shown. .PP See also setCancelButton(), setDefaultButton(), and applyButtonPressed(). .SH "void QTabDialog::setOkButton ()" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Adds an OK button to the dialog. The button's text is set to a localizable "OK". .SH "void QTabDialog::setTabBar ( QTabBar * tb )\fC [protected]\fR" Replaces the QTabBar heading the dialog by the given tab bar, \fItb\fR. Note that this must be called \fIbefore\fR any tabs have been added, or the behavior is undefined. .PP See also tabBar(). .SH "void QTabDialog::setTabEnabled ( TQWidget * w, bool enable )" If \fIenable\fR is TRUE the page \fIw\fR is enabled; otherwise \fIw\fR is disabled. The page's tab is redrawn appropriately. .PP QTabWidget uses TQWidget::setEnabled() internally, rather than keeping a separate flag. .PP Note that even a disabled tab and tab page may be visible. If the page is already visible QTabWidget will not hide it; if all the pages are disabled QTabWidget will show one of them. .PP See also isTabEnabled() and TQWidget::enabled. .SH "void QTabDialog::setTabEnabled ( const char * name, bool enable )" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Finds the page with object name \fIname\fR, enables/disables it according to the value of \fIenable\fR and redraws the page's tab appropriately. .PP QTabDialog uses TQWidget::setEnabled() internally, rather than keeping a separate flag. .PP Note that even a disabled tab/page may be visible. If the page is already visible QTabDialog will not hide it; if all the pages are disabled QTabDialog will show one of them. .PP The object name is used (rather than the tab label) because the tab text may not be invariant in multi-language applications. .PP See also isTabEnabled() and TQWidget::enabled. .SH "void QTabDialog::showPage ( TQWidget * w )" Ensures that widget \fIw\fR is shown. This is mainly useful for accelerators. .PP \fBWarning:\fR If used carelessly, this function can easily surprise or confuse the user. .PP See also QTabBar::currentTab. .SH "QTabBar * QTabDialog::tabBar () const\fC [protected]\fR" Returns the currently set QTabBar. .PP See also setTabBar(). .SH "TQString QTabDialog::tabLabel ( TQWidget * w )" Returns the text in the tab for page \fIw\fR. .SH "SEE ALSO" .BR http://doc.trolltech.com/ntqtabdialog.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. .SH AUTHOR Generated automatically from the source code. .SH BUGS If you find a bug in Qt, please report it as described in .BR http://doc.trolltech.com/bughowto.html . Good bug reports help us to help you. Thank you. .P The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. .P If you find errors in this manual page, please report them to .BR qt-bugs@trolltech.com . Please include the name of the manual page (tqtabdialog.3qt) and the Qt version (3.3.8).