summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-04-01 00:36:49 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-04-01 01:23:34 (GMT)
commit1f38d41854fa2daa51d938a4eb398752b1751e0b (patch)
tree0f8cb5b1e7982258098c782c3674c435f39bdd14 /src/declarative/graphicsitems
parent1ff7c423308feeaa73e1eab6e20147f5c3d2ccd3 (diff)
downloadQt-1f38d41854fa2daa51d938a4eb398752b1751e0b.zip
Qt-1f38d41854fa2daa51d938a4eb398752b1751e0b.tar.gz
Qt-1f38d41854fa2daa51d938a4eb398752b1751e0b.tar.bz2
Changing width of RTL positioner doesn't relayout
If the width of the layout changes then the items must be laid out again. Change-Id: I2b97bd45d07842fd3da2a0637391473ed6d78aa8 Task-number: QTBUG-18501 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems')
-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();