| Home · All Classes · Main Classes · Deprecated |
A MContainer is a generic container which can be used for any MWidgets. More...


Public Slots | |
| void | setHeaderVisible (const bool visibility) |
| void | setProgressIndicatorVisible (bool visibility) |
| void | toggleHeaderVisible () |
| void | toggleProgressIndicatorVisible () |
| void | setTitle (const QString &title) |
| void | setIconID (const QString &iconID) |
| void | setText (const QString &text) |
Signals | |
| void | headerClicked () |
Public Member Functions | |
| MContainer (QGraphicsItem *parent=0) | |
| MContainer (const QString &title, QGraphicsItem *parent=0) | |
| virtual | ~MContainer () |
| QGraphicsWidget * | centralWidget () |
| void | setCentralWidget (QGraphicsWidget *centralWidget, bool destroy=true) |
| QString | title () const |
| QString | text () const |
| QString | iconID () const |
| bool | headerVisible () const |
| bool | isProgressIndicatorVisible () const |
Properties | |
| QGraphicsWidget | centralWidget |
| QString | title |
| QString | text |
| QString | iconID |
| bool | headerVisible |
| bool | progressIndicatorVisible |
A MContainer is a generic container which can be used for any MWidgets.
Containers are used in settings views as well as building blocks for native and WRT (web run time) applets in Experience Canvases.
Example:
MContainer *box = new MContainer(); box->setTitle("Header"); box->setText("More..."); box->setIconID("My-Icon-ID"); // Create a button ... MButton *button = new MButton("Hello container"); // and set it as the centralWidget box->setCentralWidget(button); // clicking the button hides the header QObject::connect(button, SIGNAL(clicked()), box, SLOT(toggleHeaderVisible()));
Containers can be used for building applets or in application views. They may contain a layout of multiple widgets. Container consist of the content placement box and an optional header, which contains the label and an optional additional label. The header row can be tappable or non-tappable. Containers for web-runtime (WRT) applets don't have a header. If the header row is tappable, the label might be used. It is also recommended to show the number of all items in the additional label. Containers and Applets keep their functionality independent of the device orientation.
For special cases there is an option to have "number of new items / number of all items" in the additional label.
The content placement box is the area where the content is drawn by the native / WRT applet. In case the container is not used for an applet, other UI Controls are drawn in the area. The header is as wide as its container. The user can decide if the container has a sub view, in which case it will be themed differently. Titles can be either text, an icon or both of them. This is set by the application or the applet, as well as their values. If not, the title is empty. If the title is too long it will be truncated. The application/applet also defines the usage of the additional label and its content. If it doesn't specify it, it will be empty. The additional label truncates.
Definition at line 89 of file corelib/widgets/mcontainer.h.
| MContainer::MContainer | ( | QGraphicsItem * | parent = 0 |
) |
Constructs a container with no title and a parent.
Definition at line 48 of file mcontainer.cpp.
: MWidgetController(new MContainerPrivate(), new MContainerModel(), parent) { Q_D(MContainer); d->init(); }
| MContainer::MContainer | ( | const QString & | title, | |
| QGraphicsItem * | parent = 0 | |||
| ) |
Constructs a container with the title title and parent parent.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 56 of file mcontainer.cpp.
: MWidgetController(new MContainerPrivate(), new MContainerModel(), parent) { Q_D(MContainer); d->init(title); }
| MContainer::~MContainer | ( | ) | [virtual] |
| QGraphicsWidget* MContainer::centralWidget | ( | ) |
Returns the widget which is the 'container area'.
| void MContainer::headerClicked | ( | ) | [signal] |
Signal for informing that the header of the container was clicked.
| bool MContainer::headerVisible | ( | ) | const |
Returns the logical ID of the icon.
| QString MContainer::iconID | ( | ) | const |
Returns the logical ID of the icon.
| bool MContainer::isProgressIndicatorVisible | ( | ) | const |
Returns if the progress indicator is shown.
Definition at line 133 of file mcontainer.cpp.
{
return model()->progressIndicatorVisible();
}

| void MContainer::setCentralWidget | ( | QGraphicsWidget * | centralWidget, | |
| bool | destroy = true | |||
| ) |
Sets the central widget for container.
Definition at line 73 of file mcontainer.cpp.
{
if (centralWidget != NULL) {
const QGraphicsWidget *oldCentralWidget = model()->centralWidget();
// Set the new central widget
model()->setCentralWidget(centralWidget);
// Destroy the old central widget if requested
if (destroy) {
delete oldCentralWidget;
}
}
}

| void MContainer::setHeaderVisible | ( | const bool | visibility | ) | [slot] |
Sets the header visibility.
| visibility | new visibility state for header |
Definition at line 123 of file mcontainer.cpp.
{
model()->setHeaderVisible(visibility);
}

| void MContainer::setIconID | ( | const QString & | iconID | ) | [slot] |
Sets the logical ID of the icon.
| iconID | New icon for the container |
Definition at line 113 of file mcontainer.cpp.
{
model()->setIcon(iconID);
}

| void MContainer::setProgressIndicatorVisible | ( | bool | visibility | ) | [slot] |
Sets the progress indicator visibility.
| visibility | new visibility state for progressindicator true for visible, false for hidden |
Definition at line 138 of file mcontainer.cpp.
{
model()->setProgressIndicatorVisible(visibility);
}

| void MContainer::setText | ( | const QString & | text | ) | [slot] |
Set the text of container.
| text | New text for the container |
Definition at line 103 of file mcontainer.cpp.
{
model()->setText(text);
}

| void MContainer::setTitle | ( | const QString & | title | ) | [slot] |
Set the title of container.
| title | New title for the container |
Definition at line 93 of file mcontainer.cpp.
{
model()->setTitle(newTitle);
}

| QString MContainer::text | ( | ) | const |
Returns the text of the container.
| QString MContainer::title | ( | ) | const |
Returns the title of the container.
| void MContainer::toggleHeaderVisible | ( | ) | [slot] |
Toggle the header visibility.
Definition at line 128 of file mcontainer.cpp.
{
setHeaderVisible(!model()->headerVisible());
}

| void MContainer::toggleProgressIndicatorVisible | ( | ) | [slot] |
Toggles the progress indicator visibility.
Definition at line 143 of file mcontainer.cpp.

QGraphicsWidget * MContainer::centralWidget [read, write] |
Current widget in the container.
Definition at line 95 of file corelib/widgets/mcontainer.h.
bool MContainer::headerVisible [read, write] |
Header visible or not.
Definition at line 107 of file corelib/widgets/mcontainer.h.
QString MContainer::iconID [read, write] |
Icon in the header.
Definition at line 104 of file corelib/widgets/mcontainer.h.
bool MContainer::progressIndicatorVisible [read, write] |
Progress indicator visible or not.
Definition at line 110 of file corelib/widgets/mcontainer.h.
QString MContainer::text [read, write] |
Text in the header.
Definition at line 101 of file corelib/widgets/mcontainer.h.
QString MContainer::title [read, write] |
Title of the container.
Definition at line 98 of file corelib/widgets/mcontainer.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:24 (PDT) Doxygen 1.7.1 |
MeeGo Touch |