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

MButtonView Class Reference

View class for standard push buttons. More...

Inherits MWidgetView.

Inherited by MButtonIconView, MButtonSwitchView, MButtonTabView, and MCheckboxView.

List of all members.

Public Member Functions

 MButtonView (MButton *controller)
virtual ~MButtonView ()

Protected Member Functions

virtual void drawIcon (QPainter *painter, const QRectF &iconRect) const

Detailed Description

View class for standard push buttons.

Overview

push_button.png
push_button_down.png

MButtonView is used to visualize push buttons and toggle buttons. The view draws a fixed background and an icon, text or both on top of it. If the view is for a checkable button, it uses a different background and different text color for the checked state.

The outlook of button can be changed using the styling attributes defined in MButtonStyle and MWidgetStyle. MWidgetStyle::backgroundImage, MWidgetStyle::backgroundColor and MWidgetStyle::backgroundOpacity can be used to change appearance of the button itself. If background image is not defined then the background is drawn with solid color. The icon and text position and outlook can be changed through MButtonStyle. Following rules apply:

A button can be in one of the following functional states:

Interactions

The Push Button does not support long press functionality, so it makes no difference how long the button is held down. If user presses a button and drags while it is in a pannable area, then button follows the finger and tactile feedback is cancel. When releasing the finger after panning, the button interaction is not activated.

Open issues

See also:
MButton MButtonView MButtonStyle

Constructor & Destructor Documentation

MButtonView::MButtonView ( MButton controller  ) 

Constructs the view.

Parameters:
Pointer to the controller.
MButtonView::~MButtonView (  )  [virtual]

Destructs the view.


Member Function Documentation

void MButtonView::drawIcon ( QPainter painter,
const QRectF iconRect 
) const [protected, virtual]

Draws the button icon (toggled or normal depending on the state of the button) into the given iconRect.


Copyright © 2010 Nokia Corporation
MeeGo Touch