casa
$Rev:20696$
|
Wrapper around a QWidget with a "Close" button. More...
#include <QCloseableWidget.qo.h>
Signals | |
void | closeRequested (QWidget *widget) |
The closeRequested signal is emitted whenever the "Close" button is pressed. | |
Public Member Functions | |
QCloseableWidget () | |
Default Constructor. | |
QCloseableWidget (QWidget *widget, String closeText="") | |
Constructor that takes the initial widget to display and the text for the close button. | |
~QCloseableWidget () | |
QWidget * | getCurrentWidget () |
Returns the current widget held by the wrapper. | |
void | setWidget (QWidget *widget, bool shouldDeleteOld=false) |
Sets the current widget to the given widget. | |
void | setCloseButtonText (String name) |
Sets the text on the "close" button to the given String. | |
void | clearWidget () |
"Clears" the current widget by replacing it with a blank widget. | |
Private Slots | |
void | closeRequest () |
Slot to handle the "Close" button's clicked() signal. | |
Private Member Functions | |
void | setup () |
Initial set-up of GUI components. | |
Private Attributes | |
QGridLayout * | grid |
Convenience pointer to the layout of this QCloseableWidget. | |
QWidget * | currWidget |
The current widget held by the wrapper. |
Wrapper around a QWidget with a "Close" button.
A QCloseableWidget is a convenience class that adds a "close" functionality to any QWidget subclass. It does this by providing methods (such as getting, setting, and clearing the QWidget) and signals indicating when the close button has been pressed. Important: it is the responsibility of the caller/parent to actually close the object; the QCloseableWidget just provides the signal.
Definition at line 53 of file QCloseableWidget.qo.h.
Default Constructor.
Creates a blank widget with a close button.
casa::QCloseableWidget::QCloseableWidget | ( | QWidget * | widget, |
String | closeText = "" |
||
) |
Constructor that takes the initial widget to display and the text for the close button.
If the text is empty, the default close button text is displayed.
void casa::QCloseableWidget::clearWidget | ( | ) |
"Clears" the current widget by replacing it with a blank widget.
This method does delete the old widget.
void casa::QCloseableWidget::closeRequest | ( | ) | [private, slot] |
Slot to handle the "Close" button's clicked() signal.
Emits the closeRequested() signal.
void casa::QCloseableWidget::closeRequested | ( | QWidget * | widget | ) | [signal] |
The closeRequested signal is emitted whenever the "Close" button is pressed.
The widget paramater points to the currently shown widget, or NULL if there is none.
QWidget* casa::QCloseableWidget::getCurrentWidget | ( | ) |
Returns the current widget held by the wrapper.
void casa::QCloseableWidget::setCloseButtonText | ( | String | name | ) |
Sets the text on the "close" button to the given String.
void casa::QCloseableWidget::setup | ( | ) | [private] |
Initial set-up of GUI components.
void casa::QCloseableWidget::setWidget | ( | QWidget * | widget, |
bool | shouldDeleteOld = false |
||
) |
Sets the current widget to the given widget.
If shouldDeleteOld is true, the old widget held by the wrapper is deleted.
QWidget* casa::QCloseableWidget::currWidget [private] |
The current widget held by the wrapper.
Definition at line 94 of file QCloseableWidget.qo.h.
QGridLayout* casa::QCloseableWidget::grid [private] |
Convenience pointer to the layout of this QCloseableWidget.
Definition at line 91 of file QCloseableWidget.qo.h.