diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-23 08:51:25 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-23 08:51:25 (GMT) |
commit | be7edc40324bb135548888853df28bf94eb2aa79 (patch) | |
tree | 0ed8e4a9085a2100311530d494acba7385c3eb3a /src/declarative/util/qdeclarativeview.cpp | |
parent | 3124d14be27766ddf3c86528c913165e09317111 (diff) | |
parent | 9df05c922fc0408489cb93ae67e187b717599254 (diff) | |
download | Qt-be7edc40324bb135548888853df28bf94eb2aa79.zip Qt-be7edc40324bb135548888853df28bf94eb2aa79.tar.gz Qt-be7edc40324bb135548888853df28bf94eb2aa79.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (42 commits)
Update QtDeclarative def files
Fix crash in MouseArea
Compile
Fixes undeleted timers (and endless warning from the event loop about
Remove unneeded member variable.
Fix test.
Generalize qml "registration"
Fix compiler warning
Fix TextInput echoMode autotest on Linux
Reuse QML lexer to simplify .pragma script logic
Fix TextEdit text attribute and text stored in the internal QTextDocument having different contents
Remove QDeclarativeItem::childrenChanged() signal overload
Update QtGui and QtDeclarative def files
Make rootContext and engine pointers in QDeclarativeView API const
Add additional QVariant benchmarks.
Allow MouseArea dragging to filter mouse events from descendants
Expand QDeclarativeExtensionPlugin docs
Add missing snippet files
Expand QtObject doc
Indicate default values
...
Diffstat (limited to 'src/declarative/util/qdeclarativeview.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 496f2ad..7546a50 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -132,7 +132,7 @@ class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarative public: QDeclarativeViewPrivate() : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {} - ~QDeclarativeViewPrivate() { delete root; } + ~QDeclarativeViewPrivate() { delete root; delete engine; } void execute(); void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry); void initResize(); @@ -145,7 +145,7 @@ public: QUrl source; - QDeclarativeEngine engine; + QDeclarativeEngine* engine; QDeclarativeComponent *component; QBasicTimer resizetimer; @@ -170,7 +170,7 @@ void QDeclarativeViewPrivate::execute() component = 0; } if (!source.isEmpty()) { - component = new QDeclarativeComponent(&engine, source, q); + component = new QDeclarativeComponent(engine, source, q); if (!component->isLoading()) { q->continueExecute(); } else { @@ -275,6 +275,7 @@ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent) void QDeclarativeViewPrivate::init() { Q_Q(QDeclarativeView); + engine = new QDeclarativeEngine(); q->setScene(&scene); q->setOptimizationFlags(QGraphicsView::DontSavePainterState); @@ -338,10 +339,10 @@ QUrl QDeclarativeView::source() const Returns a pointer to the QDeclarativeEngine used for instantiating QML Components. */ -QDeclarativeEngine* QDeclarativeView::engine() +QDeclarativeEngine* QDeclarativeView::engine() const { - Q_D(QDeclarativeView); - return &d->engine; + Q_D(const QDeclarativeView); + return d->engine; } /*! @@ -351,10 +352,10 @@ QDeclarativeEngine* QDeclarativeView::engine() arranged hierarchically and this hierarchy is managed by the QDeclarativeEngine. */ -QDeclarativeContext* QDeclarativeView::rootContext() +QDeclarativeContext* QDeclarativeView::rootContext() const { - Q_D(QDeclarativeView); - return d->engine.rootContext(); + Q_D(const QDeclarativeView); + return d->engine->rootContext(); } /*! |