FougTools
0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
|
Provides a stack of widgets similar to QStackedWidget but with "strict" stack semantics. More...
#include <qttools/gui/strict_stack_widget.h>
Public Member Functions | |
StrictStackWidget (QWidget *parent=NULL) | |
~StrictStackWidget () | |
void | pushWidget (QWidget *widget) |
QWidget * | popWidget () |
bool | isEmpty () const |
QWidget * | topWidget () const |
Provides a stack of widgets similar to QStackedWidget but with "strict" stack semantics.
QStackedWidget can be seen as a page-based widget rather than a stack widget. StrictStackWidget provides strict stack semantics applied to widgets : the only widget visible is the top widget.
When popWidget() is called it destroys the top widget and then makes visible the previous widget (if any), becoming the new top widget.
qtgui::StrictStackWidget::StrictStackWidget | ( | QWidget * | parent = NULL | ) |
qtgui::StrictStackWidget::~StrictStackWidget | ( | ) |
bool qtgui::StrictStackWidget::isEmpty | ( | ) | const |
Retruns true
if the stack contains no widget, otherwise returns false
QWidget * qtgui::StrictStackWidget::popWidget | ( | ) |
Destroys the top widget from the stack
Does nothing if stack is empty
void qtgui::StrictStackWidget::pushWidget | ( | QWidget * | widget | ) |
Adds widget
to the top of the stack (and makes it the visible widget)
QWidget * qtgui::StrictStackWidget::topWidget | ( | ) | const |
Returns a pointer to the stack's top widget
If stack is empty, NULL is returned