summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativepositioners.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativepositioners.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 8a9bdb3..e76fc03 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -609,6 +609,11 @@ void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate* >(QDeclarativeBasePositionerPrivate::get(this));
if (d->layoutDirection != layoutDirection) {
d->layoutDirection = layoutDirection;
+ // For RTL layout the positioning changes when the width changes.
+ if (d->layoutDirection == Qt::RightToLeft)
+ d->addItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ else
+ d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
prePositioning();
emit layoutDirectionChanged();
emit effectiveLayoutDirectionChanged();
@@ -907,6 +912,11 @@ void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
if (d->layoutDirection != layoutDirection) {
d->layoutDirection = layoutDirection;
+ // For RTL layout the positioning changes when the width changes.
+ if (d->layoutDirection == Qt::RightToLeft)
+ d->addItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ else
+ d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
prePositioning();
emit layoutDirectionChanged();
emit effectiveLayoutDirectionChanged();