diff options
-rw-r--r-- | src/corelib/global/qnamespace.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepositioners.cpp | 43 |
3 files changed, 28 insertions, 19 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 89a0c0b..1ef875f 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -146,7 +146,8 @@ public: NoButton = 0x00000000, LeftButton = 0x00000001, RightButton = 0x00000002, - MidButton = 0x00000004, + MidButton = 0x00000004, // ### Qt 5: remove me + MiddleButton = MidButton, XButton1 = 0x00000008, XButton2 = 0x00000010, MouseButtonMask = 0x000000ff diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f8f3c49..8f9902f 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -185,6 +185,7 @@ left-handed mice.) \value RightButton The right button. \value MidButton The middle button. + \value MiddleButton The middle button. \value XButton1 The first X button. \value XButton2 The second X button. diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 0f59a70..3391ac9 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -225,20 +225,21 @@ void QDeclarativeBasePositioner::prePositioning() d->watchChanges(child); positionedItems.append(posItem); item = &positionedItems[positionedItems.count()-1]; + item->isNew = true; + if (child->opacity() <= 0.0 || !child->isVisible()) + item->isVisible = false; } else { item = &oldItems[wIdx]; + if (child->opacity() <= 0.0 || !child->isVisible()) { + item->isVisible = false; + } else if (!item->isVisible) { + item->isVisible = true; + item->isNew = true; + } else { + item->isNew = false; + } positionedItems.append(*item); } - if (child->opacity() <= 0.0 || !child->isVisible()) { - item->isVisible = false; - continue; - } - if (!item->isVisible) { - item->isVisible = true; - item->isNew = true; - } else { - item->isNew = false; - } } doPositioning(); if(d->addTransition || d->moveTransition) @@ -261,11 +262,14 @@ void QDeclarativeBasePositioner::positionX(int x, const PositionedItem &target) { Q_D(QDeclarativeBasePositioner); if(d->type == Horizontal || d->type == Both){ - if(!d->addTransition && !d->moveTransition){ - target.item->setX(x); - }else{ - if(target.isNew) + if (target.isNew) { + if (!d->addTransition) + target.item->setX(x); + else d->addActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x)); + } else if (x != target.item->x()) { + if (!d->moveTransition) + target.item->setX(x); else d->moveActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x)); } @@ -276,11 +280,14 @@ void QDeclarativeBasePositioner::positionY(int y, const PositionedItem &target) { Q_D(QDeclarativeBasePositioner); if(d->type == Vertical || d->type == Both){ - if(!d->addTransition && !d->moveTransition){ - target.item->setY(y); - }else{ - if(target.isNew) + if (target.isNew) { + if (!d->addTransition) + target.item->setY(y); + else d->addActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y)); + } else if (y != target.item->y()) { + if (!d->moveTransition) + target.item->setY(y); else d->moveActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y)); } |