From ad2a9bd8f0c0b57e1e40f5f93af21c018ceac86e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 8 Dec 2009 11:14:18 +1000 Subject: Fix crash. --- src/gui/graphicsview/qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index bc47872..dd76f1c 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2181,7 +2181,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } // Enable subfocus - if (newVisible) { + if (scene && newVisible) { QGraphicsItem *p = parent; bool done = false; while (p) { -- cgit v0.12 From 8669c43cf65743efff36a005d433f5965ffe22f2 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 8 Dec 2009 11:43:06 +1000 Subject: Add barebones debugging documentation. --- doc/src/declarative/qmldebugging.qdoc | 71 +++++++++++++++++++++++++++++++++++ doc/src/declarative/qmli18n.qdoc | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 doc/src/declarative/qmldebugging.qdoc diff --git a/doc/src/declarative/qmldebugging.qdoc b/doc/src/declarative/qmldebugging.qdoc new file mode 100644 index 0000000..b5b58a6 --- /dev/null +++ b/doc/src/declarative/qmldebugging.qdoc @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\page qmldebugging.html +\title Debugging QML + +\section1 Logging + +console.log can be used to print debugging information to the console. For example: + +\qml +Rectangle { + width: 200; height: 200 + MouseRegion { + anchors.fill: parent + onClicked: console.log("clicked") + } +} +\endqml + +\section1 The QML Inspector + +qmldebugger provides an experimental inspector to aid with debugging. It can +be run as a Qt Creator plugin or as a standalone application. + +\section1 Debugging Transitions + +When a transition doesn't look quite right, it can be helpful to view it in slow +motion to see more clearly what is happening. \l {qmlviewer} provides a menu option +"Slow Down Animations" to facilitate this. + +*/ diff --git a/doc/src/declarative/qmli18n.qdoc b/doc/src/declarative/qmli18n.qdoc index 55ed3d7..4b62fcb 100644 --- a/doc/src/declarative/qmli18n.qdoc +++ b/doc/src/declarative/qmli18n.qdoc @@ -61,6 +61,6 @@ capabilities are described more fully in: \o \l {Qt Linguist Manual} \endlist -You can test a translation in qmlviewer using the -translation option. +You can test a translation in \l {qmlviewer} using the -translation option. */ -- cgit v0.12 From 3e1b7110c1161b740c32ed0ee390f7030e8208ed Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 8 Dec 2009 15:11:23 +1000 Subject: Fix leaks. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 2 ++ src/declarative/qml/qmlcompileddata.cpp | 3 +++ src/declarative/qml/qmlpropertycache.cpp | 1 - src/declarative/qml/qmlworkerscript.cpp | 1 + src/declarative/util/qmlanimation_p_p.h | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 7fb6454..135262c 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1256,6 +1256,8 @@ QmlGraphicsListView::~QmlGraphicsListView() d->clear(); if (d->ownModel) delete d->model; + delete d->header; + delete d->footer; } /*! diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qmlcompileddata.cpp index 8b165c6..198b574 100644 --- a/src/declarative/qml/qmlcompileddata.cpp +++ b/src/declarative/qml/qmlcompileddata.cpp @@ -176,6 +176,9 @@ QmlCompiledData::~QmlCompiledData() for (int ii = 0; ii < propertyCaches.count(); ++ii) propertyCaches.at(ii)->release(); + for (int ii = 0; ii < contextCaches.count(); ++ii) + contextCaches.at(ii)->release(); + if (importCache) importCache->release(); diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp index 7e3a1c4..bad8ad8 100644 --- a/src/declarative/qml/qmlpropertycache.cpp +++ b/src/declarative/qml/qmlpropertycache.cpp @@ -198,7 +198,6 @@ QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject cache->stringCache.insert(methodName, data); cache->identifierCache.insert(data->identifier.identifier, data); data->addref(); - data->addref(); } return cache; diff --git a/src/declarative/qml/qmlworkerscript.cpp b/src/declarative/qml/qmlworkerscript.cpp index 5c281bb..a0d6ef0 100644 --- a/src/declarative/qml/qmlworkerscript.cpp +++ b/src/declarative/qml/qmlworkerscript.cpp @@ -389,6 +389,7 @@ QmlWorkerScriptEngine::QmlWorkerScriptEngine(QObject *parent) QmlWorkerScriptEngine::~QmlWorkerScriptEngine() { + qDeleteAll(d->workers); delete d; d = 0; } diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h index fbd7114..2f911b4 100644 --- a/src/declarative/util/qmlanimation_p_p.h +++ b/src/declarative/util/qmlanimation_p_p.h @@ -102,6 +102,7 @@ public: QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped), running(false) {} QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0) : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped), running(false) {} + ~QActionAnimation() { if (policy == DeleteWhenStopped) { delete animAction; animAction = 0; } } virtual int duration() const { return 0; } void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p) { @@ -145,6 +146,7 @@ class QmlTimeLineValueAnimator : public QVariantAnimation Q_OBJECT public: QmlTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {} + ~QmlTimeLineValueAnimator() { if (policy == DeleteWhenStopped) { delete animValue; animValue = 0; } } void setAnimValue(QmlTimeLineValue *value, DeletionPolicy p) { if (state() == Running) -- cgit v0.12