diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-09-17 07:32:01 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-09-17 07:32:01 (GMT) |
commit | bec50e0b9cc1b536acc55776328152ceece65efe (patch) | |
tree | 7a5f46104ab32ccd1ca216891d3eebde64f46a49 /src/declarative/fx/qfxitem.cpp | |
parent | 1fae0c607b17f1ed528cac5601c3c8d97a3db658 (diff) | |
parent | ab1efc682631663a301d479d564d9e16bbc8984b (diff) | |
download | Qt-bec50e0b9cc1b536acc55776328152ceece65efe.zip Qt-bec50e0b9cc1b536acc55776328152ceece65efe.tar.gz Qt-bec50e0b9cc1b536acc55776328152ceece65efe.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfxitem.cpp')
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 3eec955..5fbd816 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -2581,7 +2581,7 @@ bool QFxItem::sceneEvent(QEvent *event) if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) { - activeFocusChanged(hasActiveFocus()); + focusChanged(hasFocus()); } return rv; @@ -2694,9 +2694,23 @@ void QFxItem::setWidth(qreal w) QRectF(x(), y(), oldWidth, height())); } +void QFxItem::resetWidth() +{ + Q_D(QFxItem); + d->widthValid = false; + setImplicitWidth(implicitWidth()); +} + +qreal QFxItem::implicitWidth() const +{ + Q_D(const QFxItem); + return d->implicitWidth; +} + void QFxItem::setImplicitWidth(qreal w) { Q_D(QFxItem); + d->implicitWidth = w; if (d->width == w || widthValid()) return; @@ -2739,9 +2753,23 @@ void QFxItem::setHeight(qreal h) QRectF(x(), y(), width(), oldHeight)); } +void QFxItem::resetHeight() +{ + Q_D(QFxItem); + d->heightValid = false; + setImplicitHeight(implicitHeight()); +} + +qreal QFxItem::implicitHeight() const +{ + Q_D(const QFxItem); + return d->implicitHeight; +} + void QFxItem::setImplicitHeight(qreal h) { Q_D(QFxItem); + d->implicitHeight = h; if (d->height == h || heightValid()) return; @@ -2762,39 +2790,33 @@ bool QFxItem::heightValid() const } /*! - \qmlproperty bool Item::focus - This property indicates whether the item has has an active focus request. Set this - property to true to request active focus. -*/ + \qmlproperty bool Item::wantsFocus -bool QFxItem::hasFocus() const -{ - Q_D(const QFxItem); - return d->itemIsFocusedInScope; -} - -void QFxItem::setFocus(bool focus) -{ - if (focus) QGraphicsItem::setFocus(Qt::OtherFocusReason); - else QGraphicsItem::clearFocus(); -} - -void QFxItemPrivate::focusedInScopeChanged() + This property indicates whether the item has has an active focus request. +*/ +bool QFxItem::wantsFocus() const { - Q_Q(QFxItem); - q->focusChanged(q->hasFocus()); + return focusItem() != 0; } /*! - \qmlproperty bool Item::activeFocus - This property indicates whether the item has the active focus. + \qmlproperty bool Item::focus + This property indicates whether the item has keyboard input focus. Set this + property to true to request focus. */ - -bool QFxItem::hasActiveFocus() const +bool QFxItem::hasFocus() const { return QGraphicsItem::hasFocus(); } +void QFxItem::setFocus(bool focus) +{ + if (focus) + QGraphicsItem::setFocus(Qt::OtherFocusReason); + else + QGraphicsItem::clearFocus(); +} + /*! \reimp */ |