summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2011-04-20 08:59:13 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2011-04-20 08:59:13 (GMT)
commit97d57498481598d0d4babfa77f816761dead29b8 (patch)
tree8709b1f70c8ad75e225acf476e827cf4e15b85f3 /src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
parent0edbaca5e7b718bb9bbbeaccc9e322b525b4327e (diff)
parent6037cb7f68fe0dec52f922d9e2f18c8e12a396cb (diff)
downloadQt-97d57498481598d0d4babfa77f816761dead29b8.zip
Qt-97d57498481598d0d4babfa77f816761dead29b8.tar.gz
Qt-97d57498481598d0d4babfa77f816761dead29b8.tar.bz2
Merge branch '4.7-upstream' into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepositioners_p_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index df105c6..e80129d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -75,7 +75,7 @@ public:
QDeclarativeBasePositionerPrivate()
: spacing(0), type(QDeclarativeBasePositioner::None)
, moveTransition(0), addTransition(0), queuedPositioning(false)
- , doingPositioning(false), anchorConflict(false)
+ , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight)
{
}
@@ -100,6 +100,9 @@ public:
bool doingPositioning : 1;
bool anchorConflict : 1;
+ Qt::LayoutDirection layoutDirection;
+
+
void schedulePositioning()
{
Q_Q(QDeclarativeBasePositioner);
@@ -109,6 +112,18 @@ public:
}
}
+ void mirrorChange() {
+ Q_Q(QDeclarativeBasePositioner);
+ if (type != QDeclarativeBasePositioner::Vertical)
+ q->prePositioning();
+ }
+ bool isLeftToRight() const {
+ if (type == QDeclarativeBasePositioner::Vertical)
+ return true;
+ else
+ return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight;
+ }
+
virtual void itemSiblingOrderChanged(QDeclarativeItem* other)
{
Q_UNUSED(other);
@@ -139,6 +154,19 @@ public:
Q_Q(QDeclarativeBasePositioner);
q->positionedItems.removeOne(QDeclarativeBasePositioner::PositionedItem(item));
}
+
+ static Qt::LayoutDirection getLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ return positioner->d_func()->layoutDirection;
+ }
+
+ static Qt::LayoutDirection getEffectiveLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ if (positioner->d_func()->effectiveLayoutMirror)
+ return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return positioner->d_func()->layoutDirection;
+ }
};
QT_END_NAMESPACE