summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmlview.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-26 05:41:51 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-26 05:41:51 (GMT)
commit91be655a7e893d34fdbdb71aa5a329b641c80992 (patch)
tree44fb2b8bb3040d709b85e366f7660f532caabd98 /src/declarative/util/qmlview.cpp
parentde3b541e40d9fdb01bc46f472c6032e2a9f45c95 (diff)
downloadQt-91be655a7e893d34fdbdb71aa5a329b641c80992.zip
Qt-91be655a7e893d34fdbdb71aa5a329b641c80992.tar.gz
Qt-91be655a7e893d34fdbdb71aa5a329b641c80992.tar.bz2
Fix "initial" size for remote content.
Diffstat (limited to 'src/declarative/util/qmlview.cpp')
-rw-r--r--src/declarative/util/qmlview.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp
index 14f8279..f91d0db 100644
--- a/src/declarative/util/qmlview.cpp
+++ b/src/declarative/util/qmlview.cpp
@@ -360,6 +360,8 @@ void QmlView::continueExecute()
emit sceneResized(sz);
resize(sz);
}
+ updateGeometry();
+ emit initialSize(d->initialSize);
} else if (QWidget *wid = qobject_cast<QWidget *>(obj)) {
window()->setAttribute(Qt::WA_OpaquePaintEvent, false);
window()->setAttribute(Qt::WA_NoSystemBackground, false);
@@ -374,6 +376,7 @@ void QmlView::continueExecute()
}
layout()->addWidget(wid);
emit sceneResized(wid->size());
+ emit initialSize(wid->size());
}
}
}
@@ -382,6 +385,10 @@ void QmlView::continueExecute()
This signal is emitted when the view is resized to \a size.
*/
+/*! \fn void QmlView::initialSize(QSize size)
+ This signal is emitted when the initial size of the root item is known.
+ */
+
/*! \fn void QmlView::errors(const QList<QmlError> &errors)
This signal is emitted when the qml loaded contains \a errors.
*/
@@ -425,7 +432,10 @@ void QmlView::timerEvent(QTimerEvent* e)
automatically resize the root item.
Regardless of this property, the sizeHint of the view
- is the initial size of the root item.
+ is the initial size of the root item. Note though that
+ since QML may load dynamically, that size may change.
+
+ \sa initialSize()
*/
void QmlView::setContentResizable(bool on)