Home · All Classes · Main Classes · Deprecated |
Inherits QGraphicsWidget.
Inherited by MWidgetController.
This enum contains possible values of a mouse event cancel policy.
MWidget::MWidget | ( | QGraphicsItem * | parent = 0 |
) |
MWidget::~MWidget | ( | ) | [virtual] |
MWidget::MWidget | ( | MWidgetPrivate & | dd, | |
QGraphicsItem * | parent | |||
) | [protected] |
void MWidget::actionEvent | ( | QActionEvent * | ) | [protected, virtual] |
void MWidget::cancelEvent | ( | MCancelEvent * | event | ) | [protected, virtual] |
This event handler is designed to allow widgets to cancel the effect of previously received event. One example of that behavior is a situation when the user starts to pan the view and the mousePress event that was sent when the user touched the screen needs to be cancelled.
Reimplemented in MWidgetController.
void MWidget::clearActions | ( | ) | [virtual, slot] |
Removes all the actions from the widget's action list. Note: actions are not deleted after removal from the list. To clear and delete the actions from the widget, following procedure is proposed: QList<QAction*> actions = widget->actions(); widget->clearActions(); qDeleteAll(actions);
void MWidget::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to process context menu events. The event parameter contains details about the event to be handled.
Reimplemented in MList.
void MWidget::displayEntered | ( | ) | [signal] |
A signal that is emitted when:
Note!: the stacking order of widgets is not taken into account
Changing opacity from 0 to greater value doesn't cause this signal to be emitted. If widget has opacity 0 it will not emit this signal when entering display.
void MWidget::displayExited | ( | ) | [signal] |
A signal that is emitted when:
Note!: the stacking order of widgets is not taken into account
Changing opacity to from a value > 0 to 0 doesn't cause this signal to be emitted. If widget has opacity 0 it will not emit this signal when exiting display.
void MWidget::enterDisplayEvent | ( | ) | [protected, virtual] |
A handler that is called just before displayEntered() is emitted.
Due to undocumented QT behaviour QTBUG-18267, widgets with opacity 0 are treated as if isVisible == false, so they don't receive any events. To work around this, set opacity to 0.001 instead of 0.
void MWidget::exitDisplayEvent | ( | ) | [protected, virtual] |
A handler that is called just before displayExited() is emitted.
Due to undocumented QT behaviour QTBUG-18267, widgets with opacity 0 are treated as if isVisible == false, so they don't receive any events. To work around this, set opacity to 0.001 instead of 0.
void MWidget::gestureEvent | ( | QGestureEvent * | event | ) | [protected, virtual] |
This event handler is designed to allow widgets to react to the gesture events. Reimplement it to make your widget sensitive to custom made gestures.
Default implementation handles gestures used by M library. Please remember to call MWidget::gestureEvent() if this method is overriden.
void MWidget::grabGestureWithCancelPolicy | ( | Qt::GestureType | type, | |
Qt::GestureFlags | flags = Qt::GestureFlags() , |
|||
MouseEventCancelPolicy | cancelPolicy = MouseEventNoCancel | |||
) |
Subscribes the widget to gestures events of a specific type. Allows definition of cancel event handling policy for that gesture.
The meegotouch library can send cancel event to the current mouse grabber and stop processing mouse events. This allows the UI to react to situation when the user starts a gesture on top of interactive elements like buttons. In a typical example, the user starts panning gesture over a button, which will initially reach the pressed state. Then the user moves his finger and the button will then be moved back to un-pressed state, without triggering actions connected to it. Internally, the button will receive a cancel event and it will not receive the release event.
This method is an overloaded version of grabGesture defined in QGraphicsWidget which introduces cancelPolicy argument. It can be used to define the reaction to started or finished gesture when it reaches the object of the MWidget.
bool MWidget::isOnDisplay | ( | ) | const |
Checks whether the widget might be seen on the display.
Returning true means that:
Note that it does not guarantee, however, that the widget actually is being shown on the display. There could be, for instance, some opaque QGraphicsItem on top of it (along the z axis) blocking it from getting rendered on the viewport.
Returning false means that currently this widget cannot be seen on the display in any way. E.g.: If the widget happens to be out of sight of all the QGraphicsViews that are rendering his scene.
Its computational cost is significantly higher than that of a simple attribute getter such as isVisible().
bool MWidget::isSelected | ( | ) | const |
Returns true
if widget is selected otherwise false
.
void MWidget::onDisplayChangeEvent | ( | MOnDisplayChangeEvent * | event | ) | [protected, virtual] |
This event handler allows a widget to notify subscribers (and its children) about changes in its presence on the display. enterDisplayEvent() and exitDisplayEvent() convenience handlers are called by the default implementation. MOnDisplayChangeEvent may be sent e.g. if the widget gets panned out of display, the widget is explicitly hidden/shown or the window gets obscured by another window.
void MWidget::orientationChangeEvent | ( | MOrientationChangeEvent * | event | ) | [protected, virtual] |
This event handler is designed to allow widgets to react to the orientation change. Reimplement it to make your widget sensitive to orientation changes. Default implementation does nothing.
Reimplemented in MWidgetController.
QPointF MWidget::paintOffset | ( | ) | const |
Returns the offset by which the widget will be transformed when painted.
This convenience function is equivalent to querying the horizontal and vertical translation factors of the widgets's transform().
void MWidget::panGestureEvent | ( | QGestureEvent * | event, | |
QPanGesture * | gesture | |||
) | [protected, virtual] |
This event handler is designed to allow widgets to react to the pan gesture event. Default implementation does nothing.
Gesture events are ignored by default. If you want to specifically accept a gesture state, you need to call QGestureEvent::accept(QGesture*) or similar.
Reimplemented in MWidgetController.
void MWidget::pinchGestureEvent | ( | QGestureEvent * | event, | |
QPinchGesture * | gesture | |||
) | [protected, virtual] |
This event handler is designed to allow widgets to react to the pinch gesture event. Default implementation does nothing.
Gesture events are ignored by default. If you want to specifically accept a gesture state, you need to call QGestureEvent::accept(QGesture*) or similar.
Reimplemented in MWidgetController.
void MWidget::retranslateUi | ( | ) | [protected, virtual] |
This virtual function is called when this widget received a QEvent::LanguageChange event.
Reimplement this function in your own widgets to retranslate user-visible strings.
MSceneManager * MWidget::sceneManager | ( | ) | const |
Returns a pointer to the scene manager that manages the widget. If the widget's scene doesn't have a scene manager, returns a null pointer.
void MWidget::setPaintOffset | ( | const QPointF & | offset | ) |
Sets the offset by which the widget will be transformed when painted.
This convenience function is equivalent to calling setTransform on the widget, supplying a QTransform that shifts the widget by offset.
The paint offset allows for a widget to appear as if in a position different than that of the widget's pos() property. This allows for example to animate the widget's apparent location using a QPropertyAnimation without affecting layouting or the layout affecting the animation.
void MWidget::swipeGestureEvent | ( | QGestureEvent * | event, | |
QSwipeGesture * | gesture | |||
) | [protected, virtual] |
This event handler is designed to allow widgets to react to the swipe gesture event. Default implementation does nothing.
Gesture events are ignored by default. If you want to specifically accept a gesture state, you need to call QGestureEvent::accept(QGesture*) or similar.
Reimplemented in MWidgetController.
void MWidget::tapAndHoldGestureEvent | ( | QGestureEvent * | event, | |
QTapAndHoldGesture * | gesture | |||
) | [protected, virtual] |
This event handler is designed to allow widgets to react to the tap&hold gesture event. Default implementation does nothing.
Gesture events are ignored by default. If you want to specifically accept a gesture state, you need to call QGestureEvent::accept(QGesture*) or similar.
Reimplemented in MWidgetController.
void MWidget::tapGestureEvent | ( | QGestureEvent * | event, | |
QTapGesture * | gesture | |||
) | [protected, virtual] |
This event handler is designed to allow widgets to react to the tap gesture event. Default implementation does nothing.
Gesture events are ignored by default. If you want to specifically accept a gesture state, you need to call QGestureEvent::accept(QGesture*) or similar.
Reimplemented in MWidgetController.
MWidgetPrivate* const MWidget::d_ptr [protected] |
Reimplemented in MExtensionArea.
bool MWidget::onDisplay [read] |
QPointF MWidget::paintOffset [read, write] |
bool MWidget::selected [read, write] |
QSizePolicy MWidget::sizePolicy [read, write] |
Copyright © 2010 Nokia Corporation | MeeGo Touch |