Home · All Classes · Main Classes · Deprecated
Public Member Functions | Properties

MBasicSheetHeader Class Reference

A basic header for MSheet. More...

Inherits MWidgetController.

List of all members.

Public Member Functions

 MBasicSheetHeader (QGraphicsItem *parent=0)
virtual ~MBasicSheetHeader ()
void setPositiveAction (QAction *action)
QActionpositiveAction () const
void setNegativeAction (QAction *action)
QActionnegativeAction () const
void setProgressIndicatorVisible (bool visibile)
bool isProgressIndicatorVisible () const

Properties

bool progressIndicatorVisible

Detailed Description

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);
   }

Constructor & Destructor Documentation

MBasicSheetHeader::MBasicSheetHeader ( QGraphicsItem parent = 0  ) 
MBasicSheetHeader::~MBasicSheetHeader (  )  [virtual]

Member Function Documentation

bool MBasicSheetHeader::isProgressIndicatorVisible (  )  const

Returns whether a progress indicator is being shown.

Returns:
true if it's being shown or false if it's hidden
QAction * MBasicSheetHeader::negativeAction (  )  const

Returns the negative action. There's not negative action by default, thus by default it returns 0 (null).

Returns:
the negative action.
QAction * MBasicSheetHeader::positiveAction (  )  const

Returns the positive action. There's not positive action by default, thus by default it returns 0 (null).

Returns:
the positive action.
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.

Parameters:
visible true will show it and false will hide it

Property Documentation

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