Home · All Classes · Main Classes · Deprecated |
A basic header for MSheet. More...
Inherits MWidgetController.
Public Member Functions | |
MBasicSheetHeader (QGraphicsItem *parent=0) | |
virtual | ~MBasicSheetHeader () |
void | setPositiveAction (QAction *action) |
QAction * | positiveAction () const |
void | setNegativeAction (QAction *action) |
QAction * | negativeAction () const |
void | setProgressIndicatorVisible (bool visibile) |
bool | isProgressIndicatorVisible () const |
Properties | |
bool | progressIndicatorVisible |
A basic header for MSheet.
MBasicSheetHeader is a basic header that you can conveniently use as the header widget of your MSheet.
Its default view provides a button for a negative or neutral action in its left corner, a button for a positive action in its right corner and an optional progress indicator (of unknown duration, a.k.a a spinner) in its middle.
Common usage:
MySheet::MySheet() : MSheet() { MBasicSheetHeader *sheetHeader = new MBasicSheetHeader; sheetHeader->setPositiveAction(new QAction("Done", sheetHeader)); connect(sheetHeader->positiveAction(), SIGNAL(triggered()), SLOT(done())); sheetHeader->setNegativeAction(new QAction("Cancel", sheetHeader)); connect(sheetHeader->negativeAction(), SIGNAL(triggered()), SLOT(cancel())); setHeaderWidget(sheetHeader); }
MBasicSheetHeader::MBasicSheetHeader | ( | QGraphicsItem * | parent = 0 |
) |
MBasicSheetHeader::~MBasicSheetHeader | ( | ) | [virtual] |
bool MBasicSheetHeader::isProgressIndicatorVisible | ( | ) | const |
Returns whether a progress indicator is being shown.
QAction * MBasicSheetHeader::negativeAction | ( | ) | const |
Returns the negative action. There's not negative action by default, thus by default it returns 0 (null).
QAction * MBasicSheetHeader::positiveAction | ( | ) | const |
Returns the positive action. There's not positive action by default, thus by default it returns 0 (null).
void MBasicSheetHeader::setNegativeAction | ( | QAction * | action | ) |
Sets the negative action.
In case your sheet has only a single, neutral, action, set it here and leave positiveAction() empty.
Ownership is not automatically transfered, but you may still set MBasicSheetHeader as the parent of action (e.g. by passing MBasicSheetHeader in the constructor of action).
void MBasicSheetHeader::setPositiveAction | ( | QAction * | action | ) |
Sets the positive action.
Ownership is not automatically transfered, but you may still set MBasicSheetHeader as the parent of action (e.g. by passing MBasicSheetHeader in the constructor of action).
void MBasicSheetHeader::setProgressIndicatorVisible | ( | bool | visibile | ) |
Defines whether a progress indicator should be shown.
visible | true will show it and false will hide it |
MBasicSheetHeader::progressIndicatorVisible [read, write] |
Defines whether a progress indicator should be shown.
It true, a progress indicator with unknown duration (such as a spinner) will be displayed in the center of the header (for its default view). Use it to hint the user that some process is ongoing or that the sheet is waiting for something to complete.
By default, this property is false.
Set it with setProgressIndicatorVisible() and get its current value with isProgressIndicatorVisible().
Copyright © 2010 Nokia Corporation | MeeGo Touch |