QWidgetStack(3qt)
β¨ QWidgetStack π
(that's the qwidgetstack.3qt man page bestie, we're in Qt 3 land and it's giving vintage)
okay so picture this: a stack of widgets where only the TOP one is user-visible. That's it. That's the whole girl. π
πΈ NAME πΈ
QWidgetStack β a stack of widgets of which only the top widget is user-visible. literally just the top one, everyone else is backstage. π
π¦ SYNOPSIS π¦
#include <qwidgetstack.h>
Inherits QFrame.
π Public Members
QWidgetStack ( QWidget * parent = 0, const char * name = 0 )
QWidgetStack ( QWidget * parent, const char * name, WFlags f )
~QWidgetStack ()
int addWidget ( QWidget * w, int id = -1 )
void removeWidget ( QWidget * w )
QWidget * widget ( int id ) const
int id ( QWidget * widget ) const
QWidget * visibleWidget () const
β¨ Public Slots β¨
void raiseWidget ( int id )
void raiseWidget ( QWidget * w )
π Signals π
void aboutToShow ( int )
void aboutToShow ( QWidget * )
π«Ά Protected Members
virtual void setChildGeometries ()
π DESCRIPTION π
The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible. Only. The. Top. One. Everyone else is just vibing underneath, unseen, waiting for their moment. π«£
The application programmer can move any widget to the top of the stack at any time using raiseWidget(), and add or remove widgets using addWidget() and removeWidget(). And listen β it is not sufficient to pass the widget stack as parent to a widget which should be inserted into the widgetstack. You actually have to add it. Being the parent is not enough, bestie. It's giving situationship. π
visibleWidget() is the get equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack. main character reveal energy. β
QWidgetStack also provides the ability to manipulate widgets through application-specified integer IDs. You can also translate from widget pointers to IDs using id() and from IDs to widget pointers using widget(). These numeric IDs are unique (per QWidgetStack, not globally β so like, don't be weird about it, they're local celebrities not world-famous π
), but QWidgetStack does not attach any additional meaning to them. No lore. No backstory. Just numbers.
The default widget stack is frameless, but you can use the usual QFrame functions (such as setFrameStyle()) to add a frame. Glow-up available on request. β¨
QWidgetStack provides a signal, aboutToShow(), which is emitted just before a managed widget is shown. It's the "5 minutes before the show starts" announcement. π£
See also QTabDialog, QTabBar, QFrame, and Organizers.
π MEMBER FUNCTION DOCUMENTATION π
QWidgetStack::QWidgetStack ( QWidget * parent = 0, const char * name = 0 )
Constructs an empty widget stack.
The parent and name arguments are passed to the QFrame constructor. π«Ά
QWidgetStack::QWidgetStack ( QWidget * parent, const char * name, WFlags f )
Constructs an empty widget stack.
The parent, name and f arguments are passed to the QFrame constructor. Same energy, extra flag. π©
QWidgetStack::~QWidgetStack ()
Destroys the object and frees any allocated resources. rip queen, she ate and now she's gone π
void QWidgetStack::aboutToShow ( int ) [signal]
This signal is emitted just before a managed widget is shown if that managed widget has an ID != -1. The argument is the numeric ID of the widget.
If you callvisibleWidget()in a slot connected toaboutToShow(), the widget it returns is the one that is currently visible, not the one that is about to be shown. β οΈ like no cap, read that twice.
void QWidgetStack::aboutToShow ( QWidget * ) [signal]
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.
If you callvisibleWidget()in a slot connected toaboutToShow(), the widget returned is the one that is currently visible, not the one that is about to be shown. same warning, same drama, still true π
int QWidgetStack::addWidget ( QWidget * w, int id = -1 )
Adds widget w to this stack of widgets, with ID id. ποΈ
- If you pass an id >= 0 this ID is used.
- If you pass an id of -1 (the default), the widgets will be numbered automatically.
- If you pass -2 a unique negative integer will be generated.
- No widget has an ID of -1. periodt. π«
Returns the ID or -1 on failure (e.g. w is 0).
If you pass an id that is already used, then a unique negative integer will be generated to prevent two widgets having the same id. no duplicate names in this group chat bestie π«Ά
If w already exists in the stack the widget will be removed first.
If w is not a child of this QWidgetStack moves it using reparent().
Example: xform/xform.cpp.
int QWidgetStack::id ( QWidget * widget ) const
Returns the ID of the widget. Returns -1 if widget is 0 or is not being managed by this widget stack. If she's not on the roster, she doesn't get a number. π
See also widget() and addWidget().
void QWidgetStack::raiseWidget ( int id ) [slot]
Raises the widget with ID id to the top of the widget stack. π
See also visibleWidget().
Example: xform/xform.cpp.
void QWidgetStack::raiseWidget ( QWidget * w ) [slot]
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Raises widget w to the top of the widget stack.
void QWidgetStack::removeWidget ( QWidget * w )
Removes widget w from this stack of widgets. Does not delete w. If w is the currently visible widget, no other widget is substituted. so you might end up with an empty stage, and that's on you, no replacement understudy will be called up π
See also visibleWidget() and raiseWidget().
void QWidgetStack::setChildGeometries () [virtual protected]
Fixes up the children's geometries. just doing a little tidying, making sure everyone's positioned correctly β¨
QWidget * QWidgetStack::visibleWidget () const
Returns the currently visible widget (the one at the top of the stack), or 0 if nothing is currently being shown. the star of the show, or nobody if the show got cancelled π
See also aboutToShow(), id(), and raiseWidget().
QWidget * QWidgetStack::widget ( int id ) const
Returns the widget with ID id. Returns 0 if this widget stack does not manage a widget with ID id. wrong number, wrong stack, no widget for you π«
See also id() and addWidget().
π 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. (no human author, just vibes and a code generator π€β¨)
π 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. π«Ά (and like, genuinely, good bug reports are iconic and we appreciate 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. β οΈ it's giving side quest, not the main canon.
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qwidgetstack.3qt) and the Qt version (3.3.8). include the receipts bestie, we need them π§Ύ
Trolltech AS β 2 February 2007 β QWidgetStack(3qt)
okay that's the whole page, ily, go stack some widgets, only the top one shows, that's the rule, periodt π πβ¨
π¦ 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