summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-04-24 04:29:57 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-04-24 04:29:57 (GMT)
commit8493c181e19c9cd49ea71baac1fcda54d37dae94 (patch)
tree2bd364cc217883754b8b42f064205cf31bb1eb75 /src/declarative/util
parent0c5f0baa59ae56749707c9f73754132cd9b4a44d (diff)
downloadQt-8493c181e19c9cd49ea71baac1fcda54d37dae94.zip
Qt-8493c181e19c9cd49ea71baac1fcda54d37dae94.tar.gz
Qt-8493c181e19c9cd49ea71baac1fcda54d37dae94.tar.bz2
Propagate scene geometry changes to view.
Previously, only the initial size was honoured.
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qfxview.cpp10
-rw-r--r--src/declarative/util/qfxview.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp
index a8b8eea..993d5cb 100644
--- a/src/declarative/util/qfxview.cpp
+++ b/src/declarative/util/qfxview.cpp
@@ -228,7 +228,9 @@ void QFxView::continueExecute()
QPerformanceLog::displayData();
QPerformanceLog::clear();
d->root = item;
- emit sceneResized(QSize(item->width(), item->height()));
+ connect(item, SIGNAL(widthChanged()), this, SLOT(sizeChanged()));
+ connect(item, SIGNAL(heightChanged()), this, SLOT(sizeChanged()));
+ sizeChanged();
} else if(QWidget *wid = qobject_cast<QWidget *>(obj)) {
window()->setAttribute(Qt::WA_OpaquePaintEvent, false);
window()->setAttribute(Qt::WA_NoSystemBackground, false);
@@ -246,6 +248,12 @@ void QFxView::continueExecute()
}
}
+void QFxView::sizeChanged()
+{
+ if (d->root)
+ emit sceneResized(QSize(d->root->width(),d->root->height()));
+}
+
QFxItem* QFxView::addItem(const QString &xml, QFxItem* parent)
{
if(!d->root)
diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h
index b5592b8..3c4be20 100644
--- a/src/declarative/util/qfxview.h
+++ b/src/declarative/util/qfxview.h
@@ -89,6 +89,7 @@ Q_SIGNALS:
private Q_SLOTS:
void continueExecute();
+ void sizeChanged();
protected:
virtual void resizeEvent(QResizeEvent *);