| Home · All Classes · Main Classes · Deprecated |
MWidgetView provides an abstract base class for MVC views. More...


Public Member Functions | |
| virtual const char * | styleType () const |
| MWidgetView () | |
| MWidgetView (MWidgetController *controller) | |
| virtual | ~MWidgetView () |
| void | show () |
| void | hide () |
| void | destroy () |
| virtual void | setActive (bool active) |
| void | setModel (MWidgetModel *model) |
| virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
| virtual void | setGeometry (const QRectF &rect) |
| virtual QPainterPath | shape () const |
| virtual QRectF | boundingRect () const |
| virtual void | resizeEvent (QGraphicsSceneResizeEvent *event) |
| virtual void | changeEvent (QEvent *event) |
| qreal | effectiveOpacity () const |
| qreal | opacity () const |
| qreal | scale () const |
| void | setOpacity (qreal opacity) |
| void | setScale (qreal scale) |
| virtual QFont | font () const |
Static Public Member Functions | |
| static const char * | staticStyleType () |
Protected Slots | |
| virtual void | updateData (const QList< const char * > &modifications) |
| void | updateMicroFocus () |
Protected Member Functions | |
| virtual MWidgetStyleContainer * | createStyleContainer () const |
| virtual QSizeF | sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const |
| virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
| virtual bool | sceneEventFilter (QGraphicsItem *watched, QEvent *event) |
| void | update (const QRectF &rect=QRectF()) |
| void | update (qreal x, qreal y, qreal width, qreal height) |
| void | updateGeometry () |
| QRectF | geometry () const |
| QSizeF | size () const |
| QPointF | pos () const |
| QRectF | rect () const |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| virtual void | cancelEvent (MCancelEvent *event) |
| virtual void | orientationChangeEvent (MOrientationChangeEvent *event) |
| virtual void | tapAndHoldGestureEvent (QGestureEvent *event, QTapAndHoldGesture *gesture) |
| virtual void | panGestureEvent (QGestureEvent *event, QPanGesture *gesture) |
| virtual void | pinchGestureEvent (QGestureEvent *event, QPinchGesture *gesture) |
| virtual void | tapGestureEvent (QGestureEvent *event, QTapGesture *gesture) |
| virtual void | swipeGestureEvent (QGestureEvent *event, QSwipeGesture *gesture) |
| QRect | margins () const |
| int | marginLeft () const |
| int | marginTop () const |
| int | marginRight () const |
| int | marginBottom () const |
| QRect | reactiveMargins () const |
| int | reactiveMarginLeft () const |
| int | reactiveMarginTop () const |
| int | reactiveMarginRight () const |
| int | reactiveMarginBottom () const |
| virtual void | notifyItemChange (QGraphicsItem::GraphicsItemChange change, const QVariant &value) |
| virtual void | drawBackground (QPainter *painter, const QStyleOptionGraphicsItem *option) const |
| virtual void | drawContents (QPainter *painter, const QStyleOptionGraphicsItem *option) const |
| virtual void | drawForeground (QPainter *painter, const QStyleOptionGraphicsItem *option) const |
| virtual void | setupModel () |
| virtual void | applyStyle () |
| MWidgetModel * | model () |
| const MWidgetModel * | model () const |
| MWidgetStyleContainer & | style () |
| const MWidgetStyleContainer & | style () const |
| MWidgetView (MWidgetViewPrivate *dd) | |
| MWidgetView (MWidgetViewPrivate &dd, MWidgetController *controller) | |
Protected Attributes | |
| MWidgetViewPrivate *const | d_ptr |
MWidgetView provides an abstract base class for MVC views.
MWidgetView provides an abstract base class from which widgets using MVC pattern can inherit their views
Definition at line 74 of file corelib/widgets/core/mwidgetview.h.
| MWidgetView::MWidgetView | ( | ) |
Constructor for the view.
Definition at line 104 of file mwidgetview.cpp.
:
d_ptr(new MWidgetViewPrivate)
{
Q_D(MWidgetView);
d->q_ptr = this;
}
| MWidgetView::MWidgetView | ( | MWidgetController * | controller | ) |
Definition at line 118 of file mwidgetview.cpp.
:
d_ptr(new MWidgetViewPrivate)
{
// old way, we shouldn't need controller in the view side.
Q_D(MWidgetView);
d->q_ptr = this;
d->controller = controller;
}
| MWidgetView::~MWidgetView | ( | ) | [virtual] |
Destructor for the view.
Definition at line 136 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->model->decreaseReferenceCount();
d->model = 0;
delete d->styleContainer;
delete d_ptr;
}
| MWidgetView::MWidgetView | ( | MWidgetViewPrivate * | dd | ) | [protected] |
Definition at line 111 of file mwidgetview.cpp.
:
d_ptr(dd)
{
Q_D(MWidgetView);
d->q_ptr = this;
}
| MWidgetView::MWidgetView | ( | MWidgetViewPrivate & | dd, | |
| MWidgetController * | controller | |||
| ) | [protected] |
Definition at line 127 of file mwidgetview.cpp.
:
d_ptr(&dd)
{
// old way, we shouldn't need controller in the view side.
Q_D(MWidgetView);
d->q_ptr = this;
d->controller = controller;
}
| void MWidgetView::applyStyle | ( | ) | [protected, virtual] |
Notification for derived classes. This method gets called when a new style is applied for this view. This happens e.g. when the object is constructed, when a new object name is given to the widget, or when the layout direction changes.
Reimplemented in MMessageBoxView, MSliderView, and MSpinnerView.
Definition at line 258 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
if (d->controller->layoutDirection() == Qt::RightToLeft)
d->controller->setContentsMargins(
style()->paddingRight() + style()->marginRight(),
style()->paddingTop() + style()->marginTop(),
style()->paddingLeft() + style()->marginLeft(),
style()->paddingBottom() + style()->marginBottom());
else
d->controller->setContentsMargins(
style()->paddingLeft() + style()->marginLeft(),
style()->paddingTop() + style()->marginTop(),
style()->paddingRight() + style()->marginRight(),
style()->paddingBottom() + style()->marginBottom());
updateGeometry();
update();
}

| QRectF MWidgetView::boundingRect | ( | ) | const [virtual] |
| void MWidgetView::cancelEvent | ( | MCancelEvent * | event | ) | [protected, virtual] |
This event handler is designed to allow widgets to cancel the previously received mousePress event. This situation occurs, 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 MSliderView.
Definition at line 442 of file mwidgetview.cpp.
{
style()->cancelFeedback().play();
Q_UNUSED(event);
}

| void MWidgetView::changeEvent | ( | QEvent * | event | ) | [virtual] |
Definition at line 540 of file mwidgetview.cpp.
{
// styles can depend on right-to-left e.g. left and right margins
// get switched.
if (event->type() == QEvent::LayoutDirectionChange)
applyStyle();
}

| virtual MWidgetStyleContainer* MWidgetView::createStyleContainer | ( | ) | const [inline, protected, virtual] |
Definition at line 89 of file corelib/widgets/core/mwidgetview.h.
{
return new MWidgetStyleContainer();
}
| void MWidgetView::destroy | ( | ) |
Definition at line 146 of file mwidgetview.cpp.
{
// TODO: animate away
/*
deleteLater(); // Use deleteLater() for QObjects instead of "delete this"
*/
// TODO: replace this with something when there's a better solution available.
// deleteLater() breaks theme change.
delete this;
}
| void MWidgetView::drawBackground | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option | |||
| ) | const [protected, virtual] |
Draws the background for this view.
Definition at line 628 of file mwidgetview.cpp.
{
Q_UNUSED(option);
QSizeF currentSize = size();
if (currentSize.width() == 0 || currentSize.height() == 0)
return;
qreal oldOpacity = painter->opacity();
painter->setOpacity(style()->backgroundOpacity() * effectiveOpacity());
if (style()->backgroundTiles().isValid()) {
style()->backgroundTiles()[model()->layoutPosition()]->draw(0,0, currentSize.width(), currentSize.height(), painter);
}
else if (style()->backgroundImage()) {
style()->backgroundImage()->draw(0, 0, currentSize.width(), currentSize.height(), painter);
} else if (style()->backgroundColor().isValid()) {
painter->fillRect(boundingRect(), QBrush(style()->backgroundColor()));
}
painter->setOpacity(oldOpacity);
}

| void MWidgetView::drawContents | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option | |||
| ) | const [protected, virtual] |
Draws the contents for this view.
Reimplemented in MSpinnerView.
Definition at line 650 of file mwidgetview.cpp.
{
Q_UNUSED(painter);
Q_UNUSED(option);
}
| void MWidgetView::drawForeground | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option | |||
| ) | const [protected, virtual] |
Draws the foreground for this view.
Definition at line 656 of file mwidgetview.cpp.
{
Q_UNUSED(painter);
Q_UNUSED(option);
}
| qreal MWidgetView::effectiveOpacity | ( | ) | const |
Definition at line 560 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->controller->effectiveOpacity();
}
| QFont MWidgetView::font | ( | ) | const [virtual] |
| QRectF MWidgetView::geometry | ( | ) | const [protected] |
Definition at line 503 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
QRectF controllerGeom = d->controller->geometry();
return QRectF(controllerGeom.topLeft() + QPointF(marginLeft(), marginTop()),
controllerGeom.bottomRight() - QPointF(marginRight(), marginBottom()));
}

| void MWidgetView::hide | ( | ) |
Definition at line 554 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->hide();
}
| QVariant MWidgetView::inputMethodQuery | ( | Qt::InputMethodQuery | query | ) | const [protected, virtual] |
Definition at line 528 of file mwidgetview.cpp.
{
Q_UNUSED(query);
return QVariant();
}
| int MWidgetView::marginBottom | ( | ) | const [protected] |
Returns bottom margin in pixels. This margin can be defined in css.
Definition at line 327 of file mwidgetview.cpp.
{
return style()->marginBottom();
}

| int MWidgetView::marginLeft | ( | ) | const [protected] |
Returns left margin in pixels. This margin can be defined in css.
Definition at line 312 of file mwidgetview.cpp.
{
return style()->marginLeft();
}

| int MWidgetView::marginRight | ( | ) | const [protected] |
Returns right margin in pixels. This margin can be defined in css.
Definition at line 322 of file mwidgetview.cpp.
{
return style()->marginRight();
}

| QRect MWidgetView::margins | ( | ) | const [protected] |
Returns margins in pixels. These margins can be defined in css.
Definition at line 303 of file mwidgetview.cpp.
{
const MWidgetStyle *s = static_cast<const MWidgetStyle*>(style().operator->());
return QRect(s->marginLeft(),
s->marginTop(),
s->marginRight(),
s->marginBottom());
}

| int MWidgetView::marginTop | ( | ) | const [protected] |
Returns top margin in pixels. This margin can be defined in css.
Definition at line 317 of file mwidgetview.cpp.
{
return style()->marginTop();
}

| MWidgetModel * MWidgetView::model | ( | ) | [protected] |
Returns model of the widget. This method should be used only by the M_VIEW macro.
Definition at line 279 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
return d->model;
}
| const MWidgetModel * MWidgetView::model | ( | ) | const [protected] |
Definition at line 285 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->model;
}
| void MWidgetView::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
| void MWidgetView::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
Reimplemented in MBubbleItemView, MLabelView, and MSliderView.
Definition at line 378 of file mwidgetview.cpp.
{
style()->pressFeedback().play();
// Ignore the event by default so it will propagate to widgets below
event->ignore();
}

| void MWidgetView::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected, virtual] |
Reimplemented in MBubbleItemView, MLabelView, and MSliderView.
Definition at line 386 of file mwidgetview.cpp.
{
style()->releaseFeedback().play();
// Ignore the event by default so it will propagate to widgets below
event->ignore();
}

| void MWidgetView::notifyItemChange | ( | QGraphicsItem::GraphicsItemChange | change, | |
| const QVariant & | value | |||
| ) | [protected, virtual] |
This is called from MWidgetController to notify that some part of the item's state has changed or will change. It is a read-only version of the QGraphicsWidget::itemChanged
The default implementation is to set the styleMode to "disabled" when an item becomes disabled, and to set the styleMode to "selected" when the item becomes selected. Reimplement this function to change this default behaviour or to react to other changes.
Definition at line 414 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
if (change == QGraphicsItem::ItemEnabledHasChanged) {
d->setEnabled(d->controller->isEnabled());
} else if (change == QGraphicsItem::ItemSelectedHasChanged) {
if (d->controller->isEnabled()) {
d->setSelected(d->controller->isSelected());
}
} else if (change == QGraphicsItem::ItemParentHasChanged) {
MWidgetController *parent = NULL;
QGraphicsItem *p = d->controller->parentItem();
while (p && !(parent = dynamic_cast<MWidgetController *>(p))) {
p = p->parentItem();
}
style().setParent(parent);
if (value.value<QGraphicsItem*>() != NULL) {
d->reloadChildItemsStyles(d->controller);
applyStyle();
}
}
}

| qreal MWidgetView::opacity | ( | ) | const |
Definition at line 566 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->controller->opacity();
}
| void MWidgetView::orientationChangeEvent | ( | MOrientationChangeEvent * | event | ) | [protected, virtual] |
This event handler is designed to allow widgets to react to the orientation change.
Definition at line 449 of file mwidgetview.cpp.
{
Q_UNUSED(event);
applyStyle();
}

| void MWidgetView::paint | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| QWidget * | widget = 0 | |||
| ) | [virtual] |
Do not reimplement this method in derived classes.
Definition at line 610 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
Q_UNUSED(widget);
int horizontalMargin = 0;
if (d->controller->layoutDirection() == Qt::LeftToRight)
horizontalMargin = marginLeft();
else
horizontalMargin = marginRight();
painter->translate(horizontalMargin, marginTop());
drawBackground(painter, option);
drawContents(painter, option);
painter->translate(-horizontalMargin, -marginTop());
drawForeground(painter, option);
}

| void MWidgetView::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.
Definition at line 460 of file mwidgetview.cpp.
{
event->ignore(gesture);
}
| void MWidgetView::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.
Definition at line 465 of file mwidgetview.cpp.
{
event->ignore(gesture);
}
| QPointF MWidgetView::pos | ( | ) | const [protected] |
Definition at line 517 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->controller->pos() + QPointF(marginLeft(), marginTop());
}

| int MWidgetView::reactiveMarginBottom | ( | ) | const [protected] |
Returns bottom reactive margin in pixels. This margin can be defined in css.
Definition at line 356 of file mwidgetview.cpp.
{
return style()->reactiveMarginBottom();
}

| int MWidgetView::reactiveMarginLeft | ( | ) | const [protected] |
Returns left reactive margin in pixels. This margin can be defined in css.
Definition at line 341 of file mwidgetview.cpp.
{
return style()->reactiveMarginLeft();
}

| int MWidgetView::reactiveMarginRight | ( | ) | const [protected] |
Returns right reactive margin in pixels. This margin can be defined in css.
Definition at line 351 of file mwidgetview.cpp.
{
return style()->reactiveMarginRight();
}

| QRect MWidgetView::reactiveMargins | ( | ) | const [protected] |
Returns reactive margins in pixels. These margins can be defined in css.
Definition at line 332 of file mwidgetview.cpp.
{
const MWidgetStyle *s = static_cast<const MWidgetStyle*>(style().operator->());
return QRect(s->reactiveMarginLeft(),
s->reactiveMarginTop(),
s->reactiveMarginRight(),
s->reactiveMarginBottom());
}

| int MWidgetView::reactiveMarginTop | ( | ) | const [protected] |
Returns top reactive margin in pixels. This margin can be defined in css.
Definition at line 346 of file mwidgetview.cpp.
{
return style()->reactiveMarginTop();
}

| QRectF MWidgetView::rect | ( | ) | const [protected] |
| void MWidgetView::resizeEvent | ( | QGraphicsSceneResizeEvent * | event | ) | [virtual] |
Definition at line 534 of file mwidgetview.cpp.
{
Q_UNUSED(event);
}
| qreal MWidgetView::scale | ( | ) | const |
Definition at line 572 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->controller->scale();
}
| bool MWidgetView::sceneEventFilter | ( | QGraphicsItem * | watched, | |
| QEvent * | event | |||
| ) | [protected, virtual] |
Definition at line 596 of file mwidgetview.cpp.
{
Q_UNUSED(watched);
Q_UNUSED(event);
return false; //by default, don't catch the event. Allow it to continue to propagate
}
| void MWidgetView::setActive | ( | bool | active | ) | [virtual] |
Sets this widget view into active / inactive mode. Active mode of a widget view follows the active mode of the widget it is applied to. Derived classes can override this method to add custom behaviour when active mode is enabled or disabled.
| active | Indicates whether active mode is set on or off. |
Definition at line 157 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->setActive(active);
}
| void MWidgetView::setGeometry | ( | const QRectF & | rect | ) | [virtual] |
Definition at line 480 of file mwidgetview.cpp.
{
Q_UNUSED(rect);
}
| void MWidgetView::setModel | ( | MWidgetModel * | model | ) |
Sets a new model for this view. This method notifies derived classes by calling setupModel()
Definition at line 164 of file mwidgetview.cpp.
{
Q_ASSERT(model);
Q_D(MWidgetView);
if (model == d->model)
return;
if (d->model) {
disconnect(d->model, 0, this, 0);
d->model->decreaseReferenceCount();
}
d->model = model;
d->model->increaseReferenceCount();
if (!d->styleContainer) {
d->styleContainer = createStyleContainer();
}
MWidgetController *parent = NULL;
QGraphicsItem *p = d->controller->parentItem();
while (p && !(parent = dynamic_cast<MWidgetController *>(p))) {
p = p->parentItem();
}
//The default style type is "", not "default".
QString styleType = d->model->viewType();
if (styleType == MWidgetController::defaultType)
styleType.clear();
QString styleName;
if (d->model->styleName().isNull())
styleName = d->model->objectName(); // fallback to old behavior
else
styleName = d->model->styleName();
d->styleContainer->initialize(styleName, styleType, parent);
if (d->controller->isActive()) {
setActive(true);
} else if (!d->controller->isEnabled()) {
notifyItemChange(QGraphicsItem::ItemEnabledHasChanged, false);
} else if (d->controller->isSelected()) {
notifyItemChange(QGraphicsItem::ItemSelectedHasChanged, true);
}
// TODO: to be removed when scalable image is ready
applyStyle();
// notify derived classes
setupModel();
}

| void MWidgetView::setOpacity | ( | qreal | opacity | ) |
Definition at line 584 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->setOpacity(opacity);
}
| void MWidgetView::setScale | ( | qreal | scale | ) |
Definition at line 590 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->setScale(scale);
}
| void MWidgetView::setupModel | ( | ) | [protected, virtual] |
Notification for derived classes. This method gets called when a new model is applied for this view. This happens when MWidgetView::setModel() is called.
Reimplemented in MSliderView, and MSpinnerView.
Definition at line 249 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
connect(d->model, SIGNAL(modified(QList<const char *>)),
this, SLOT(updateData(QList<const char *>)));
update();
}

| QPainterPath MWidgetView::shape | ( | ) | const [virtual] |
Definition at line 366 of file mwidgetview.cpp.
{
QPainterPath path;
QRectF br = boundingRect();
br.setRect(br.x() - reactiveMarginLeft(),
br.y() - reactiveMarginTop(),
br.width() + marginLeft() + marginRight() + reactiveMarginLeft() + reactiveMarginRight(),
br.height() + marginTop() + marginBottom() + reactiveMarginTop() + reactiveMarginBottom());
path.addRect(br);
return path;
}

| void MWidgetView::show | ( | ) |
Definition at line 548 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->show();
}
| QSizeF MWidgetView::size | ( | ) | const [protected] |
Definition at line 511 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return d->controller->size() - QSizeF(marginLeft() + marginRight(), marginTop() + marginBottom());
}

| QSizeF MWidgetView::sizeHint | ( | Qt::SizeHint | which, | |
| const QSizeF & | constraint = QSizeF() | |||
| ) | const [protected, virtual] |
Default sizeHint implementation for a view.
To determine the size of a widget in a layout, the layout uses the widget's QGraphicsLayoutItem::preferredSize() and its QGraphicsLayoutItem::sizePolicy() functions. The preferred size of a MWidgetController is determined from:
The sizes given from the first 3 steps are combined, in the order of preference as shown. If the height and/or width is not specified, then this function is called, with constraint set to the size determined so far. The result from the view is then combined with the constraint. Finally, if this size is still not valid, this is combined with QGraphicsWidget::sizeHint() which in turn uses the layouts sizeHint function.
The default implementation returns QSizeF(-1,-1) so that any layout attached to the controller is used instead.
If you reimplement this function and you use the constraint parameter to set the height of the widget depend on its width, you need to set controller's QGraphicsLayoutItem::sizePolicy() to have QSizePolicy::hasHeightForWidth().
Note: In order to create a widget that expands dynamically based on the contents inside the set layout, you should not reimplement this function, and should leave at least the height unspecified in the CSS. E.g. preferred-size: 200 -1;
Definition at line 603 of file mwidgetview.cpp.
{
Q_UNUSED(which);
Q_UNUSED(constraint);
return QSizeF(-1,-1);
}
| static const char* MWidgetView::staticStyleType | ( | ) | [inline, static] |
Definition at line 94 of file corelib/widgets/core/mwidgetview.h.
{
return "MWidgetStyle";
}
| MWidgetStyleContainer & MWidgetView::style | ( | ) | [protected] |
Returns style of the widget. This method should be used only by the M_VIEW macro.
Definition at line 291 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
return *d->styleContainer;
}
| const MWidgetStyleContainer & MWidgetView::style | ( | ) | const [protected] |
Definition at line 297 of file mwidgetview.cpp.
{
Q_D(const MWidgetView);
return *d->styleContainer;
}
| virtual const char* MWidgetView::styleType | ( | ) | const [inline, virtual] |
Definition at line 97 of file corelib/widgets/core/mwidgetview.h.
{
return "MWidgetStyle";
}
| void MWidgetView::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.
Definition at line 475 of file mwidgetview.cpp.
{
event->ignore(gesture);
}
| void MWidgetView::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.
Definition at line 455 of file mwidgetview.cpp.
{
event->ignore(gesture);
}
| void MWidgetView::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.
Definition at line 470 of file mwidgetview.cpp.
{
event->ignore(gesture);
}
| void MWidgetView::update | ( | qreal | x, | |
| qreal | y, | |||
| qreal | width, | |||
| qreal | height | |||
| ) | [protected] |
Definition at line 491 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->update(x, y, width, height);
}
Definition at line 485 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->update(rect);
}
| void MWidgetView::updateData | ( | const QList< const char * > & | modifications | ) | [protected, virtual, slot] |
Notification of model modifications. This method gets called when some members of the model has been modified.
Reimplemented in MBubbleItemView, MContentItemView, MMessageBoxView, MSliderView, and MSpinnerView.
Definition at line 218 of file mwidgetview.cpp.
{
const char *member;
foreach(member, modifications) {
if (member == MWidgetModel::ObjectName ||
member == MWidgetModel::StyleName) {
// style name has changed, we need to update the style
QString styleName(QString::null);
if (model()->styleName().isNull())
styleName = model()->objectName(); // fallback to old behavior
else
styleName = model()->styleName();
style().setObjectName(styleName);
// TODO: to be removed
applyStyle();
} else if (member == MWidgetModel::ViewType) {
style().setType(model()->viewType());
} else if (member == MWidgetModel::Position) {
}
}
}

| void MWidgetView::updateGeometry | ( | ) | [protected] |
Definition at line 497 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->updateGeometry();
}
| void MWidgetView::updateMicroFocus | ( | ) | [protected, slot] |
Updates the widget's micro focus (i.e. notifies input context). Similar to QWidget::updateMicroFocus.
Definition at line 241 of file mwidgetview.cpp.
{
Q_D(MWidgetView);
d->controller->updateMicroFocus();
}
MWidgetViewPrivate* const MWidgetView::d_ptr [protected] |
Reimplemented in MExtensionAreaView, MApplicationMenuView, MApplicationPageView, MBannerView, MDialogView, MEscapeButtonPanelView, MExtendingBackgroundView, MHomeButtonPanelView, MInfoBannerEventView, MInfoBannerInformationView, MMenuObjectView, MModalSceneWindowView, MObjectMenuView, MPannableWidgetView, MProgressIndicatorBarView, MSeparatorView, MSliderView, MSpinnerView, and MToolBarView.
Definition at line 377 of file corelib/widgets/core/mwidgetview.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:27 (PDT) Doxygen 1.7.1 |
MeeGo Touch |