QTabDialog(3qt)
β¨ QTabDialog β¨ β from the 3qt manual, bestie π
okay so. you found the QTabDialog(3qt) page. good. sit down, grab a strawberry π, we're doing tabs today.
π NAME π
QTabDialog β a whole stack of tabbed widgets. like a lil filing cabinet but cute. π
π¦ SYNOPSIS π¦
#include <qtabdialog.h>
Inherits QDialog.
π Public Members π
QTabDialog ( QWidget * parent = 0, const char * name = 0, bool modal =
FALSE, WFlags f = 0 )
~QTabDialog ()
virtual void setFont ( const QFont & font )
void addTab ( QWidget * child, const QString & label )
void addTab ( QWidget * child, const QIconSet & iconset, const QString &
label )
void addTab ( QWidget * child, QTab * tab )
void insertTab ( QWidget * child, const QString & label, int index = -1
)
void insertTab ( QWidget * child, const QIconSet & iconset, const
QString & label, int index = -1 )
void insertTab ( QWidget * child, QTab * tab, int index = -1 )
void changeTab ( QWidget * w, const QString & label )
void changeTab ( QWidget * w, const QIconSet & iconset, const QString &
label )
bool isTabEnabled ( QWidget * w ) const
void setTabEnabled ( QWidget * w, bool enable )
bool isTabEnabled ( const char * name ) const (obsolete)
void setTabEnabled ( const char * name, bool enable ) (obsolete)
void showPage ( QWidget * w )
void removePage ( QWidget * w )
QString tabLabel ( QWidget * w )
QWidget * currentPage () const
void setDefaultButton ( const QString & text )
void setDefaultButton ()
bool hasDefaultButton () const
void setHelpButton ( const QString & text )
void setHelpButton ()
bool hasHelpButton () const
void setCancelButton ( const QString & text )
void setCancelButton ()
bool hasCancelButton () const
void setApplyButton ( const QString & text )
void setApplyButton ()
bool hasApplyButton () const
void setOkButton ( const QString & text )
void setOkButton ()
bool hasOkButton () const
πΈ Signals πΈ
void aboutToShow ()
void applyButtonPressed ()
void cancelButtonPressed ()
void defaultButtonPressed ()
void helpButtonPressed ()
void currentChanged ( QWidget * )
void selected ( const QString & ) (obsolete)
π§ Protected Members π§
void setTabBar ( QTabBar * tb )
QTabBar * tabBar () const
π DESCRIPTION π
The QTabDialog class provides a stack of tabbed widgets. it's giving organized. it's giving put together. π
A tabbed dialog is one where several "tab pages" are just... there, available. the user clicks on a tab page's tab, or hits the indicated Alt+letter key combo, and boom β that's the page they're using now. slay. β¨
QTabDialog gives you a tab bar that's a single row of tabs up at the top π«Ά. every tab has a widget attached to it, and that widget is that tab's tab page. on top of all that, QTabDialog hands you an OK button plus these optional ones: Apply, Cancel, Defaults and Help.
The normal way to use QTabDialog is to do the following in the constructor (yes it's an <ol type=1>, yes we're doing all of it):
- Create a
QTabDialog. - Create a
QWidgetfor each of the pages in the tab dialog, insert children into it, set up geometry management for it, and useaddTab()(orinsertTab()) to set up a tab and keyboard accelerator for it. - Set up the buttons for the tab dialog using
setOkButton(),setApplyButton(),setDefaultsButton(),setCancelButton()andsetHelpButton(). - Connect to the signals and slots.
π¨ real talk: if you don't call addTab(), the page you created will not be visible. not a vibe. do the thing.
Also do NOT confuse the object name you hand to the QWidget constructor with the tab label you hand to addTab(). addTab() takes the user-visible name that shows up on the widget's tab and it may identify an accelerator β meanwhile the widget name is used primarily for debugging. two different jobs, bestie. don't mix them. π
Almost every application has to connect the applyButtonPressed() signal to something. applyButtonPressed() gets emitted when either OK or Apply is clicked, and your slot must copy the dialog's state into the application. no skipping this one.
There are also several other signals that may be useful:
cancelButtonPressed()is emitted when the user clicks Cancel.defaultButtonPressed()is emitted when the user clicks Defaults; the slot it's connected to should reset the state of the dialog to the application defaults.helpButtonPressed()is emitted when the user clicks Help.aboutToShow()is emitted at the start ofshow(); if there's any chance the state of the application may change between the creation of the tab dialog and the timeshow()is called, you must connect this signal to a slot that resets the state of the dialog.currentChanged()is emitted when the user selects a page.
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's disabled, the tab is drawn in a different way and the user cannot select it. π and note β even if a tab is disabled, the page can still be visible; like, if all of the tabs happen to be disabled. yes really.
You can change a tab's label and iconset with changeTab(). a tab page can be removed with removePage() and shown with showPage(). the current page comes from currentPage().
QTabDialog does not support tabs on the sides or bottom, and you can't set or retrieve the visible page either. sorry π. if you need more functionality than QTabDialog provides, consider creating a QDialog and using a QTabBar with QTabWidgets.
Most of the functionality in QTabDialog is provided by a QTabWidget. icon behavior fr fr.
[Image Omitted]
[Image Omitted]
See also QDialog and Dialog Classes.
π MEMBER FUNCTION DOCUMENTATION π
QTabDialog::QTabDialog ( QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 )
Constructs a QTabDialog with only an OK button. the parent, name, modal and widget flag, f, arguments are passed on to the QDialog constructor. that's it, that's the whole thing. π
QTabDialog::~QTabDialog ()
Destroys the tab dialog. bye bestie π¦
void QTabDialog::aboutToShow () [signal]
This signal is emitted by show() when it's 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's 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.
This applies mainly to QTabDialog objects that are kept around hidden, rather than being created, shown, and deleted afterwards.
See also applyButtonPressed(), show(), and cancelButtonPressed().
void QTabDialog::addTab ( QWidget * child, const QString & label )
Adds another tab and page to the tab view. β
The new page is child; the tab's label is label. 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. iykyk.
If the tab's label 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. cute, right? β¨οΈβ¨
β οΈ if you calladdTab()aftershow()the screen will flicker and the user may be confused. don't do that to them.
See also insertTab().
void QTabDialog::addTab ( QWidget * child, const QIconSet & iconset, const QString & label )
This is an overloaded member function, provided for convenience. it behaves essentially like the above function.
This version of the function shows the iconset as well as the label on the tab of child. icon + text, the full package π
void QTabDialog::addTab ( QWidget * child, QTab * tab )
This is an overloaded member function, provided for convenience. it behaves essentially like the above function.
This is a lower-level method for adding tabs, similar to the other addTab() method. it's useful if you're using setTabBar() to set a QTabBar subclass with an overridden QTabBar::paint() function for a subclass of QTab. advanced girlies only π
The child is the widget to be placed on the new tab page. the tab is the tab to display on the tab page β normally this shows a label or an icon that identifies the tab page.
void QTabDialog::applyButtonPressed () [signal]
This signal is emitted when either the Apply or OK button is clicked. π₯
It should be connected to a slot (or several slots) that change the application's state according to the state of the dialog.
See also cancelButtonPressed(), defaultButtonPressed(), and setApplyButton().
void QTabDialog::cancelButtonPressed () [signal]
This signal is emitted when the Cancel button is clicked. it's automatically connected to QDialog::reject(), which will hide the dialog. poof, gone π«₯
The Cancel button should not change the application's state at all, so you should generally not need to connect it to any slot.
See also applyButtonPressed(), defaultButtonPressed(), and setCancelButton().
void QTabDialog::changeTab ( QWidget * w, const QIconSet & iconset, const QString & label )
Changes tab page w's iconset to iconset and label to label. glow up β¨
void QTabDialog::changeTab ( QWidget * w, const QString & label )
This is an overloaded member function, provided for convenience. it behaves essentially like the above function.
Defines a new label for the tab of page w. just the text, no icon, keep it simple. π
void QTabDialog::currentChanged ( QWidget * ) [signal]
This signal is emitted whenever the current page changes. π
See also currentPage(), showPage(), and tabLabel().
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). π main character energy from the dialog honestly.
void QTabDialog::defaultButtonPressed () [signal]
This signal is emitted when the Defaults button is pressed. it should reset the dialog (but not the application) to the "factory defaults". π
π¨ the application's state should not be changed until the user clicks Apply or OK. do not skip ahead.
See also applyButtonPressed(), cancelButtonPressed(), and setDefaultButton().
bool QTabDialog::hasApplyButton () const
Returns TRUE if the tab dialog has an Apply button; otherwise returns FALSE.
See also setApplyButton(), applyButtonPressed(), hasCancelButton(), and hasDefaultButton().
bool QTabDialog::hasCancelButton () const
Returns TRUE if the tab dialog has a Cancel button; otherwise returns FALSE.
See also setCancelButton(), cancelButtonPressed(), hasApplyButton(), and hasDefaultButton().
bool QTabDialog::hasDefaultButton () const
Returns TRUE if the tab dialog has a Defaults button; otherwise returns FALSE.
See also setDefaultButton(), defaultButtonPressed(), hasApplyButton(), and hasCancelButton().
bool QTabDialog::hasHelpButton () const
Returns TRUE if the tab dialog has a Help button; otherwise returns FALSE.
See also setHelpButton(), helpButtonPressed(), hasApplyButton(), and hasCancelButton().
bool QTabDialog::hasOkButton () const
Returns TRUE if the tab dialog has an OK button; otherwise returns FALSE.
See also setOkButton(), hasApplyButton(), hasCancelButton(), and hasDefaultButton().
void QTabDialog::helpButtonPressed () [signal] π«Ά
This signal is emitted when the Help button is pressed. It could be used to present information about how to use the dialog.
See also applyButtonPressed(), cancelButtonPressed(), and setHelpButton().
void QTabDialog::insertTab ( QWidget * child, const QString & label, int index = -1 )
Inserts another tab and page to the tab view. bestie it's giving addTab but with placement π
The new page is child; the tab's label is label. 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.
If the tab's label 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.
If index is not specified, the tab is simply added. Otherwise it is inserted at the specified position.
β οΈ If you callinsertTab()aftershow(), the screen will flicker and the user may be confused. not the vibe fr fr
See also addTab().
void QTabDialog::insertTab ( QWidget * child, const QIconSet & iconset, const QString & label, int index = -1 )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
This version of the function shows the iconset as well as the label on the tab of child. β¨ icon girlies rise β¨
void QTabDialog::insertTab ( QWidget * child, QTab * tab, int index = -1 )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
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.
The child is the widget to be placed on the new tab page. The tab is the tab to display on the tab page β normally this shows a label or an icon that identifies the tab page. The index is the position where this tab page should be inserted.
bool QTabDialog::isTabEnabled ( QWidget * w ) const
Returns TRUE if the page w is enabled; otherwise returns FALSE.
See also setTabEnabled() and QWidget::enabled.
bool QTabDialog::isTabEnabled ( const char * name ) const π
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Returns TRUE if the page with object name name is enabled and FALSE if it is disabled.
If name is 0 or not the name of any of the pages, isTabEnabled() returns FALSE.
See also setTabEnabled() and QWidget::enabled.
void QTabDialog::removePage ( QWidget * w )
Removes page w from this stack of widgets. Does not delete w. ok so it leaves the page out but keeps it alive, do not come for its life π
See also showPage(), QTabWidget::removePage(), and QWidgetStack::removeWidget().
void QTabDialog::selected ( const QString & ) [signal]
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
This signal is emitted whenever a tab is selected (raised), including during the first show().
See also raise().
void QTabDialog::setApplyButton ( const QString & text )
Adds an Apply button to the dialog. The button's text is set to text.
The Apply button should apply the current settings in the dialog box to the application while keeping the dialog visible.
When Apply is clicked, the applyButtonPressed() signal is emitted.
If text is a null string, no button is shown.
See also setCancelButton(), setDefaultButton(), and applyButtonPressed().
void QTabDialog::setApplyButton ()
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds an Apply button to the dialog. The button's text is set to a localizable "Apply".
void QTabDialog::setCancelButton ( const QString & text )
Adds a Cancel button to the dialog. The button's text is set to text.
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. it's giving undo, but make it a whole vibe πΈ
When Cancel is clicked, the cancelButtonPressed() signal is emitted. The dialog is closed at the same time.
If text is a null string, no button is shown.
See also setApplyButton(), setDefaultButton(), and cancelButtonPressed().
void QTabDialog::setCancelButton ()
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds a Cancel button to the dialog. The button's text is set to a localizable "Cancel".
void QTabDialog::setDefaultButton ( const QString & text )
Adds a Defaults button to the dialog. The button's text is set to text.
The Defaults button should set the dialog (but not the application) back to the application defaults. read that twice bestie, dialog only, not the whole app π
When Defaults is clicked, the defaultButtonPressed() signal is emitted.
If text is a null string, no button is shown.
See also setApplyButton(), setCancelButton(), and defaultButtonPressed().
void QTabDialog::setDefaultButton ()
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds a Defaults button to the dialog. The button's text is set to a localizable "Defaults".
void QTabDialog::setFont ( const QFont & font ) [virtual] π
Sets the font for the tabs to font.
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. yeah she might resize on you, that's just how fonts are π
Reimplemented from QWidget.
void QTabDialog::setHelpButton ( const QString & text )
Adds a Help button to the dialog. The button's text is set to text.
When Help is clicked, the helpButtonPressed() signal is emitted.
If text is a null string, no button is shown.
See also setApplyButton(), setCancelButton(), and helpButtonPressed().
void QTabDialog::setHelpButton ()
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds a Help button to the dialog. The button's text is set to a localizable "Help".
void QTabDialog::setOkButton ( const QString & text ) β
Adds an OK button to the dialog and sets the button's text to text.
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.
If text is a null string, no button is shown.
See also setCancelButton(), setDefaultButton(), and applyButtonPressed().
void QTabDialog::setOkButton ()
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Adds an OK button to the dialog. The button's text is set to a localizable "OK".
void QTabDialog::setTabBar ( QTabBar * tb ) [protected]
Replaces the QTabBar heading the dialog by the given tab bar, tb. Note that this must be called before any tabs have been added, or the behavior is undefined. no cap, undefined behavior is not the moment π«£
See also tabBar().
void QTabDialog::setTabEnabled ( QWidget * w, bool enable )
If enable is TRUE the page w is enabled; otherwise w is disabled. The page's tab is redrawn appropriately.
QTabWidget uses QWidget::setEnabled() internally, rather than keeping a separate flag.
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. so like... disabled β gone, keep that in mind bestie π§
See also isTabEnabled() and QWidget::enabled.
void QTabDialog::setTabEnabled ( const char * name, bool enable ) π
This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.
Finds the page with object name name, enables/disables it according to the value of enable and redraws the page's tab appropriately.
QTabDialog uses QWidget::setEnabled() internally, rather than keeping a separate flag.
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.
The object name is used (rather than the tab label) because the tab text may not be invariant in multi-language applications.
See also isTabEnabled() and QWidget::enabled.
void QTabDialog::showPage ( QWidget * w )
Ensures that widget w is shown. This is mainly useful for accelerators.
β οΈ Warning: If used carelessly, this function can easily surprise or confuse the user. like pls be gentle with it, she's a jump-scare fr π
See also QTabBar::currentTab.
QTabBar * QTabDialog::tabBar () const [protected]
Returns the currently set QTabBar.
See also setTabBar().
QString QTabDialog::tabLabel ( QWidget * w )
Returns the text in the tab for page w.
π SEE ALSO π
π COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π¦ AUTHOR
Generated automatically from the source code.
π BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt 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.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qtabdialog.3qt) and the Qt version (3.3.8).
okay that's a wrap bestie, this one came from Trolltech AS and it's dated 2 February 2007, footer says QTabDialog(3qt) and all β go forth and build tabs, you absolute icon πβ¨π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms