Home · All Classes · Main Classes · Deprecated |
MWindow is the base class for all MeeGo Touch UI windows. More...
Inherits QGraphicsView.
Inherited by MApplicationWindow.
MWindow is the base class for all MeeGo Touch UI windows.
An MWindow is completely empty by default. For developing an application conforming to the MeeGo Touch UI style, use MApplicationWindow instead.
MWindow is a QGraphicsView widget that visualizes the contents of the application scene. The key differences compared to the standard QGraphicsView is:
Example: Showing scene windows on MWindow.
MApplication app; MWindow window; MSceneWindow *sceneWindow = new MMessageBox("Hello World!"); window.show(); sceneWindow->appear(&window); app.exec();
MWindow::MWindow | ( | QWidget * | parent = 0 |
) | [explicit] |
Creates a MWindow without a scene manager.
parent is passed to QGraphicsView's constructor.
By default MWindow doesn't create a scene manager. It can be assigned later by calling setSceneManager(). Also, a default scene manager will be automatically created as needed unless explicitly set whenever any scene management is required (adding a managed class like MDialog to the application).
MWindow::MWindow | ( | MSceneManager * | sceneManager, | |
QWidget * | parent = 0 | |||
) | [explicit] |
MWindow::~MWindow | ( | ) | [virtual] |
Destructs the MWindow object.
If a scene manager is associated with the window, it is destroyed as well.
bool MWindow::closeOnLazyShutdown | ( | ) | const |
Returns true if window closes on lazy shutdown.
void MWindow::disableNotificationPreviews | ( | ) | [slot] |
Prevents notification preview banners from appearing over this window. Equal to calling setNotificationPreviewsVisible(false).
void MWindow::displayEntered | ( | ) | [signal] |
This signal is emitted when:
Calling show() will emit displayEntered() when the window becomes visible.
void MWindow::displayExited | ( | ) | [signal] |
A signal that is emitted when:
Calling close() will immediately emit displayExited().
void MWindow::enableNotificationPreviews | ( | ) | [slot] |
Allows notification preview banners to appear over this window. Equal to calling setNotificationPreviewsVisible(true).
void MWindow::enterDisplayEvent | ( | ) | [protected, virtual] |
A handler that is called just before displayEntered() is emitted.
void MWindow::exitDisplayEvent | ( | ) | [protected, virtual] |
A handler that is called just before displayExited() is emitted.
qreal MWindow::globalAlpha | ( | ) |
Returns the global alpha of the hardware graphics overlay for use by this window.
bool MWindow::isInSwitcher | ( | ) | const |
Returns true if the window is currently minimized to the switcher. It doesn't matter whether the window is visible or not in the switcher.
bool MWindow::isOnDisplay | ( | ) | const |
Returns true if user can see the window. This is different from QWidget::isVisible(), which is always explicitly set in the application. QWidget::isVisible() doesn't know if the window is e.g. covered by an opaque window and cannot be seen.
bool MWindow::isOrientationAngleLocked | ( | ) | const |
Returns true if the window orientation angle is not allowed to change when device orientation changes.
The default value is false.
bool MWindow::isOrientationLocked | ( | ) | const |
Returns true if the window orientation is not allowed to change when device orientation changes.
The default value is false.
bool MWindow::isRoundedCornersEnabled | ( | ) | const |
Returns whether the window has/draws rounded corners.
void MWindow::lockOrientation | ( | ) | [slot] |
Locks window's orientation changes. Equal to calling setOrientationLocked(true).
void MWindow::lockOrientationAngle | ( | ) | [slot] |
Locks window's orientation angle changes. Equal to calling setOrientationAngleLocked(true).
bool MWindow::notificationPreviewsVisible | ( | ) | const |
Returns true if application notification preview banners are shown over this window
The value is true by default.
void MWindow::onDisplayChangeEvent | ( | MOnDisplayChangeEvent * | event | ) | [protected, virtual] |
This event handler allows a window to notify subscribers about changes in its presence on the display. enterDisplayEvent() and exitDisplayEvent() convenience handlers are called by the default implementation. MOnDisplayChangeEvent is sent e.g. if the window gets obscured by another window.
M::Orientation MWindow::orientation | ( | ) | const |
Returns the current orientation of the window's scene.
M::OrientationAngle MWindow::orientationAngle | ( | ) | const |
Returns the current orientation angle of the window's scene.
void MWindow::orientationAngleChanged | ( | M::OrientationAngle | ) | [signal] |
Emitted after the scene geometry has changed during rotation.
This is for widgets that need to react when the orientation is about to change, and is emitted after the scene geometry has changed and the rotation animation is about to start.
void MWindow::orientationChanged | ( | M::Orientation | ) | [signal] |
Emitted after scene geometry has changed for a rotation.
This is for widgets that need to react when the orientation is about to change, and is emitted after the scene geometry has changed and the rotation animation is about to start.
void MWindow::orientationChangeFinished | ( | M::Orientation | ) | [signal] |
This signal is emitted when the rotation animation (if any) has finished. It's emitted in tandem with MSceneManager::orientationChangeFinished().
If window doesn't have the scene manager, this signal is emitted together with orientationChanged().
MScene * MWindow::scene | ( | ) |
Returns the window's MScene.
Reimplemented from QGraphicsView.
MSceneManager * MWindow::sceneManager | ( | ) |
Returns the scene manager of the window. A scene manager will be automatically created if none was previously set.
The scene manager is responsible for positioning, animating and generally managing MSceneWindows such as MDialog and MApplicationPage inside the window's scene.
MSceneManager * MWindow::sceneManager | ( | ) | const |
Returns the scene manager of the window, or 0 if not set.
The scene manager is responsible for positioning, animating and generally managing MSceneWindows such as MDialog and MApplicationPage inside the window's scene.
void MWindow::setCloseOnLazyShutdown | ( | bool | enable | ) |
Allows to force close instead of hide during lazy shutdown.
void MWindow::setGlobalAlpha | ( | qreal | level | ) |
Sets the global alpha of the hardware graphics overlay for use by this window.
Global alpha is used when you want to blend the contents of this window, which is rendering to the graphics overlay with the video overlay. This can be used to draw translucent controls on top of video, for example.
By default, each MWindow does not enable the global alpha. When this window is destroyed or hidden, the system will revert the global alpha back to its previous state.
Platform notes:
level | The valid range of global alpha can be 1.0 (completely opaque) to 0.0 (completely transparent). |
void MWindow::setLandscapeOrientation | ( | ) | [slot] |
Sets the orientation of the window to landscape.
This is a convenience function that sets the current orientation angle to 0 if it is not already in a landscape orientation (either 0 or 180 degrees angle).
If the window is hidden or it hasn't been shown yet, the orientation change is immediate (i.e. without an rotation animation), otherwise there may be an animated transition.
void MWindow::setNotificationPreviewsVisible | ( | bool | visible | ) |
Controls whether notification preview banners are shown on top of the window.
void MWindow::setOrientationAngle | ( | M::OrientationAngle | angle | ) | [slot] |
Sets the orientation angle of the window.
If the window is hidden or it hasn't been shown yet, the orientation angle change is immediate (i.e. without an rotation animation), otherwise there may be an animated transition.
void MWindow::setOrientationAngleLocked | ( | bool | locked | ) |
Controls whether the window orientation angle follows the device orientation.
If you require your window to be displayed only in a certain orientation angle, set the desired angle using setOrientationAngle() and set this property to true.
Note: Locking the orientation is discouraged by the MeeGo Touch UI application style guidelines.
Example of locking the window orientation angle:
MApplication app; MWindow window; // Forces an orientation angle. window.setOrientationAngle(M::Angle270); window.setOrientationAngleLocked(true); window.show(); return app.exec();
void MWindow::setOrientationLocked | ( | bool | locked | ) |
Controls whether the window orientation follows the device orientation.
If you require your window to be displayed only in a certain orientation, set the desired angle using setOrientationAngle() and set this property to true.
Note: Locking the orientation is discouraged by the MeeGo TouchUI application style guidelines.
Example of locking the window orientation:
MApplication app; MWindow window; // Forces the orientation to be portrait window.setPortraitOrientation(); window.setOrientationLocked(true); window.show(); return app.exec();
void MWindow::setPortraitOrientation | ( | ) | [slot] |
Sets the orientation of the window to portrait.
This is a convenience function that sets the current orientation angle to 270 if it is not already in a portrait orientation (either 90 or 270 degrees angle).
If the window is hidden or it hasn't been shown yet, the orientation change is immediate (i.e. without an rotation animation), otherwise there may be an animated transition.
void MWindow::setRoundedCornersEnabled | ( | bool | enabled | ) |
Sets whether the window should have/draw rounded corners.
void MWindow::setSceneManager | ( | MSceneManager * | sceneManager | ) |
Assigns a scene manager to the window.
The existing scene manager (if any) will be deleted and replaced by sceneManager. The new sceneManager can be 0.
MWindow will take ownership of the given scene manager.
void MWindow::setTranslucentBackground | ( | bool | enabled | ) |
Sets the translucency of the window.
Background translucency is disabled by default.
Having a translucent background means that any window behind it will show through the parts not otherwise filled by the application, for example by widgets.
Calling this method is costly when invoking it after showing the window as it involves recreating the window's viewport. This method usually should be called only once, before showing the window.
Platform notes:
void MWindow::setVideoGlobalAlpha | ( | qreal | level | ) |
Sets the alpha of the hardware video overlay for use by this window.
Video alpha is the is used to control the dimming of the video overlay where hardware accelerated video is rendering.
By default, each MWindow does not enable the video alpha. When this window is destroyed or hidden, the system will revert the video alpha back to its previous state.
Platform notes:
level | The valid range of video alpha can be 1.0 (completely opaque) to 0.0 (completely transparent) |
void MWindow::switcherEntered | ( | ) | [signal] |
This signal is emitted when the window has entered the task switcer.
void MWindow::switcherExited | ( | ) | [signal] |
This signal is emitted when the window has exited the task switcer.
void MWindow::unlockOrientation | ( | ) | [slot] |
Unlocks window's orientation changes. Equal to calling setOrientationLocked(false).
void MWindow::unlockOrientationAngle | ( | ) | [slot] |
Unlocks window's orientation angle changes. Equal to calling setOrientationAngleLocked(false).
qreal MWindow::videoGlobalAlpha | ( | ) |
Returns the alpha of the hardware video overlay for use by this window.
QSize MWindow::visibleSceneSize | ( | ) | const |
Returns the visible size of the window (being also the size of its scene).
QSize MWindow::visibleSceneSize | ( | M::Orientation | orientation | ) | const |
Returns the visible size of the window (being also the size of its scene) for the given orientation.
MWindow::globalAlpha [read, write] |
The global alpha of the hardware graphics overlay for use by this window.
MWindow::notificationPreviewsVisible [read, write] |
Are notification preview banners shown on top of the window.
MWindow::orientationAngleLocked [read, write] |
Is the orientation angle locked
MWindow::orientationLocked [read, write] |
Is the orientation locked
MWindow::roundedCornersEnabled [read, write] |
This property defines whether the window should have rounded corners.
By default this property is false.
Get its current value with isRoundedCornersEnabled() and set it with setRoundedCornersEnabled();
MWindow::videoGlobalAlpha [read, write] |
The global alpha of the hardware video overlay for use by this window.
Copyright © 2010 Nokia Corporation | MeeGo Touch |