diff options
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/qfxgridview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfximage.h | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 46 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.h | 10 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem_p.h | 6 | ||||
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 8 |
7 files changed, 11 insertions, 64 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 4512b46..f3a43e2 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -358,7 +358,7 @@ FxGridItem *QFxGridViewPrivate::createItem(int modelIndex) listItem->index = modelIndex; // complete model->completeItem(); - listItem->item->setZ(modelIndex + 1); + listItem->item->setZValue(modelIndex + 1); listItem->item->setParent(q->viewport()); } requestedIndex = 0; diff --git a/src/declarative/fx/qfximage.h b/src/declarative/fx/qfximage.h index 9c0dde8..4b6e700 100644 --- a/src/declarative/fx/qfximage.h +++ b/src/declarative/fx/qfximage.h @@ -43,6 +43,7 @@ #define QFXIMAGE_H #include <QtDeclarative/qfxitem.h> +#include <QtDeclarative/qfxscalegrid.h> #include <QtNetwork/qnetworkreply.h> diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index d229eab..34af32a 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -1068,34 +1068,6 @@ void QFxItem::keyReleaseEvent(QKeyEvent *event) */ /*! - \property QFxItem::id - This property holds the identifier for the item. - - The identifier can be used in bindings and other expressions to - refer to the item. For example: - - \qml - Text { id: myText; ... } - Text { text: myText.text } - \endqml - - The identifier is available throughout the \l {components}{component} - where it is declared. The identifier must be unique in thecomponent. -*/ -QString QFxItem::id() const -{ - Q_D(const QFxItem); - return d->_id; -} - -void QFxItem::setId(const QString &id) -{ - Q_D(QFxItem); - setObjectName(id); - d->_id = id; -} - -/*! \internal */ QFxAnchorLine QFxItem::left() const @@ -2017,24 +1989,6 @@ QPointF QFxItem::transformOriginPoint() const return d->transformOrigin(); } -qreal QFxItem::z() const -{ - return zValue(); -} - -void QFxItem::setZ(qreal z) -{ - if (z == this->z()) - return; - - if (z < 0) - setFlag(QGraphicsItem::ItemStacksBehindParent, true); - else - setFlag(QGraphicsItem::ItemStacksBehindParent, false); - - setZValue(z); -} - qreal QFxItem::width() const { Q_D(const QFxItem); diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index 0dcf852..e3f371e 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -48,9 +48,7 @@ #include <QtDeclarative/qfxanchors.h> #include <QtDeclarative/qfxglobal.h> #include <QtDeclarative/qml.h> -#include <QtDeclarative/qfxscalegrid.h> #include <QtDeclarative/qmlcomponent.h> -#include <QtDeclarative/qmlstate.h> #include <QtGui/qgraphicsitem.h> #include <QtGui/qfont.h> @@ -100,7 +98,6 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QGraphicsObject, public QmlParserSta Q_INTERFACES(QmlParserStatus) Q_PROPERTY(QFxItem * parent READ itemParent WRITE setItemParent NOTIFY parentChanged DESIGNABLE false FINAL) - Q_PROPERTY(QString id READ id WRITE setId) // ### remove Q_PROPERTY(QmlList<QFxItem *>* children READ children DESIGNABLE false) Q_PROPERTY(QmlList<QObject *>* resources READ resources DESIGNABLE false) Q_PROPERTY(QFxAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL) @@ -111,7 +108,6 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QGraphicsObject, public QmlParserSta Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(QUrl qml READ qml WRITE setQml NOTIFY qmlChanged) // ### name? Move to own class? Q_PROPERTY(QFxItem *qmlItem READ qmlItem NOTIFY qmlChanged) // ### see above - Q_PROPERTY(qreal z READ z WRITE setZ FINAL) // ### use method in QGO Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL) Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL) Q_PROPERTY(QFxAnchorLine left READ left CONSTANT FINAL) @@ -160,9 +156,6 @@ public: QFxItem *parentItem() const; void setItemParent(QFxItem *parent); // ## setParentItem - QString id() const; // ### remove me - void setId(const QString &); - QmlList<QObject *> *data(); QmlList<QFxItem *> *children(); QmlList<QObject *> *resources(); @@ -208,9 +201,6 @@ public: Options options() const; void setOptions(Options, bool set = true); - qreal z() const; - void setZ(qreal); - qreal width() const; void setWidth(qreal); void setImplicitWidth(qreal); diff --git a/src/declarative/fx/qfxitem_p.h b/src/declarative/fx/qfxitem_p.h index 1615ad8..029b8b0 100644 --- a/src/declarative/fx/qfxitem_p.h +++ b/src/declarative/fx/qfxitem_p.h @@ -54,6 +54,7 @@ // #include <QtDeclarative/qfxitem.h> +#include <QtDeclarative/qmlstate.h> #include <private/qmlnullablevalue_p.h> #include <QtDeclarative/qml.h> #include <QtDeclarative/qmlcontext.h> @@ -93,8 +94,9 @@ public: q->setItemParent(parent); _baselineOffset.invalidate(); q->setAcceptedMouseButtons(Qt::NoButton); - q->setFlag(QGraphicsItem::ItemHasNoContents, true); - q->setFlag(QGraphicsItem::ItemIsFocusable, true); + q->setFlags(QGraphicsItem::ItemHasNoContents | + QGraphicsItem::ItemIsFocusable | + QGraphicsItem::ItemNegativeZStacksBehindParent); mouseSetsFocus = false; } diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 9c07d6f..54e46cf 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -423,7 +423,7 @@ FxListItem *QFxListViewPrivate::createItem(int modelIndex) } // complete model->completeItem(); - listItem->item->setZ(modelIndex + 1); + listItem->item->setZValue(modelIndex + 1); listItem->item->setParent(q->viewport()); if (orient == Qt::Vertical) QObject::connect(listItem->item, SIGNAL(heightChanged()), q, SLOT(itemResized())); diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 396aed3..1d4e278 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -581,7 +581,7 @@ void QFxPathViewPrivate::regenerate() return; } items.append(item); - item->setZ(i); + item->setZValue(i); } q->refill(); } @@ -639,7 +639,7 @@ void QFxPathView::refill() d->firstIndex %= d->model->count(); int index = (d->firstIndex + d->items.count())%d->model->count(); d->items << d->getItem(index); - d->items.last()->setZ(wrapIndex); + d->items.last()->setZValue(wrapIndex); d->pathOffset++; d->pathOffset=d->pathOffset % d->items.count(); } @@ -652,7 +652,7 @@ void QFxPathView::refill() if (d->firstIndex < 0) d->firstIndex = d->model->count() - 1; d->items.prepend(d->getItem(d->firstIndex)); - d->items.first()->setZ(d->firstIndex); + d->items.first()->setZValue(d->firstIndex); d->pathOffset--; if (d->pathOffset < 0) d->pathOffset = d->items.count() - 1; @@ -675,7 +675,7 @@ void QFxPathView::itemsInserted(int modelIndex, int count) if (d->pathItems == -1) { for (int i = 0; i < count; ++i) { QFxItem *item = d->getItem(modelIndex + i); - item->setZ(modelIndex + i); + item->setZValue(modelIndex + i); d->items.insert(modelIndex + i, item); } refill(); |