From 21d4bd1c63053ec3f3e1f6733553de0d8c46e544 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 12 Oct 2012 11:42:34 +0200 Subject: We need to export QQmlVMEMetaObject to support the designer In the designer we need to access QQmlVMEMetaObject. Change-Id: I36627c6ce1c2c27bef8dd85374b65a542b00d1ef Reviewed-by: Aurindam Jana Reviewed-by: Christiaan Janssen --- src/qml/qml/qqmlvmemetaobject_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index c858370d27..c46989eb25 100644 --- a/src/qml/qml/qqmlvmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -157,7 +157,7 @@ class QV8QObjectWrapper; class QQmlVMEVariant; class QQmlRefCount; class QQmlVMEMetaObjectEndpoint; -class Q_AUTOTEST_EXPORT QQmlVMEMetaObject : public QAbstractDynamicMetaObject, +class Q_QML_PRIVATE_EXPORT QQmlVMEMetaObject : public QAbstractDynamicMetaObject, public QV8GCCallback::Node { public: -- cgit v1.2.3 From f36c55cd4724a8023ff34036b74c96982714f63a Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 15 Oct 2012 12:31:40 +0200 Subject: Adding DesignerWindowManager for Qt Quick Designer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DesignerWindowManager implements a render path just for Qt Quick Designer, which is single threaded and does not open visible windows. Change-Id: I02b0d1b819a7a5391b9bb14ee6efa1a32e0c8ad7 Reviewed-by: Samuel Rødal --- src/quick/designer/designer.pri | 6 +- src/quick/designer/designersupport.cpp | 23 ++++++ src/quick/designer/designersupport.h | 9 +- src/quick/designer/designerwindowmanager.cpp | 118 +++++++++++++++++++++++++++ src/quick/designer/designerwindowmanager_p.h | 107 ++++++++++++++++++++++++ src/quick/items/qquickwindowmanager.cpp | 20 +++-- src/quick/items/qquickwindowmanager_p.h | 4 + 7 files changed, 277 insertions(+), 10 deletions(-) create mode 100644 src/quick/designer/designerwindowmanager.cpp create mode 100644 src/quick/designer/designerwindowmanager_p.h diff --git a/src/quick/designer/designer.pri b/src/quick/designer/designer.pri index c523525977..9f3f7e8be6 100644 --- a/src/quick/designer/designer.pri +++ b/src/quick/designer/designer.pri @@ -1,2 +1,4 @@ -HEADERS += designer/designersupport.h -SOURCES += designer/designersupport.cpp +HEADERS += designer/designersupport.h \ + designer/designerwindowmanager_p.h +SOURCES += designer/designersupport.cpp \ + designer/designerwindowmanager.cpp diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp index c06e8f0579..78445d7179 100644 --- a/src/quick/designer/designersupport.cpp +++ b/src/quick/designer/designersupport.cpp @@ -46,9 +46,13 @@ #include #include #include +#include #include #include +#include "designerwindowmanager_p.h" + + QT_BEGIN_NAMESPACE DesignerSupport::DesignerSupport() @@ -119,6 +123,7 @@ QImage DesignerSupport::renderImageForItem(QQuickItem *referencedItem, const QRe return QImage(); renderTexture->setRect(boundingRect); renderTexture->setSize(imageSize); + renderTexture->markDirtyTexture(); renderTexture->updateTexture(); QImage renderImage = renderTexture->toImage(); @@ -138,6 +143,14 @@ bool DesignerSupport::isDirty(QQuickItem *referencedItem, DirtyType dirtyType) return QQuickItemPrivate::get(referencedItem)->dirtyAttributes & dirtyType; } +void DesignerSupport::addDirty(QQuickItem *referencedItem, DesignerSupport::DirtyType dirtyType) +{ + if (referencedItem == 0) + return; + + QQuickItemPrivate::get(referencedItem)->dirtyAttributes |= dirtyType; +} + void DesignerSupport::resetDirty(QQuickItem *referencedItem) { if (referencedItem == 0) @@ -410,4 +423,14 @@ void DesignerSupport::updateDirtyNode(QQuickItem *item) QQuickWindowPrivate::get(item->window())->updateDirtyNode(item); } +void DesignerSupport::activateDesignerWindowManager() +{ + QQuickWindowManager::setInstance(new DesignerWindowManager); +} + +void DesignerSupport::createOpenGLContext(QQuickWindow *window) +{ + DesignerWindowManager::createOpenGLContext(window); +} + QT_END_NAMESPACE diff --git a/src/quick/designer/designersupport.h b/src/quick/designer/designersupport.h index 54331fd008..e27cb3bcb3 100644 --- a/src/quick/designer/designersupport.h +++ b/src/quick/designer/designersupport.h @@ -70,6 +70,7 @@ class QTransform; class QQmlContext; class QQuickView; class QObject; +class QQuickWindow; class Q_QUICK_EXPORT DesignerSupport { @@ -99,7 +100,8 @@ public: TransformUpdateMask = TransformOrigin | Transform | BasicTransform | Position | Size | Window, ComplexTransformUpdateMask = Transform | Window, ContentUpdateMask = Size | Content | Smooth | Window, - ChildrenUpdateMask = ChildrenChanged | ChildrenStackingChanged | EffectReference | Window + ChildrenUpdateMask = ChildrenChanged | ChildrenStackingChanged | EffectReference | Window, + AllMask = TransformUpdateMask | ContentUpdateMask | ChildrenUpdateMask }; @@ -112,6 +114,7 @@ public: QImage renderImageForItem(QQuickItem *referencedItem, const QRectF &boundingRect, const QSize &imageSize); static bool isDirty(QQuickItem *referencedItem, DirtyType dirtyType); + static void addDirty(QQuickItem *referencedItem, DirtyType dirtyType); static void resetDirty(QQuickItem *referencedItem); static QTransform windowTransform(QQuickItem *referencedItem); @@ -141,6 +144,10 @@ public: static void updateDirtyNode(QQuickItem *item); + static void activateDesignerWindowManager(); + + static void createOpenGLContext(QQuickWindow *window); + private: QHash m_itemTextureHash; }; diff --git a/src/quick/designer/designerwindowmanager.cpp b/src/quick/designer/designerwindowmanager.cpp new file mode 100644 index 0000000000..fca9f5339b --- /dev/null +++ b/src/quick/designer/designerwindowmanager.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "designerwindowmanager_p.h" + +#include + +#include + + +QT_BEGIN_NAMESPACE + +DesignerWindowManager::DesignerWindowManager() + : m_sgContext(QSGContext::createDefaultContext()) +{ +} + +void DesignerWindowManager::show(QQuickWindow *window) +{ + makeOpenGLContext(window); +} + +void DesignerWindowManager::hide(QQuickWindow *) +{ +} + +void DesignerWindowManager::windowDestroyed(QQuickWindow *) +{ +} + +void DesignerWindowManager::makeOpenGLContext(QQuickWindow *window) +{ + if (!m_openGlContext) { + m_openGlContext.reset(new QOpenGLContext()); + m_openGlContext->setFormat(window->requestedFormat()); + m_openGlContext->create(); + if (!m_openGlContext->makeCurrent(window)) + qWarning("QQuickWindow: makeCurrent() failed..."); + m_sgContext->initialize(m_openGlContext.data()); + } else { + m_openGlContext->makeCurrent(window); + } +} + +void DesignerWindowManager::exposureChanged(QQuickWindow *) +{ +} + +QImage DesignerWindowManager::grab(QQuickWindow *) +{ + return QImage(); +} + +void DesignerWindowManager::resize(QQuickWindow *, const QSize &) +{ +} + +void DesignerWindowManager::maybeUpdate(QQuickWindow *) +{ +} + +QSGContext *DesignerWindowManager::sceneGraphContext() const +{ + return m_sgContext.data(); +} + +void DesignerWindowManager::createOpenGLContext(QQuickWindow *window) +{ + window->create(); + window->update(); +} + +void DesignerWindowManager::update(QQuickWindow *window) +{ + makeOpenGLContext(window); +} + +QT_END_NAMESPACE + + diff --git a/src/quick/designer/designerwindowmanager_p.h b/src/quick/designer/designerwindowmanager_p.h new file mode 100644 index 0000000000..222a93f90e --- /dev/null +++ b/src/quick/designer/designerwindowmanager_p.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DESIGNERWINDOWMANAGER_P_H +#define DESIGNERWINDOWMANAGER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QQuickWindow; +class QSGContext; +class QAnimationDriver; +class QOpenGLContext; + +class DesignerWindowManager : public QObject, public QQuickWindowManager +{ + Q_OBJECT +public: + DesignerWindowManager(); + + void show(QQuickWindow *window); + void hide(QQuickWindow *window); + + void windowDestroyed(QQuickWindow *window); + + void makeOpenGLContext(QQuickWindow *window); + void exposureChanged(QQuickWindow *window); + QImage grab(QQuickWindow *window); + void resize(QQuickWindow *window, const QSize &size); + + void maybeUpdate(QQuickWindow *window); + void update(QQuickWindow *window); // identical for this implementation. + + void releaseResources() { } + + QAnimationDriver *animationDriver() const { return 0; } + + QSGContext *sceneGraphContext() const; + + static void createOpenGLContext(QQuickWindow *window); + +private: + QScopedPointer m_openGlContext; + QScopedPointer m_sgContext; +}; + +QT_END_NAMESPACE + +QT_END_HEADER +#endif // DESIGNERWINDOWMANAGER_P_H diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index 6596343bc8..dd27182ffe 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -74,6 +74,8 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_ DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP); DEFINE_BOOL_CONFIG_OPTION(qmlForceThreadedRenderer, QML_FORCE_THREADED_RENDERER); // Might trigger graphics driver threading bugs, use at own risk +QQuickWindowManager *QQuickWindowManager::s_instance = 0; + QQuickWindowManager::~QQuickWindowManager() { } @@ -124,11 +126,9 @@ public: QQuickWindowManager *QQuickWindowManager::instance() { - static QQuickWindowManager *theInstance; - - if (!theInstance) { + if (!s_instance) { - theInstance = QSGContext::createWindowManager(); + s_instance = QSGContext::createWindowManager(); bool bufferQueuing = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::BufferQueueingOpenGL); bool fancy = bufferQueuing @@ -148,13 +148,19 @@ QQuickWindowManager *QQuickWindowManager::instance() if (fixedAnimationSteps) QUnifiedTimer::instance(true)->setConsistentTiming(true); - if (!theInstance) { - theInstance = fancy + if (!s_instance) { + s_instance = fancy ? (QQuickWindowManager*) new QQuickRenderThreadSingleContextWindowManager : (QQuickWindowManager*) new QQuickTrivialWindowManager; } } - return theInstance; + return s_instance; +} + +void QQuickWindowManager::setInstance(QQuickWindowManager *instance) +{ + Q_ASSERT(!s_instance); + s_instance = instance; } QQuickTrivialWindowManager::QQuickTrivialWindowManager() diff --git a/src/quick/items/qquickwindowmanager_p.h b/src/quick/items/qquickwindowmanager_p.h index 7a6d26127a..ac46fd3d5f 100644 --- a/src/quick/items/qquickwindowmanager_p.h +++ b/src/quick/items/qquickwindowmanager_p.h @@ -76,6 +76,10 @@ public: // ### make this less of a singleton static QQuickWindowManager *instance(); + static void setInstance(QQuickWindowManager *instance); + +private: + static QQuickWindowManager *s_instance; }; QT_END_NAMESPACE -- cgit v1.2.3 From cc39a7d7affe37741292989c634aec3f60660c0e Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 15 Oct 2012 15:22:08 +0200 Subject: Fix crash in the qmlpuppet at finishing Task-number: QTCREATORBUG-8042 Change-Id: I30a5b40d6441ea1631ba11a97b062720e70ddca8 Reviewed-by: Thomas Hartmann --- src/quick/designer/designersupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp index 78445d7179..55a0b53df7 100644 --- a/src/quick/designer/designersupport.cpp +++ b/src/quick/designer/designersupport.cpp @@ -420,7 +420,8 @@ bool DesignerSupport::isValidHeight(QQuickItem *item) void DesignerSupport::updateDirtyNode(QQuickItem *item) { - QQuickWindowPrivate::get(item->window())->updateDirtyNode(item); + if (item->window()) + QQuickWindowPrivate::get(item->window())->updateDirtyNode(item); } void DesignerSupport::activateDesignerWindowManager() -- cgit v1.2.3 From f21e9ba6efa2b1c8169491db271f79b87b5b0ce4 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 7 Aug 2012 11:26:37 +1000 Subject: Remove interim compatibility measures Also update some variables in qtdeclarative which failed to update rootItem->contentItem. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d3 Reviewed-by: Alan Alpert <416365416c@gmail.com> --- .../quick/scenegraph/openglunderqml/squircle.cpp | 6 +- .../accessible/quick/qaccessiblequickview.cpp | 4 +- .../qmltooling/qmldbg_qtquick2/highlight.cpp | 22 +++--- .../qmltooling/qmldbg_qtquick2/inspecttool.cpp | 58 +++++++-------- .../qmltooling/qmldbg_qtquick2/inspecttool.h | 2 +- .../qmldbg_qtquick2/qquickviewinspector.cpp | 6 +- src/qmltest/quicktestresult.cpp | 2 +- src/quick/items/items.pri | 1 - src/quick/items/qquickcanvas.h | 58 --------------- src/quick/items/qquickitem.h | 2 - src/quick/items/qquickmousearea.cpp | 2 +- src/quick/items/qquickview.cpp | 2 +- src/quick/items/qquickwindow.cpp | 84 +++++++++++----------- src/quick/items/qquickwindow.h | 2 - src/quick/items/qquickwindow_p.h | 4 +- tests/auto/quick/examples/tst_examples.cpp | 4 +- .../qquickapplication/tst_qquickapplication.cpp | 2 +- tests/auto/quick/qquickdrag/tst_qquickdrag.cpp | 36 +++++----- .../quick/qquickdroparea/tst_qquickdroparea.cpp | 18 ++--- .../qquickfocusscope/tst_qquickfocusscope.cpp | 2 +- tests/auto/quick/qquickitem/tst_qquickitem.cpp | 82 ++++++++++----------- .../quick/qquickitemlayer/tst_qquickitemlayer.cpp | 6 +- .../qquickpainteditem/tst_qquickpainteditem.cpp | 16 ++--- .../qquickpositioners/tst_qquickpositioners.cpp | 6 +- .../quick/qquicktextedit/tst_qquicktextedit.cpp | 12 ++-- .../quick/qquicktextinput/tst_qquicktextinput.cpp | 24 +++---- .../tst_qquickvisualdatamodel.cpp | 8 +-- tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 28 ++++---- 28 files changed, 218 insertions(+), 281 deletions(-) delete mode 100644 src/quick/items/qquickcanvas.h diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp index 24e8533d8e..867ce4a7e0 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.cpp +++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp @@ -59,8 +59,8 @@ void Squircle::setT(qreal t) return; m_t = t; emit tChanged(); - if (canvas()) - canvas()->update(); + if (window()) + window()->update(); } //! [8] @@ -113,7 +113,7 @@ void Squircle::paint() m_program->bindAttributeLocation("vertices", 0); m_program->link(); - connect(canvas()->openglContext(), SIGNAL(aboutToBeDestroyed()), + connect(window()->openglContext(), SIGNAL(aboutToBeDestroyed()), this, SLOT(cleanup()), Qt::DirectConnection); } //! [4] //! [5] diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp index d7f2b943c3..764db834d2 100644 --- a/src/plugins/accessible/quick/qaccessiblequickview.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp @@ -60,7 +60,7 @@ QAccessibleQuickView::QAccessibleQuickView(QQuickView *object) int QAccessibleQuickView::childCount() const { - return view()->rootItem() ? 1 : 0; + return view()->contentItem() ? 1 : 0; } QAccessibleInterface *QAccessibleQuickView::parent() const @@ -155,7 +155,7 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y) QAccessibleInterface *QAccessibleQuickView::childAt(int x, int y) const { Q_ASSERT(view()); - QQuickItem *root = view()->rootItem(); + QQuickItem *root = view()->contentItem(); if (root) { if (QQuickItem *item = childAt_helper(root, x, y)) return QAccessible::queryAccessibleInterface(item); diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp index 3d316005c5..d6fc0b27a5 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.cpp @@ -82,14 +82,14 @@ void Highlight::setItem(QQuickItem *item) SLOT(adjust())); } QQuickWindow *view = item->window(); - QQuickItem * rootItem = view->rootItem(); - if (rootItem) { - connect(rootItem, SIGNAL(xChanged()), SLOT(adjust())); - connect(rootItem, SIGNAL(yChanged()), SLOT(adjust())); - connect(rootItem, SIGNAL(widthChanged()), SLOT(adjust())); - connect(rootItem, SIGNAL(heightChanged()), SLOT(adjust())); - connect(rootItem, SIGNAL(rotationChanged()), SLOT(adjust())); - connect(rootItem, SIGNAL(transformOriginChanged(TransformOrigin)), + QQuickItem * contentItem = view->contentItem(); + if (contentItem) { + connect(contentItem, SIGNAL(xChanged()), SLOT(adjust())); + connect(contentItem, SIGNAL(yChanged()), SLOT(adjust())); + connect(contentItem, SIGNAL(widthChanged()), SLOT(adjust())); + connect(contentItem, SIGNAL(heightChanged()), SLOT(adjust())); + connect(contentItem, SIGNAL(rotationChanged()), SLOT(adjust())); + connect(contentItem, SIGNAL(transformOriginChanged(TransformOrigin)), SLOT(adjust())); } m_item = item; @@ -111,9 +111,9 @@ void Highlight::adjust() qreal scaleFactor = 1; QPointF originOffset = QPointF(0,0); QQuickWindow *view = m_item->window(); - if (view->rootItem()) { - scaleFactor = view->rootItem()->scale(); - originOffset -= view->rootItem()->pos(); + if (view->contentItem()) { + scaleFactor = view->contentItem()->scale(); + originOffset -= view->contentItem()->pos(); } // The scale transform for the overlay needs to be cancelled // as the Item's transform which will be applied to the painter diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp index 69b2dd4e21..8cd40b4e0c 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp @@ -61,17 +61,17 @@ namespace QtQuick2 { InspectTool::InspectTool(QQuickViewInspector *inspector, QQuickView *view) : AbstractTool(inspector), - m_originalSmooth(view->rootItem()->smooth()), + m_originalSmooth(view->contentItem()->smooth()), m_dragStarted(false), m_pinchStarted(false), m_didPressAndHold(false), m_tapEvent(false), - m_rootItem(view->rootItem()), - m_originalPosition(view->rootItem()->pos()), + m_contentItem(view->contentItem()), + m_originalPosition(view->contentItem()->pos()), m_smoothScaleFactor(Constants::ZoomSnapDelta), m_minScale(0.125f), m_maxScale(48.0f), - m_originalScale(view->rootItem()->scale()), + m_originalScale(view->contentItem()->scale()), m_touchTimestamp(0), m_hoverHighlight(new HoverHighlight(inspector->overlay())), m_lastItem(0), @@ -98,17 +98,17 @@ void InspectTool::enable(bool enable) if (!enable) { inspector()->setSelectedItems(QList()); // restoring the original states. - if (m_rootItem) { - m_rootItem->setScale(m_originalScale); - m_rootItem->setPos(m_originalPosition); - m_rootItem->setSmooth(m_originalSmooth); + if (m_contentItem) { + m_contentItem->setScale(m_originalScale); + m_contentItem->setPos(m_originalPosition); + m_contentItem->setSmooth(m_originalSmooth); } } else { - if (m_rootItem) { - m_originalSmooth = m_rootItem->smooth(); - m_originalScale = m_rootItem->scale(); - m_originalPosition = m_rootItem->pos(); - m_rootItem->setSmooth(true); + if (m_contentItem) { + m_originalSmooth = m_contentItem->smooth(); + m_originalScale = m_contentItem->scale(); + m_originalPosition = m_contentItem->pos(); + m_contentItem->setSmooth(true); } } } @@ -174,8 +174,8 @@ void InspectTool::wheelEvent(QWheelEvent *event) Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier; if (event->modifiers() & smoothZoomModifier) { int numDegrees = event->delta() / 8; - qreal newScale = m_rootItem->scale() + m_smoothScaleFactor * (numDegrees / 15.0f); - scaleView(newScale / m_rootItem->scale(), m_mousePosition, m_mousePosition); + qreal newScale = m_contentItem->scale() + m_smoothScaleFactor * (numDegrees / 15.0f); + scaleView(newScale / m_contentItem->scale(), m_mousePosition, m_mousePosition); } else if (!event->modifiers()) { if (event->delta() > 0) { zoomIn(); @@ -204,7 +204,7 @@ void InspectTool::keyReleaseEvent(QKeyEvent *event) case Qt::Key_8: case Qt::Key_9: { qreal newScale = ((event->key() - Qt::Key_0) * 1.0f); - scaleView(newScale / m_rootItem->scale(), m_mousePosition, m_mousePosition); + scaleView(newScale / m_contentItem->scale(), m_mousePosition, m_mousePosition); break; } default: @@ -283,34 +283,34 @@ void InspectTool::touchEvent(QTouchEvent *event) void InspectTool::scaleView(const qreal &factor, const QPointF &newcenter, const QPointF &oldcenter) { m_pressAndHoldTimer.stop(); - if (((m_rootItem->scale() * factor) > m_maxScale) - || ((m_rootItem->scale() * factor) < m_minScale)) { + if (((m_contentItem->scale() * factor) > m_maxScale) + || ((m_contentItem->scale() * factor) < m_minScale)) { return; } //New position = new center + scalefactor * (oldposition - oldcenter) - QPointF newPosition = newcenter + (factor * (m_rootItem->pos() - oldcenter)); - m_rootItem->setScale(m_rootItem->scale() * factor); - m_rootItem->setPos(newPosition); + QPointF newPosition = newcenter + (factor * (m_contentItem->pos() - oldcenter)); + m_contentItem->setScale(m_contentItem->scale() * factor); + m_contentItem->setPos(newPosition); } void InspectTool::zoomIn() { qreal newScale = nextZoomScale(ZoomIn); - scaleView(newScale / m_rootItem->scale(), m_mousePosition, m_mousePosition); + scaleView(newScale / m_contentItem->scale(), m_mousePosition, m_mousePosition); } void InspectTool::zoomOut() { qreal newScale = nextZoomScale(ZoomOut); - scaleView(newScale / m_rootItem->scale(), m_mousePosition, m_mousePosition); + scaleView(newScale / m_contentItem->scale(), m_mousePosition, m_mousePosition); } void InspectTool::zoomTo100() { m_didPressAndHold = true; - m_rootItem->setPos(QPointF(0, 0)); - m_rootItem->setScale(1.0); + m_contentItem->setPos(QPointF(0, 0)); + m_contentItem->setScale(1.0); } qreal InspectTool::nextZoomScale(ZoomDirection direction) @@ -338,13 +338,13 @@ qreal InspectTool::nextZoomScale(ZoomDirection direction) if (direction == ZoomIn) { for (int i = 0; i < zoomScales.length(); ++i) { - if (zoomScales[i] > m_rootItem->scale()) + if (zoomScales[i] > m_contentItem->scale()) return zoomScales[i]; } return zoomScales.last(); } else { for (int i = zoomScales.length() - 1; i >= 0; --i) { - if (zoomScales[i] < m_rootItem->scale()) + if (zoomScales[i] < m_contentItem->scale()) return zoomScales[i]; } return zoomScales.first(); @@ -361,9 +361,9 @@ void InspectTool::initializeDrag(const QPointF &pos) void InspectTool::dragItemToPosition() { - QPointF newPosition = m_rootItem->pos() + m_mousePosition - m_dragStartPosition; + QPointF newPosition = m_contentItem->pos() + m_mousePosition - m_dragStartPosition; m_dragStartPosition = m_mousePosition; - m_rootItem->setPos(newPosition); + m_contentItem->setPos(newPosition); } void InspectTool::moveItem(bool valid) diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h index dabb41e549..5c480697af 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h +++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h @@ -108,7 +108,7 @@ private: bool m_pinchStarted; bool m_didPressAndHold; bool m_tapEvent; - QPointer m_rootItem; + QPointer m_contentItem; QPointF m_dragStartPosition; QPointF m_mousePosition; QPointF m_originalPosition; diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp index 1cb24064f1..4f6ee51c5d 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp @@ -128,7 +128,7 @@ QQuickViewInspector::QQuickViewInspector(QQuickView *view, QObject *parent) : // Try to make sure the overlay is always on top m_overlay->setZ(FLT_MAX); - if (QQuickItem *root = view->rootItem()) + if (QQuickItem *root = view->contentItem()) m_overlay->setParentItem(root); view->installEventFilter(this); @@ -190,13 +190,13 @@ QQmlEngine *QQuickViewInspector::declarativeEngine() const QQuickItem *QQuickViewInspector::topVisibleItemAt(const QPointF &pos) const { - QQuickItem *root = m_view->rootItem(); + QQuickItem *root = m_view->contentItem(); return itemAt(root, root->mapFromScene(pos), m_overlay); } QList QQuickViewInspector::itemsAt(const QPointF &pos) const { - QQuickItem *root = m_view->rootItem(); + QQuickItem *root = m_view->contentItem(); QList resultList; collectItemsAt(root, root->mapFromScene(pos), m_overlay, resultList); diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index 8a15062cd6..4344fb6b5e 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -579,7 +579,7 @@ bool QuickTestResult::waitForRendering(QQuickItem *item, int timeout) { Q_ASSERT(item); - return qWaitForSignal(item->canvas(), SIGNAL(frameSwapped()), timeout); + return qWaitForSignal(item->window(), SIGNAL(frameSwapped()), timeout); } void QuickTestResult::startMeasurement() diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri index a73766895e..13abf7b958 100644 --- a/src/quick/items/items.pri +++ b/src/quick/items/items.pri @@ -10,7 +10,6 @@ HEADERS += \ $$PWD/qquickrectangle_p_p.h \ $$PWD/qquickwindow.h \ $$PWD/qquickwindow_p.h \ - $$PWD/qquickcanvas.h \ $$PWD/qquickfocusscope_p.h \ $$PWD/qquickitemsmodule_p.h \ $$PWD/qquickpainteditem.h \ diff --git a/src/quick/items/qquickcanvas.h b/src/quick/items/qquickcanvas.h deleted file mode 100644 index 907cf30752..0000000000 --- a/src/quick/items/qquickcanvas.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKCANVAS_H -#define QQUICKCANVAS_H - -#include "qquickwindow.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -typedef QQuickWindow QQuickCanvas; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QQUICKCANVAS_H - diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 75a8a8ecd5..fa6aa62907 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -196,8 +196,6 @@ public: QQuickItem(QQuickItem *parent = 0); virtual ~QQuickItem(); - //canvas() is being removed in favor of window() really soon now - QQuickWindow *canvas() const { return window(); } QQuickWindow *window() const; QQuickItem *parentItem() const; void setParentItem(QQuickItem *parent); diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index e4c821f046..803840aeaf 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -264,7 +264,7 @@ void QQuickMouseAreaPrivate::propagate(QQuickMouseEvent* event, PropagateType t) if (!propagateComposedEvents) return; QPointF scenePos = q->mapToScene(QPointF(event->x(), event->y())); - propagateHelper(event, window->rootItem(), scenePos, t); + propagateHelper(event, window->contentItem(), scenePos, t); } bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *item,const QPointF &sp, PropagateType sig) diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index f3610ea53a..7182e74c0c 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -461,7 +461,7 @@ void QQuickViewPrivate::setRootObject(QObject *obj) return; if (QQuickItem *sgItem = qobject_cast(obj)) { root = sgItem; - sgItem->setParentItem(q->QQuickWindow::rootItem()); + sgItem->setParentItem(q->QQuickWindow::contentItem()); } else { qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << endl << endl diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 7cc645f48a..f1cfdf8597 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -222,14 +222,14 @@ void QQuickWindow::hideEvent(QHideEvent *) void QQuickWindow::focusOutEvent(QFocusEvent *) { Q_D(QQuickWindow); - d->rootItem->setFocus(false); + d->contentItem->setFocus(false); } /*! \reimp */ void QQuickWindow::focusInEvent(QFocusEvent *) { Q_D(QQuickWindow); - d->rootItem->setFocus(true); + d->contentItem->setFocus(true); d->updateFocusItemTransform(); } @@ -309,10 +309,10 @@ void QQuickWindowPrivate::syncSceneGraph() emit q->beforeSynchronizing(); if (!renderer) { - forceUpdate(rootItem); + forceUpdate(contentItem); QSGRootNode *rootNode = new QSGRootNode; - rootNode->appendChildNode(QQuickItemPrivate::get(rootItem)->itemNode()); + rootNode->appendChildNode(QQuickItemPrivate::get(contentItem)->itemNode()); renderer = context->createRenderer(); renderer->setRootNode(rootNode); } @@ -348,7 +348,7 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size) } QQuickWindowPrivate::QQuickWindowPrivate() - : rootItem(0) + : contentItem(0) , activeFocusItem(0) , mouseGrabberItem(0) #ifndef QT_NO_CURSOR @@ -382,18 +382,18 @@ void QQuickWindowPrivate::init(QQuickWindow *c) Q_Q(QQuickWindow); - rootItem = new QQuickRootItem; - QQmlEngine::setObjectOwnership(rootItem, QQmlEngine::CppOwnership); - QQuickItemPrivate *rootItemPrivate = QQuickItemPrivate::get(rootItem); - rootItemPrivate->window = q; - rootItemPrivate->windowRefCount = 1; - rootItemPrivate->flags |= QQuickItem::ItemIsFocusScope; + contentItem = new QQuickRootItem; + QQmlEngine::setObjectOwnership(contentItem, QQmlEngine::CppOwnership); + QQuickItemPrivate *contentItemPrivate = QQuickItemPrivate::get(contentItem); + contentItemPrivate->window = q; + contentItemPrivate->windowRefCount = 1; + contentItemPrivate->flags |= QQuickItem::ItemIsFocusScope; // In the absence of a focus in event on some platforms assume the window will - // be activated immediately and set focus on the rootItem + // be activated immediately and set focus on the contentItem // ### Remove when QTBUG-22415 is resolved. - //It is important that this call happens after the rootItem has a window.. - rootItem->setFocus(true); + //It is important that this call happens after the contentItem has a window.. + contentItem->setFocus(true); windowManager = QQuickWindowManager::instance(); context = windowManager->sceneGraphContext(); @@ -412,19 +412,19 @@ void QQuickWindowPrivate::init(QQuickWindow *c) QQmlListProperty QQuickWindowPrivate::data() { - initRootItem(); - return QQuickItemPrivate::get(rootItem)->data(); + initContentItem(); + return QQuickItemPrivate::get(contentItem)->data(); } -void QQuickWindowPrivate::initRootItem() +void QQuickWindowPrivate::initContentItem() { Q_Q(QQuickWindow); q->connect(q, SIGNAL(widthChanged(int)), - rootItem, SLOT(setWidth(int))); + contentItem, SLOT(setWidth(int))); q->connect(q, SIGNAL(heightChanged(int)), - rootItem, SLOT(setHeight(int))); - rootItem->setWidth(q->width()); - rootItem->setHeight(q->height()); + contentItem, SLOT(setHeight(int))); + contentItem->setWidth(q->width()); + contentItem->setHeight(q->height()); } static QMouseEvent *touchToMouseEvent(QEvent::Type type, const QTouchEvent::TouchPoint &p, QTouchEvent *event, QQuickItem *item, bool transformNeeded = true) @@ -527,7 +527,7 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e lastMousePosition = me->windowPos(); bool accepted = me->isAccepted(); - bool delivered = deliverHoverEvent(rootItem, me->windowPos(), last, me->modifiers(), accepted); + bool delivered = deliverHoverEvent(contentItem, me->windowPos(), last, me->modifiers(), accepted); if (!delivered) { //take care of any exits accepted = clearHover(); @@ -594,7 +594,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F Q_Q(QQuickWindow); Q_ASSERT(item); - Q_ASSERT(scope || item == rootItem); + Q_ASSERT(scope || item == contentItem); #ifdef FOCUS_DEBUG qWarning() << "QQuickWindowPrivate::setFocusInScope():"; @@ -614,7 +614,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F QVarLengthArray changed; // Does this change the active focus? - if (item == rootItem || (scopePrivate->activeFocus && item->isEnabled())) { + if (item == contentItem || (scopePrivate->activeFocus && item->isEnabled())) { oldActiveFocusItem = activeFocusItem; newActiveFocusItem = item; while (newActiveFocusItem->isFocusScope() @@ -643,7 +643,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F } } - if (item != rootItem && !(options & DontChangeSubFocusItem)) { + if (item != contentItem && !(options & DontChangeSubFocusItem)) { QQuickItem *oldSubFocusItem = scopePrivate->subFocusItem; if (oldSubFocusItem) { QQuickItemPrivate::get(oldSubFocusItem)->focus = false; @@ -654,13 +654,13 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, F } if (!(options & DontChangeFocusProperty)) { -// if (item != rootItem || QGuiApplication::focusWindow() == q) { // QTBUG-22415 +// if (item != contentItem || QGuiApplication::focusWindow() == q) { // QTBUG-22415 itemPrivate->focus = true; changed << item; // } } - if (newActiveFocusItem && rootItem->hasFocus()) { + if (newActiveFocusItem && contentItem->hasFocus()) { activeFocusItem = newActiveFocusItem; QQuickItemPrivate::get(newActiveFocusItem)->activeFocus = true; @@ -690,7 +690,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, Q_Q(QQuickWindow); Q_ASSERT(item); - Q_ASSERT(scope || item == rootItem); + Q_ASSERT(scope || item == contentItem); #ifdef FOCUS_DEBUG qWarning() << "QQuickWindowPrivate::clearFocusInScope():"; @@ -711,10 +711,10 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, QVarLengthArray changed; - Q_ASSERT(item == rootItem || item == scopePrivate->subFocusItem); + Q_ASSERT(item == contentItem || item == scopePrivate->subFocusItem); // Does this change the active focus? - if (item == rootItem || scopePrivate->activeFocus) { + if (item == contentItem || scopePrivate->activeFocus) { oldActiveFocusItem = activeFocusItem; newActiveFocusItem = scope; @@ -738,7 +738,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, } } - if (item != rootItem && !(options & DontChangeSubFocusItem)) { + if (item != contentItem && !(options & DontChangeSubFocusItem)) { QQuickItem *oldSubFocusItem = scopePrivate->subFocusItem; if (oldSubFocusItem && !(options & DontChangeFocusProperty)) { QQuickItemPrivate::get(oldSubFocusItem)->focus = false; @@ -953,7 +953,7 @@ QQuickWindow::~QQuickWindow() QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); delete d->incubationController; d->incubationController = 0; - delete d->rootItem; d->rootItem = 0; + delete d->contentItem; d->contentItem = 0; } @@ -1055,7 +1055,7 @@ QQuickItem *QQuickWindow::contentItem() const { Q_D(const QQuickWindow); - return d->rootItem; + return d->contentItem; } /*! @@ -1149,7 +1149,7 @@ bool QQuickWindow::event(QEvent *e) break; #endif case QEvent::WindowDeactivate: - rootItem()->windowDeactivateEvent(); + contentItem()->windowDeactivateEvent(); break; case QEvent::FocusAboutToChange: if (d->activeFocusItem) @@ -1241,7 +1241,7 @@ bool QQuickWindowPrivate::deliverMouseEvent(QMouseEvent *event) if (!mouseGrabberItem && event->type() == QEvent::MouseButtonPress && (event->buttons() & event->button()) == event->buttons()) { - if (deliverInitialMousePressEvent(rootItem, event)) + if (deliverInitialMousePressEvent(contentItem, event)) event->accept(); else event->ignore(); @@ -1299,7 +1299,7 @@ void QQuickWindow::mouseDoubleClickEvent(QMouseEvent *event) #endif if (!d->mouseGrabberItem && (event->buttons() & event->button()) == event->buttons()) { - if (d->deliverInitialMousePressEvent(d->rootItem, event)) + if (d->deliverInitialMousePressEvent(d->contentItem, event)) event->accept(); else event->ignore(); @@ -1344,7 +1344,7 @@ void QQuickWindow::mouseMoveEvent(QMouseEvent *event) d->lastMousePosition = event->windowPos(); bool accepted = event->isAccepted(); - bool delivered = d->deliverHoverEvent(d->rootItem, event->windowPos(), last, event->modifiers(), accepted); + bool delivered = d->deliverHoverEvent(d->contentItem, event->windowPos(), last, event->modifiers(), accepted); if (!delivered) { //take care of any exits accepted = d->clearHover(); @@ -1472,7 +1472,7 @@ void QQuickWindow::wheelEvent(QWheelEvent *event) return; event->ignore(); - d->deliverWheelEvent(d->rootItem, event); + d->deliverWheelEvent(d->contentItem, event); d->lastWheelEventAccepted = event->isAccepted(); } #endif // QT_NO_WHEELEVENT @@ -1543,7 +1543,7 @@ bool QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event) // or some item accepted a point and should receive an update if (newPoints.count() > 0 || updatedPoints.count() > 0) { QSet acceptedNewPoints; - event->setAccepted(deliverTouchPoints(rootItem, event, newPoints, &acceptedNewPoints, &updatedPoints)); + event->setAccepted(deliverTouchPoints(contentItem, event, newPoints, &acceptedNewPoints, &updatedPoints)); } else event->ignore(); @@ -1814,7 +1814,7 @@ void QQuickWindowPrivate::deliverDragEvent(QQuickDragGrabber *grabber, QEvent *e e->mouseButtons(), e->keyboardModifiers()); QQuickDropEventEx::copyActions(&enterEvent, *e); - event->setAccepted(deliverDragEvent(grabber, rootItem, &enterEvent)); + event->setAccepted(deliverDragEvent(grabber, contentItem, &enterEvent)); } } @@ -1874,7 +1874,7 @@ void QQuickWindowPrivate::updateCursor(const QPointF &scenePos) Q_Q(QQuickWindow); QQuickItem *oldCursorItem = cursorItem; - cursorItem = findCursorItem(rootItem, scenePos); + cursorItem = findCursorItem(contentItem, scenePos); if (cursorItem != oldCursorItem) { if (cursorItem) @@ -2118,7 +2118,7 @@ void QQuickWindowPrivate::cleanupNodesOnShutdown() { Q_Q(QQuickWindow); cleanupNodes(); - cleanupNodesOnShutdown(rootItem); + cleanupNodesOnShutdown(contentItem); QSet::const_iterator it = parentlessItems.begin(); for (; it != parentlessItems.end(); ++it) cleanupNodesOnShutdown(*it); diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 62b0aa3945..7f9af82d88 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -82,8 +82,6 @@ public: virtual ~QQuickWindow(); QQuickItem *contentItem() const; - //XXX rootItem renamed contentItem - this function must be removed before 5.0 - QQuickItem *rootItem() const { return contentItem(); } QQuickItem *activeFocusItem() const; QObject *focusObject() const; diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 530e547f3e..fdf5fe2abb 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -103,9 +103,9 @@ public: virtual ~QQuickWindowPrivate(); void init(QQuickWindow *); - void initRootItem();//Currently only used if items added in QML + void initContentItem();//Currently only used if items added in QML - QQuickRootItem *rootItem; + QQuickRootItem *contentItem; QSet parentlessItems; QQmlListProperty data(); diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 70efc5eac5..f651655244 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -275,7 +275,7 @@ void tst_examples::sgexamples() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); } - root->setParentItem(window->rootItem()); + root->setParentItem(window->contentItem()); component.completeCreate(); qApp->processEvents(); @@ -319,7 +319,7 @@ void tst_examples::sgsnippets() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); } - root->setParentItem(window->rootItem()); + root->setParentItem(window->contentItem()); component.completeCreate(); qApp->processEvents(); diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp index 247f98702e..7c07a16d51 100644 --- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp +++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp @@ -81,7 +81,7 @@ void tst_qquickapplication::active() QQuickItem *item = qobject_cast(component.create()); QVERIFY(item); QQuickWindow window; - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); // not active QVERIFY(!item->property("active").toBool()); diff --git a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp index 8e13e21f1e..562863b4f3 100644 --- a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp +++ b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp @@ -180,7 +180,7 @@ void tst_QQuickDrag::cleanupTestCase() void tst_QQuickDrag::active() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -390,7 +390,7 @@ void tst_QQuickDrag::active() void tst_QQuickDrag::drop() { QQuickWindow window; - TestDropTarget outerTarget(window.rootItem()); + TestDropTarget outerTarget(window.contentItem()); outerTarget.setSize(QSizeF(100, 100)); outerTarget.acceptAction = Qt::CopyAction; TestDropTarget innerTarget(&outerTarget); @@ -526,7 +526,7 @@ void tst_QQuickDrag::drop() void tst_QQuickDrag::move() { QQuickWindow window; - TestDropTarget outerTarget(window.rootItem()); + TestDropTarget outerTarget(window.contentItem()); outerTarget.setSize(QSizeF(100, 100)); TestDropTarget leftTarget(&outerTarget); leftTarget.setPos(QPointF(0, 35)); @@ -680,11 +680,11 @@ void tst_QQuickDrag::move() void tst_QQuickDrag::parentChange() { QQuickWindow window1; - TestDropTarget dropTarget1(window1.rootItem()); + TestDropTarget dropTarget1(window1.contentItem()); dropTarget1.setSize(QSizeF(100, 100)); QQuickWindow window2; - TestDropTarget dropTarget2(window2.rootItem()); + TestDropTarget dropTarget2(window2.contentItem()); dropTarget2.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); @@ -704,7 +704,7 @@ void tst_QQuickDrag::parentChange() QCOMPARE(evaluate(item, "Drag.active"), true); // Verify setting a parent item for an item with an active drag sends an enter event. - item->setParentItem(window1.rootItem()); + item->setParentItem(window1.contentItem()); QCOMPARE(dropTarget1.enterEvents, 0); QCoreApplication::processEvents(); QCOMPARE(dropTarget1.enterEvents, 1); @@ -719,7 +719,7 @@ void tst_QQuickDrag::parentChange() // Changing the parent to an item in another window sends a leave event in the old window // and an enter on the new window. - item->setParentItem(window2.rootItem()); + item->setParentItem(window2.contentItem()); QCOMPARE(dropTarget1.enterEvents, 1); QCOMPARE(dropTarget1.moveEvents, 1); QCOMPARE(dropTarget1.leaveEvents, 0); @@ -746,13 +746,13 @@ void tst_QQuickDrag::parentChange() // Go around again and verify no events if active is false. evaluate(item, "Drag.active = false"); - item->setParentItem(window1.rootItem()); + item->setParentItem(window1.contentItem()); QCoreApplication::processEvents(); item->setParentItem(&dropTarget1); QCoreApplication::processEvents(); - item->setParentItem(window2.rootItem()); + item->setParentItem(window2.contentItem()); QCoreApplication::processEvents(); item->setParentItem(0); @@ -767,7 +767,7 @@ void tst_QQuickDrag::parentChange() void tst_QQuickDrag::hotSpot() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -831,7 +831,7 @@ void tst_QQuickDrag::hotSpot() void tst_QQuickDrag::supportedActions() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -889,7 +889,7 @@ void tst_QQuickDrag::supportedActions() void tst_QQuickDrag::proposedAction() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -958,8 +958,8 @@ void tst_QQuickDrag::keys() // Test changing the keys restarts a drag. QQuickWindow window; - item->setParentItem(window.rootItem()); - TestDropTarget dropTarget(window.rootItem()); + item->setParentItem(window.contentItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); evaluate(item, "Drag.start()"); @@ -1006,8 +1006,8 @@ void tst_QQuickDrag::source() // Test changing the source restarts a drag. QQuickWindow window; - item->setParentItem(window.rootItem()); - TestDropTarget dropTarget(window.rootItem()); + item->setParentItem(window.contentItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); evaluate(item, "Drag.start()"); @@ -1183,7 +1183,7 @@ void tst_QQuickDrag::recursion() QTest::ignoreMessage(QtWarningMsg, warning.constData()); QQuickWindow window; - RecursingDropTarget dropTarget(script, type, window.rootItem()); + RecursingDropTarget dropTarget(script, type, window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -1195,7 +1195,7 @@ void tst_QQuickDrag::recursion() QScopedPointer object(component.create()); QQuickItem *item = qobject_cast(object.data()); QVERIFY(item); - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); dropTarget.setItem(item); diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index 42dc6ff698..927a57b296 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -122,7 +122,7 @@ void tst_QQuickDropArea::containsDrag_internal() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild("dragItem"); QVERIFY(dragItem); @@ -188,7 +188,7 @@ void tst_QQuickDropArea::containsDrag_external() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; QQuickWindow alternateWindow; @@ -256,7 +256,7 @@ void tst_QQuickDropArea::keys_internal() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild("dragItem"); QVERIFY(dragItem); @@ -356,7 +356,7 @@ void tst_QQuickDropArea::keys_external() "}", QUrl()); QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; QQuickWindow alternateWindow; @@ -463,7 +463,7 @@ void tst_QQuickDropArea::source_internal() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild("dragItem"); QVERIFY(dragItem); @@ -528,7 +528,7 @@ void tst_QQuickDropArea::position_internal() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild("dragItem"); QVERIFY(dragItem); @@ -590,7 +590,7 @@ void tst_QQuickDropArea::position_external() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; @@ -667,7 +667,7 @@ void tst_QQuickDropArea::drop_internal() QScopedPointer object(component.create()); QQuickItem *dropArea = qobject_cast(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild("dragItem"); QVERIFY(dragItem); @@ -806,7 +806,7 @@ void tst_QQuickDropArea::simultaneousDrags() QScopedPointer object(component.create()); QQuickItem *dropArea1 = qobject_cast(object.data()); QVERIFY(dropArea1); - dropArea1->setParentItem(window.rootItem()); + dropArea1->setParentItem(window.contentItem()); QQuickItem *dropArea2 = dropArea1->findChild("dropArea2"); QVERIFY(dropArea2); diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp index 1cf07d38b6..a614bbbe42 100644 --- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp +++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp @@ -503,7 +503,7 @@ void tst_qquickfocusscope::canvasFocus() QQuickItem *rootObject = view->rootObject(); QVERIFY(rootObject); - QQuickItem *rootItem = view->rootItem(); + QQuickItem *rootItem = view->contentItem(); QQuickItem *scope1 = findItem(rootObject, QLatin1String("scope1")); QQuickItem *item1 = findItem(rootObject, QLatin1String("item1")); QQuickItem *scope2 = findItem(rootObject, QLatin1String("scope2")); diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index f98fe752c3..1050308afd 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -254,7 +254,7 @@ struct FocusState : public QHash else if (qobject_cast(window.activeFocusItem())) \ QCOMPARE(qobject_cast(window.activeFocusItem())->focused, true); \ } else { \ - QCOMPARE(window.activeFocusItem(), window.rootItem()); \ + QCOMPARE(window.activeFocusItem(), window.contentItem()); \ } \ for (QHash::Iterator iter = focusState.begin(); \ iter != focusState.end(); \ @@ -276,9 +276,9 @@ void tst_qquickitem::simpleFocus() QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *l1c1 = new TestItem(window.rootItem()); - QQuickItem *l1c2 = new TestItem(window.rootItem()); - QQuickItem *l1c3 = new TestItem(window.rootItem()); + QQuickItem *l1c1 = new TestItem(window.contentItem()); + QQuickItem *l1c2 = new TestItem(window.contentItem()); + QQuickItem *l1c3 = new TestItem(window.contentItem()); QQuickItem *l2c1 = new TestItem(l1c1); QQuickItem *l2c2 = new TestItem(l1c1); @@ -327,9 +327,9 @@ void tst_qquickitem::scopedFocus() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *l1c1 = new TestItem(window.rootItem()); - QQuickItem *l1c2 = new TestItem(window.rootItem()); - QQuickItem *l1c3 = new TestItem(window.rootItem()); + QQuickItem *l1c1 = new TestItem(window.contentItem()); + QQuickItem *l1c2 = new TestItem(window.contentItem()); + QQuickItem *l1c3 = new TestItem(window.contentItem()); QQuickItem *l2c1 = new TestItem(l1c1); QQuickItem *l2c2 = new TestItem(l1c1); @@ -416,7 +416,7 @@ void tst_qquickitem::addedToWindow() focusState[item].set(true, false); FVERIFY(); - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); focusState[item].set(true, true); focusState.active(item); FVERIFY(); @@ -427,7 +427,7 @@ void tst_qquickitem::addedToWindow() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *item = new TestItem(window.rootItem()); + QQuickItem *item = new TestItem(window.contentItem()); QQuickItem *tree = new TestItem; QQuickItem *c1 = new TestItem(tree); @@ -468,7 +468,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[c1].set(false, false); focusState[c2].set(true, true); focusState.active(c2); @@ -491,7 +491,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[c1].set(false, false); focusState[c2].set(true, false); FVERIFY(); @@ -521,7 +521,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[tree].set(true, true); focusState[c1].set(false, false); focusState[c2].set(true, true); @@ -533,7 +533,7 @@ void tst_qquickitem::addedToWindow() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); QQuickItem *tree = new TestFocusScope; QQuickItem *c1 = new TestItem(tree); QQuickItem *c2 = new TestItem(tree); @@ -551,7 +551,7 @@ void tst_qquickitem::addedToWindow() focusState.active(child); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[tree].set(false, false); focusState[c1].set(false, false); focusState[c2].set(true, false); @@ -573,7 +573,7 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); FocusState focusState; focusState << child; @@ -595,8 +595,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestItem(window.contentItem()); FocusState focusState; focusState << child << child2; @@ -616,8 +616,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child); FocusState focusState; @@ -638,8 +638,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child2); FocusState focusState; @@ -660,8 +660,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child2); FocusState focusState; @@ -686,7 +686,7 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *item = new TestFocusScope(window.rootItem()); + QQuickItem *item = new TestFocusScope(window.contentItem()); QQuickItem *child = new TestItem(item); QQuickItem *child2 = new TestItem; @@ -709,7 +709,7 @@ void tst_qquickitem::changeParent() focusState.remove(child); delete child; - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); focusState[item].set(true, true); focusState.active(item); FVERIFY(); @@ -777,7 +777,7 @@ void tst_qquickitem::parentItemWithFocus() focusState[&child].set(false, false); FVERIFY(); - parent.setParentItem(window.rootItem()); + parent.setParentItem(window.contentItem()); focusState[&parent].set(true, true); focusState[&child].set(false, false); focusState.active(&parent); @@ -810,7 +810,7 @@ void tst_qquickitem::parentItemWithFocus() focusState[&grandchild].set(false, false); FVERIFY(); - parent.setParentItem(window.rootItem()); + parent.setParentItem(window.contentItem()); focusState[&parent].set(true, true); focusState[&child].set(false, false); focusState[&grandchild].set(false, false); @@ -858,7 +858,7 @@ void tst_qquickitem::reparentFocusedItem() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem parent(window.rootItem()); + QQuickItem parent(window.contentItem()); QQuickItem child(&parent); QQuickItem sibling(&parent); QQuickItem grandchild(&child); @@ -1035,12 +1035,12 @@ void tst_qquickitem::enabledFocus() QCOMPARE(root.hasFocus(), true); QCOMPARE(root.hasActiveFocus(), false); - root.setParentItem(window.rootItem()); + root.setParentItem(window.contentItem()); QCOMPARE(root.isEnabled(), false); QCOMPARE(root.hasFocus(), true); QCOMPARE(root.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); root.setEnabled(true); QCOMPARE(root.isEnabled(), true); @@ -1108,7 +1108,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child1.isEnabled(), true); QCOMPARE(child1.hasFocus(), true); QCOMPARE(child1.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); child2.forceActiveFocus(); QCOMPARE(root.isEnabled(), true); @@ -1132,7 +1132,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child2.isEnabled(), false); QCOMPARE(child2.hasFocus(), true); QCOMPARE(child2.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); child1.forceActiveFocus(); QCOMPARE(root.isEnabled(), false); @@ -1144,7 +1144,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child2.isEnabled(), false); QCOMPARE(child2.hasFocus(), false); QCOMPARE(child2.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); root.setEnabled(true); QCOMPARE(root.isEnabled(), true); @@ -1168,13 +1168,13 @@ void tst_qquickitem::mouseGrab() TestItem *child1 = new TestItem; child1->setAcceptedMouseButtons(Qt::LeftButton); child1->setSize(QSizeF(200, 100)); - child1->setParentItem(window->rootItem()); + child1->setParentItem(window->contentItem()); TestItem *child2 = new TestItem; child2->setAcceptedMouseButtons(Qt::LeftButton); child2->setY(51); child2->setSize(QSizeF(200, 100)); - child2->setParentItem(window->rootItem()); + child2->setParentItem(window->contentItem()); QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50)); QTest::qWait(100); @@ -1253,7 +1253,7 @@ void tst_qquickitem::touchEventAcceptIgnore() TestItem *item = new TestItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->acceptIncomingTouchEvents = itemSupportsTouch; static QTouchDevice* device = 0; @@ -1335,7 +1335,7 @@ void tst_qquickitem::polishOutsideAnimation() window->resize(200, 200); window->show(); - TestPolishItem *item = new TestPolishItem(window->rootItem()); + TestPolishItem *item = new TestPolishItem(window->contentItem()); item->setSize(QSizeF(200, 100)); QTest::qWait(50); @@ -1384,7 +1384,7 @@ void tst_qquickitem::wheelEvent() TestItem *item = new TestItem; item->setSize(QSizeF(200, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->setEnabled(enabled); item->setVisible(visible); @@ -1470,7 +1470,7 @@ void tst_qquickitem::hoverEvent() HoverItem *item = new HoverItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->setEnabled(enabled); item->setVisible(visible); @@ -1509,7 +1509,7 @@ void tst_qquickitem::hoverEventInParent() window->resize(200, 200); window->show(); - HoverItem *parentItem = new HoverItem(window->rootItem()); + HoverItem *parentItem = new HoverItem(window->contentItem()); parentItem->setSize(QSizeF(200, 200)); parentItem->setAcceptHoverEvents(true); @@ -1670,7 +1670,7 @@ void tst_qquickitem::acceptedMouseButtons() QQuickWindow window; item.setSize(QSizeF(200,100)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50, 50)); QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50, 50)); diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 61762cb688..fdf834ce08 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -259,7 +259,7 @@ void tst_QQuickItemLayer::layerVisibility() QQuickView view; view.setSource(testFileUrl("Visible.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerVisible", visible); child->setProperty("layerEffect", effect); child->setProperty("layerOpacity", opacity); @@ -305,7 +305,7 @@ void tst_QQuickItemLayer::layerZOrder() QQuickView view; view.setSource(testFileUrl("ZOrder.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerEffect", effect); view.show(); @@ -340,7 +340,7 @@ void tst_QQuickItemLayer::changeZOrder() QQuickView view; view.setSource(testFileUrl("ZOrderChange.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerEnabled", layered); child->setProperty("layerEffect", effect); child->setProperty("layerZ", 1); diff --git a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp index c3bf77da29..03e4b4084c 100644 --- a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp +++ b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp @@ -110,7 +110,7 @@ void tst_QQuickPaintedItem::initTestCase() void tst_QQuickPaintedItem::update() { TestPaintedItem item; - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(hasDirtyContentFlag(&item), false); item.update(); @@ -149,7 +149,7 @@ void tst_QQuickPaintedItem::opaquePainting() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.opaquePainting(), false); @@ -187,7 +187,7 @@ void tst_QQuickPaintedItem::antialiasing() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.antialiasing(), false); @@ -225,7 +225,7 @@ void tst_QQuickPaintedItem::mipmap() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.mipmap(), false); @@ -263,7 +263,7 @@ void tst_QQuickPaintedItem::performanceHints() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.performanceHints(), QQuickPaintedItem::PerformanceHints()); @@ -332,7 +332,7 @@ void tst_QQuickPaintedItem::contentScale() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QSignalSpy spy(&item, SIGNAL(contentsScaleChanged())); @@ -376,7 +376,7 @@ void tst_QQuickPaintedItem::contentsBoundingRect() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.contentsBoundingRect(), QRectF(0, 0, 320, 240)); @@ -414,7 +414,7 @@ void tst_QQuickPaintedItem::fillColor() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QSignalSpy spy(&item, SIGNAL(fillColorChanged())); diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index cb161c0eeb..b9a18eec01 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -1481,13 +1481,13 @@ void tst_qquickpositioners::test_repeater() { QQuickView *window = createView(testFile("repeatertest.qml")); - QQuickRectangle *one = findItem(window->rootItem(), "one"); + QQuickRectangle *one = findItem(window->contentItem(), "one"); QVERIFY(one != 0); - QQuickRectangle *two = findItem(window->rootItem(), "two"); + QQuickRectangle *two = findItem(window->contentItem(), "two"); QVERIFY(two != 0); - QQuickRectangle *three = findItem(window->rootItem(), "three"); + QQuickRectangle *three = findItem(window->contentItem(), "three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 0f69009815..a5a5efb2d0 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -1191,7 +1191,7 @@ void tst_qquicktextedit::focusOnPress() QQuickWindow window; window.resize(100, 50); - textEditObject->setParentItem(window.rootItem()); + textEditObject->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -2903,7 +2903,7 @@ void tst_qquicktextedit::openInputPanel() anotherEdit.setFocus(false); QVERIFY(qApp->focusObject() != &anotherEdit); - QCOMPARE(view.activeFocusItem(), view.rootItem()); + QCOMPARE(view.activeFocusItem(), view.contentItem()); anotherEdit.setFocus(true); qApp->inputMethod()->hide(); @@ -4253,7 +4253,7 @@ void tst_qquicktextedit::keySequence() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4416,7 +4416,7 @@ void tst_qquicktextedit::undo() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4502,7 +4502,7 @@ void tst_qquicktextedit::redo() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4726,7 +4726,7 @@ void tst_qquicktextedit::undo_keypressevents() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 1d65cef99b..3c9e8821d3 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -2502,7 +2502,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -3297,7 +3297,7 @@ void tst_qquicktextinput::focusOnPress() QQuickWindow window; window.resize(100, 50); - textInputObject->setParentItem(window.rootItem()); + textInputObject->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -3405,7 +3405,7 @@ void tst_qquicktextinput::openInputPanel() anotherInput.setFocus(false); QVERIFY(qApp->focusObject() != &anotherInput); - QCOMPARE(view.activeFocusItem(), view.rootItem()); + QCOMPARE(view.activeFocusItem(), view.contentItem()); anotherInput.setFocus(true); qApp->inputMethod()->hide(); @@ -3449,7 +3449,7 @@ void tst_qquicktextinput::setHAlignClearCache() QQuickView view; MyTextInput input; input.setText("Hello world"); - input.setParentItem(view.rootItem()); + input.setParentItem(view.contentItem()); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowActive(&view); @@ -3469,8 +3469,8 @@ void tst_qquicktextinput::focusOutClearSelection() QQuickTextInput input2; input.setText(QLatin1String("Hello world")); input.setFocus(true); - input2.setParentItem(view.rootItem()); - input.setParentItem(view.rootItem()); + input2.setParentItem(view.contentItem()); + input.setParentItem(view.contentItem()); input.componentComplete(); input2.componentComplete(); view.show(); @@ -4967,7 +4967,7 @@ void tst_qquicktextinput::keySequence() textInput->setEchoMode(echoMode); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5128,7 +5128,7 @@ void tst_qquicktextinput::undo() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5214,7 +5214,7 @@ void tst_qquicktextinput::redo() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5546,7 +5546,7 @@ void tst_qquicktextinput::undo_keypressevents() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5953,7 +5953,7 @@ void tst_qquicktextinput::setInputMask() textInput->insert(0, input); } else { QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -6083,7 +6083,7 @@ void tst_qquicktextinput::keypress_inputMask() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 2b60ac3733..78ff64da07 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -956,7 +956,7 @@ void tst_qquickvisualdatamodel::itemsDestroyed() view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - QVERIFY(delegate = findItem(view.rootItem(), "delegate", 1)); + QVERIFY(delegate = findItem(view.contentItem(), "delegate", 1)); } QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QVERIFY(!delegate); @@ -3073,7 +3073,7 @@ void tst_qquickvisualdatamodel::insert() QScopedPointer object(component.create()); QQuickListView *listView = qobject_cast(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); @@ -3537,7 +3537,7 @@ void tst_qquickvisualdatamodel::resolve() QScopedPointer object(component.create()); QQuickListView *listView = qobject_cast(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); @@ -3937,7 +3937,7 @@ void tst_qquickvisualdatamodel::warnings() QScopedPointer object(component.create()); QQuickListView *listView = qobject_cast(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 04bb5800f3..c108ac4562 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -120,11 +120,11 @@ public: , m_rootItem(0) { } - Q_INVOKABLE QQuickItem *rootItem() + Q_INVOKABLE QQuickItem *contentItem() { if (!m_rootItem) { QQuickWindowPrivate *c = QQuickWindowPrivate::get(window()); - m_rootItem = c->rootItem; + m_rootItem = c->contentItem; QObject::connect(m_rootItem, SIGNAL(destroyed()), this, SLOT(rootItemDestroyed())); } return m_rootItem; @@ -326,7 +326,7 @@ void tst_qquickwindow::constantUpdates() { QQuickWindow window; window.resize(250, 250); - ConstantUpdateItem item(window.rootItem()); + ConstantUpdateItem item(window.contentItem()); window.show(); QTRY_VERIFY(item.iterations > 60); } @@ -343,7 +343,7 @@ void tst_qquickwindow::touchEvent_basic() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -472,7 +472,7 @@ void tst_qquickwindow::touchEvent_propagation() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -605,7 +605,7 @@ void tst_qquickwindow::touchEvent_cancel() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); @@ -638,7 +638,7 @@ void tst_qquickwindow::touchEvent_reentrant() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->spinLoopWhenPressed = true; // will call processEvents() from the touch handler @@ -676,7 +676,7 @@ void tst_qquickwindow::touchEvent_velocity() QVERIFY(QTest::qWaitForWindowExposed(window)); QTest::qWait(10); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); @@ -732,7 +732,7 @@ void tst_qquickwindow::mouseFromTouch_basic() QVERIFY(QTest::qWaitForWindowExposed(window)); QTest::qWait(10); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); item->acceptTouchEvents = false; @@ -788,7 +788,7 @@ void tst_qquickwindow::clearWindow() { QQuickWindow *window = new QQuickWindow; QQuickItem *item = new QQuickItem; - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); QVERIFY(item->window() == window); @@ -810,7 +810,7 @@ void tst_qquickwindow::mouseFiltering() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -1018,7 +1018,7 @@ void tst_qquickwindow::ignoreUnhandledMouseEvents() QQuickItem* item = new QQuickItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); { QMouseEvent me(QEvent::MouseButtonPress, QPointF(50, 50), Qt::LeftButton, Qt::LeftButton, @@ -1079,7 +1079,7 @@ void tst_qquickwindow::cursor() QQuickItem parentItem; parentItem.setPos(QPointF(0, 0)); parentItem.setSize(QSizeF(180, 180)); - parentItem.setParentItem(window.rootItem()); + parentItem.setParentItem(window.contentItem()); QQuickItem childItem; childItem.setPos(QPointF(60, 90)); @@ -1090,7 +1090,7 @@ void tst_qquickwindow::cursor() clippingItem.setPos(QPointF(120, 120)); clippingItem.setSize(QSizeF(180, 180)); clippingItem.setClip(true); - clippingItem.setParentItem(window.rootItem()); + clippingItem.setParentItem(window.contentItem()); QQuickItem clippedItem; clippedItem.setPos(QPointF(-30, -30)); -- cgit v1.2.3 From 03c10cbfbe853a1a0790b419242aedabc655b0dc Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Mon, 15 Oct 2012 14:04:20 +0200 Subject: Doc: Changed the title to fix broken links Change-Id: I84bdb335980fdeae0c91021179ede19eae79e811 Reviewed-by: Jerome Pasion --- src/quick/doc/src/appdevguide/porting.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/doc/src/appdevguide/porting.qdoc b/src/quick/doc/src/appdevguide/porting.qdoc index 5843800363..3ac13cd255 100644 --- a/src/quick/doc/src/appdevguide/porting.qdoc +++ b/src/quick/doc/src/appdevguide/porting.qdoc @@ -27,7 +27,7 @@ /*! \page qtquick-porting-qt5.html -\title QML Application in Qt 5 +\title QML Applications in Qt 5 \brief Lists the Qt 5.0 changes that affect the existing QML applications When porting QML-related code from Qt 4.8 to Qt 5, application developers should be aware that -- cgit v1.2.3 From 4578a6fcba8b590a4a9b75559f7fcb80c3037c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 16 Oct 2012 19:41:16 +0200 Subject: Use the shared boilerplate code in the tweetsearch demo Without the shared boilerplate code, the demo will not run unless the application is launched from the directory containing the QML files. Also, it improves consistency to use the same code as with the other examples. Change-Id: Ic3bc358c13cdee4310aaaf7daf4c645c4709027e Reviewed-by: Robin Burchell --- examples/demos/tweetsearch/main.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/examples/demos/tweetsearch/main.cpp b/examples/demos/tweetsearch/main.cpp index 211d3eb07b..8b1d59679c 100644 --- a/examples/demos/tweetsearch/main.cpp +++ b/examples/demos/tweetsearch/main.cpp @@ -37,27 +37,5 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include -#include -#include -#include - -void usage() -{ - exit(0); -} - -int main(int argc, char* argv[]) -{ - QGuiApplication app(argc,argv); - QQuickView view; - QUrl launchFile = QUrl::fromLocalFile(QLatin1String("tweetsearch.qml")); - if (app.arguments().contains(QLatin1String("-help"))) - usage(); - view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit())); - view.setSource(launchFile); - view.show(); - return app.exec(); -} - +#include "../../shared/shared.h" +DECLARATIVE_EXAMPLE_MAIN(tweetsearch) -- cgit v1.2.3 From b495a61c6b0c79d20d98428a34750ad30839e7e4 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 15 Oct 2012 17:18:46 +0200 Subject: QQuickScreen attached obj handles screenChanged and geometryChanged MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sizeChanged is replaced with geometryChanged. Given a Window, it also needs to connect to the Window's screenChanged signal. The result is that if the screen is changed after the QQuickView is created, the Screen attached object will be updated. Change-Id: I64473dd960376b861eb50e3e5a1a296d0030e766 Reviewed-by: Samuel Rødal --- src/quick/items/qquickscreen.cpp | 25 ++++++++++++++++++------- src/quick/items/qquickscreen_p.h | 4 ++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index faada2d5b1..139cd72168 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -102,7 +102,8 @@ QT_BEGIN_NAMESPACE QQuickScreenAttached::QQuickScreenAttached(QObject* attachee) : QObject(attachee) - , m_screen(0) + , m_screen(NULL) + , m_window(NULL) { m_attachee = qobject_cast(attachee); @@ -149,17 +150,27 @@ int QQuickScreenAttached::angleBetween(int a, int b) return m_screen->angleBetween((Qt::ScreenOrientation)a,(Qt::ScreenOrientation)b); } -void QQuickScreenAttached::windowChanged(QQuickWindow* c)//Called by QQuickItemPrivate::initWindow +void QQuickScreenAttached::windowChanged(QQuickWindow* c) { - QScreen* screen = c ? c->screen() : 0; + if (m_window) + disconnect(m_window, SIGNAL(screenChanged(QScreen*)), this, SLOT(screenChanged(QScreen*))); + m_window = c; + screenChanged(c ? c->screen() : NULL); + if (c) + connect(c, SIGNAL(screenChanged(QScreen*)), this, SLOT(screenChanged(QScreen*))); +} + +void QQuickScreenAttached::screenChanged(QScreen *screen) +{ + //qDebug() << "QQuickScreenAttached::screenChanged" << (screen ? screen->name() : QString::fromLatin1("null")); if (screen != m_screen) { QScreen* oldScreen = m_screen; m_screen = screen; if (oldScreen) { - disconnect(oldScreen, SIGNAL(sizeChanged(QSize)), + disconnect(oldScreen, SIGNAL(geometryChanged(QRect)), this, SIGNAL(widthChanged())); - disconnect(oldScreen, SIGNAL(sizeChanged(QSize)), + disconnect(oldScreen, SIGNAL(geometryChanged(QRect)), this, SIGNAL(heightChanged())); disconnect(oldScreen, SIGNAL(orientationChanged(Qt::ScreenOrientation)), this, SIGNAL(orientationChanged())); @@ -181,9 +192,9 @@ void QQuickScreenAttached::windowChanged(QQuickWindow* c)//Called by QQuickItemP emit primaryOrientationChanged(); - connect(screen, SIGNAL(sizeChanged(QSize)), + connect(screen, SIGNAL(geometryChanged(QRect)), this, SIGNAL(widthChanged())); - connect(screen, SIGNAL(sizeChanged(QSize)), + connect(screen, SIGNAL(geometryChanged(QRect)), this, SIGNAL(heightChanged())); connect(screen, SIGNAL(orientationChanged(Qt::ScreenOrientation)), this, SIGNAL(orientationChanged())); diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 55ac9796a6..46ea7ee137 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -84,8 +84,12 @@ Q_SIGNALS: void primaryOrientationChanged(); void orientationChanged(); +protected slots: + void screenChanged(QScreen*); + private: QScreen* m_screen; + QQuickWindow* m_window; QQuickItem* m_attachee; }; -- cgit v1.2.3 From 62e8934fe3879665d14092543ad06bb17ce9071f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 16 Oct 2012 20:33:55 +0200 Subject: Make Qt.quit() from inside QML work in the examples Without this patch, the samegame's quit button does not work. Change-Id: I904832d018d589e90564534ac1eca02e0dbb54fc Reviewed-by: Friedemann Kleint Reviewed-by: Kai Koehne --- examples/shared/shared.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/shared/shared.h b/examples/shared/shared.h index 0e9395a108..bf3857f896 100644 --- a/examples/shared/shared.h +++ b/examples/shared/shared.h @@ -39,6 +39,7 @@ ****************************************************************************/ #include #include +#include #include #define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \ {\ @@ -68,6 +69,7 @@ qWarning("Could not find file '%s'", qPrintable(QDir::toNativeSeparators(fileName)));\ return -1;\ }\ + view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\ view.setSource(QUrl::fromLocalFile(fileName));\ view.show();\ return app.exec();\ -- cgit v1.2.3 From 595fefdc83d27cc9683e1cee517880395898a51b Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 16 Oct 2012 18:39:11 +0200 Subject: Doc: Cleaned up \module and \qmlmodule page for Qt Quick and Qt QML. -Qt Quick: used a regular page instead of \qmlmodule -Cleaned up titles and membership Change-Id: I8ae24fec203ea675d213bd0df6105d0c2abd8164 Reviewed-by: Martin Smith --- src/qml/doc/src/cppintegration/extending-tutorial.qdoc | 3 +-- src/qml/doc/src/qtqml-cpp.qdoc | 4 +--- src/quick/doc/src/qmltypereference.qdoc | 3 ++- src/quick/doc/src/qtquick-cpp.qdoc | 3 ++- src/quick/doc/src/qtquick.qdoc | 5 ++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc index 3bf8adc7b3..5787977bc4 100644 --- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc +++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc @@ -67,7 +67,7 @@ and \l {qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}. \example examples/tutorials/extending/chapter1-basics A common task when extending QML is to provide a new QML type that supports some - custom functionality beyond what is provided by the built-in \l {QML Types Provided by Qt Quick}{QtQuick types}. + custom functionality beyond what is provided by the built-in \l {Qt Quick QML Types}{QtQuick types}. For example, this could be done to implement particular data models, or provide elements with custom painting and drawing capabilities, or access system features like network programming that are not accessible through built-in QML features. @@ -479,4 +479,3 @@ Or randomly add and remove slices from time to time using \l{Property Value Sour See the \l{Integrating QML and C++} documentation for more information. */ - diff --git a/src/qml/doc/src/qtqml-cpp.qdoc b/src/qml/doc/src/qtqml-cpp.qdoc index 4a7ea0c1bb..5fe9292588 100644 --- a/src/qml/doc/src/qtqml-cpp.qdoc +++ b/src/qml/doc/src/qtqml-cpp.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! \module QtQml -\title Qt QML Module - C++ Classes +\title Qt QML Module C++ Classes \brief The C++ API provided by the Qt QML module To include the definitions of the module's classes, use the @@ -46,5 +46,3 @@ QT += qml For more information on the Qt QML module, see the \l{Qt QML} module documentation. */ - - diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index e2bb247af8..c0b4968ce3 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -27,7 +27,8 @@ /*! \page qtquick-qmltypereference.html -\title QML Types Provided by Qt Quick +\title Qt Quick QML Types +\ingroup qmlmodules \brief Description of the QML types provided by the Qt Quick module The \c QtQuick QML module provides a variety of QML types for creating user diff --git a/src/quick/doc/src/qtquick-cpp.qdoc b/src/quick/doc/src/qtquick-cpp.qdoc index 6fc53c9f13..54a37f62b6 100644 --- a/src/quick/doc/src/qtquick-cpp.qdoc +++ b/src/quick/doc/src/qtquick-cpp.qdoc @@ -26,7 +26,8 @@ ****************************************************************************/ /*! \module QtQuick - \title Qt Quick Module - C++ Classes + \title Qt Quick Module C++ Classes + \ingroup modules \brief The Qt Quick module provides classes for embedding Qt Quick in Qt/C++ applications. diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc index 5ce289c9e9..1d24e33cc4 100644 --- a/src/quick/doc/src/qtquick.qdoc +++ b/src/quick/doc/src/qtquick.qdoc @@ -39,7 +39,7 @@ visual components, receiving user input, creating data models and views and delayed object instantiation. The Qt Quick module provides both the \c QtQuick QML module, which supplies -\l{QML Types Provided by Qt Quick}{a set of QML types} for creating user +\l{Qt Quick QML Types}{a set of QML types} for creating user interfaces with the QML language, and the \c QtQuick C++ module, which supplies \l{Qt Quick Module - C++ Classes}{a set of C++ APIs} for integrating with user interfaces and applications built with QML and the \c QtQuick QML module. @@ -113,7 +113,7 @@ Additional Qt Quick information: \list \li \l{Qt Quick Module - C++ Classes} - the C++ API provided by the Qt Quick module -\li \l{QML Types Provided by Qt Quick} - a list of QML types provided by the +\li \l{Qt Quick QML Types} - a list of QML types provided by the \c{QtQuick} import \list \li \l{QML Module QtQuick.XmlListModel 2.0}{XML List Model} - contains types @@ -137,4 +137,3 @@ Further information for writing QML applications: Qt QML module, which provides the QML engine and language infrastructure \endlist */ - -- cgit v1.2.3 From 9415ac6c4996f0d5611d907d23de00600b18d65b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 16 Oct 2012 12:58:26 +0200 Subject: QQuickItem: handle QEvent::StyleAnimationUpdate Change-Id: Id5c4de6bdcd395a1e32449e69d773e9a35fab4c9 Reviewed-by: Gabriel de Dietrich --- src/quick/items/qquickitem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 783994666c..8985b7b7f8 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -6508,6 +6508,9 @@ bool QQuickItem::event(QEvent *ev) } else if (ev->type() == QEvent::InputMethod) { inputMethodEvent(static_cast(ev)); return true; + } else if (ev->type() == QEvent::StyleAnimationUpdate) { + update(); + return true; } return QObject::event(ev); } -- cgit v1.2.3 From c4503ab9be4748e6f6200dca9e28a6f2af4dec68 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Thu, 18 Oct 2012 11:41:42 +0200 Subject: Temporarily skip tst_QJSEngine::stringObjects test Expected failures of this test block to land a patch to QtJSBackend that fixes them. Change-Id: If5c73cb668f9cc05e605e4f37c0dfabc0eecb5a8 Reviewed-by: Simon Hausmann --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 840030daba..7892290695 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -1955,6 +1955,8 @@ void tst_QJSEngine::stringObjects() { // See ECMA-262 Section 15.5, "String Objects". + QSKIP("This test is temporarily skipped until fix is not landed: https://codereview.qt-project.org/#change,37284"); + QJSEngine eng; QString str("ciao"); // in C++ -- cgit v1.2.3 From accda18246c0116afe27275deabbc91f59506555 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 15 Oct 2012 18:34:10 +0200 Subject: Fix list functions for the data property The Qml Designer needs this functions. Task-number: QTCREATORBUG-8039 Change-Id: I6e072723630cf971ad3eda921497699611ae934e Reviewed-by: Thomas Hartmann --- src/quick/items/qquickitem.cpp | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 8985b7b7f8..62fc81fb67 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2509,25 +2509,41 @@ void QQuickItemPrivate::data_append(QQmlListProperty *prop, QObject *o) automatically assigned to this property. */ -int QQuickItemPrivate::data_count(QQmlListProperty *prop) +int QQuickItemPrivate::data_count(QQmlListProperty *property) { - Q_UNUSED(prop); - // XXX todo - return 0; + QQuickItem *item = static_cast(property->object); + QQuickItemPrivate *privateItem = QQuickItemPrivate::get(item); + QQmlListProperty resourcesProperty = privateItem->resources(); + QQmlListProperty childrenProperty = privateItem->children(); + + return resources_count(&resourcesProperty) + children_count(&childrenProperty); } -QObject *QQuickItemPrivate::data_at(QQmlListProperty *prop, int i) +QObject *QQuickItemPrivate::data_at(QQmlListProperty *property, int i) { - Q_UNUSED(prop); - Q_UNUSED(i); - // XXX todo + QQuickItem *item = static_cast(property->object); + QQuickItemPrivate *privateItem = QQuickItemPrivate::get(item); + QQmlListProperty resourcesProperty = privateItem->resources(); + QQmlListProperty childrenProperty = privateItem->children(); + + int resourcesCount = resources_count(&resourcesProperty); + if (i < resourcesCount) + return resources_at(&resourcesProperty, i); + const int j = i - resourcesCount; + if (j < children_count(&childrenProperty)) + return children_at(&childrenProperty, j); return 0; } -void QQuickItemPrivate::data_clear(QQmlListProperty *prop) +void QQuickItemPrivate::data_clear(QQmlListProperty *property) { - Q_UNUSED(prop); - // XXX todo + QQuickItem *item = static_cast(property->object); + QQuickItemPrivate *privateItem = QQuickItemPrivate::get(item); + QQmlListProperty resourcesProperty = privateItem->resources(); + QQmlListProperty childrenProperty = privateItem->children(); + + resources_clear(&resourcesProperty); + children_clear(&childrenProperty); } QObject *QQuickItemPrivate::resources_at(QQmlListProperty *prop, int index) -- cgit v1.2.3 From 5c4108e2f0bcd8c116882eeb4aa96dc02cd22c06 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 15 Oct 2012 10:54:54 +0300 Subject: Fix QQuickTextInput::moveCursorSelection() by using fixed QTextBoundaryFinder behavior. Update QQuickTextInput autotests. Task-number: QTBUG-11365 Change-Id: I81761c019e2fe80c9795fe54a2a990bfc5d4b709 Reviewed-by: Lars Knoll Reviewed-by: Kai Koehne --- src/quick/items/qquicktextinput.cpp | 9 +-- tests/auto/quick/qquicktextedit/qquicktextedit.pro | 2 - .../auto/quick/qquicktextinput/qquicktextinput.pro | 2 - .../quick/qquicktextinput/tst_qquicktextinput.cpp | 85 +++++++++++----------- 4 files changed, 47 insertions(+), 51 deletions(-) diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index e55ba73f4f..22551c9d4c 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -2378,8 +2378,8 @@ void QQuickTextInput::moveCursorSelection(int pos, SelectionMode mode) finder.setPosition(anchor); const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons(); - if (anchor < text.length() && (!(reasons & QTextBoundaryFinder::StartWord) - || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor))) { + if (anchor < text.length() && (reasons == QTextBoundaryFinder::NotAtBoundary + || (reasons & QTextBoundaryFinder::EndOfItem))) { finder.toPreviousBoundary(); } anchor = finder.position() != -1 ? finder.position() : 0; @@ -2396,11 +2396,10 @@ void QQuickTextInput::moveCursorSelection(int pos, SelectionMode mode) finder.setPosition(anchor); const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons(); - if (anchor > 0 && (!(reasons & QTextBoundaryFinder::EndWord) - || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor))) { + if (anchor > 0 && (reasons == QTextBoundaryFinder::NotAtBoundary + || (reasons & QTextBoundaryFinder::StartOfItem))) { finder.toNextBoundary(); } - anchor = finder.position() != -1 ? finder.position() : text.length(); finder.setPosition(pos); diff --git a/tests/auto/quick/qquicktextedit/qquicktextedit.pro b/tests/auto/quick/qquicktextedit/qquicktextedit.pro index 5f352eb8c4..b0621bc554 100644 --- a/tests/auto/quick/qquicktextedit/qquicktextedit.pro +++ b/tests/auto/quick/qquicktextedit/qquicktextedit.pro @@ -13,6 +13,4 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private network-private testlib -CONFIG+=insignificant_test # until QTextBoundaryFinder gets fixed - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/quick/qquicktextinput/qquicktextinput.pro b/tests/auto/quick/qquicktextinput/qquicktextinput.pro index 53d2a30004..3240d99e90 100644 --- a/tests/auto/quick/qquicktextinput/qquicktextinput.pro +++ b/tests/auto/quick/qquicktextinput/qquicktextinput.pro @@ -13,6 +13,4 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private testlib -CONFIG+=insignificant_test # until QTextBoundaryFinder gets fixed - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 3c9e8821d3..249755b813 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -911,10 +911,12 @@ void tst_qquicktextinput::moveCursorSelection_data() QTest::newRow("jum<()>ped|words") << standard[0] << 23 << 23 << QQuickTextInput::SelectWords << 23 << 23 << true; - QTest::newRow("Hello<(,)> |words") - << standard[2] << 5 << 6 << QQuickTextInput::SelectWords << 5 << 6 << true; - QTest::newRow("Hello<(, )>world|words,ltr") - << standard[2] << 5 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; + QTest::newRow(" |words,ltr") + << standard[2] << 5 << 6 << QQuickTextInput::SelectWords << 0 << 6 << false; + QTest::newRow("Hello<(,)> |words,rtl") + << standard[2] << 6 << 5 << QQuickTextInput::SelectWords << 5 << 6 << false; + QTest::newRow("world|words,ltr") + << standard[2] << 5 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("Hello<(, )world>|words,rtl") << standard[2] << 7 << 5 << QQuickTextInput::SelectWords << 5 << 12 << false; QTest::newRow("world|words,ltr") @@ -927,35 +929,35 @@ void tst_qquicktextinput::moveCursorSelection_data() << standard[2] << 5 << 5 << QQuickTextInput::SelectWords << 5 << 5 << true; QTest::newRow("Hello,<()>|words") << standard[2] << 6 << 6 << QQuickTextInput::SelectWords << 6 << 6 << true; - QTest::newRow("Hello<,( )>world|words,ltr") - << standard[2] << 6 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; + QTest::newRow("Hello,<( )>world|words,ltr") + << standard[2] << 6 << 7 << QQuickTextInput::SelectWords << 6 << 7 << false; QTest::newRow("Hello,<( )world>|words,rtl") << standard[2] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; - QTest::newRow("Hello<,( world)>|words,ltr") - << standard[2] << 6 << 12 << QQuickTextInput::SelectWords << 5 << 12 << false; - QTest::newRow("Hello,<( world)>|words,rtl") - << standard[2] << 12 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; - QTest::newRow("Hello<,( world!)>|words,ltr") - << standard[2] << 6 << 13 << QQuickTextInput::SelectWords << 5 << 13 << false; - QTest::newRow("Hello,<( world!)>|words,rtl") - << standard[2] << 13 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; - QTest::newRow("Hello<(, world!)>|words") - << standard[2] << 5 << 13 << QQuickTextInput::SelectWords << 5 << 13 << true; - // Fails due to an issue with QTextBoundaryFinder and punctuation at the end of strings. - // QTBUG-11365 - // QTest::newRow("world<(!)>|words") - // << standard[2] << 12 << 13 << QQuickTextInput::SelectWords << 12 << 13 << true; + QTest::newRow("Hello,<( world)>|words") + << standard[2] << 6 << 12 << QQuickTextInput::SelectWords << 6 << 12 << true; + QTest::newRow("Hello,<( world!)>|words") + << standard[2] << 6 << 13 << QQuickTextInput::SelectWords << 6 << 13 << true; + QTest::newRow("|words,ltr") + << standard[2] << 5 << 13 << QQuickTextInput::SelectWords << 0 << 13 << false; + QTest::newRow("Hello<(, world!)>|words,rtl") + << standard[2] << 13 << 5 << QQuickTextInput::SelectWords << 5 << 13 << false; + QTest::newRow("|words,ltr") + << standard[2] << 12 << 13 << QQuickTextInput::SelectWords << 7 << 13 << false; + QTest::newRow("world<(!)>|words,rtl") + << standard[2] << 13 << 12 << QQuickTextInput::SelectWords << 12 << 13 << false; QTest::newRow("world!<()>)|words") << standard[2] << 13 << 13 << QQuickTextInput::SelectWords << 13 << 13 << true; QTest::newRow("world<()>!)|words") << standard[2] << 12 << 12 << QQuickTextInput::SelectWords << 12 << 12 << true; - QTest::newRow("<(,)>olleH |words") - << standard[3] << 7 << 8 << QQuickTextInput::SelectWords << 7 << 8 << true; + QTest::newRow("<(,)>olleH |words,ltr") + << standard[3] << 7 << 8 << QQuickTextInput::SelectWords << 7 << 8 << false; + QTest::newRow("<(,)olleH> |words,rtl") + << standard[3] << 8 << 7 << QQuickTextInput::SelectWords << 7 << 13 << false; QTest::newRow("olleH|words,ltr") << standard[3] << 6 << 8 << QQuickTextInput::SelectWords << 1 << 8 << false; - QTest::newRow("dlrow<( ,)>olleH|words,rtl") - << standard[3] << 8 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; + QTest::newRow("dlrow<( ,)olleH>|words,rtl") + << standard[3] << 8 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; QTest::newRow("|words,ltr") << standard[3] << 6 << 10 << QQuickTextInput::SelectWords << 1 << 13 << false; QTest::newRow("dlrow<( ,ol)leH>|words,rtl") @@ -968,20 +970,20 @@ void tst_qquicktextinput::moveCursorSelection_data() << standard[3] << 7 << 7 << QQuickTextInput::SelectWords << 7 << 7 << true; QTest::newRow(",olleH|words,ltr") << standard[3] << 6 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; - QTest::newRow("dlrow<( ),>olleH|words,rtl") - << standard[3] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; - QTest::newRow("<(dlrow )>,olleH|words,ltr") - << standard[3] << 1 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; - QTest::newRow("<(dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 1 << QQuickTextInput::SelectWords << 1 << 8 << false; - QTest::newRow("<(!dlrow )>,olleH|words,ltr") - << standard[3] << 0 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; - QTest::newRow("<(!dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 0 << QQuickTextInput::SelectWords << 0 << 8 << false; - QTest::newRow("(!dlrow ,)olleH|words") - << standard[3] << 0 << 8 << QQuickTextInput::SelectWords << 0 << 8 << true; - QTest::newRow("<(!)>dlrow|words") - << standard[3] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << true; + QTest::newRow("dlrow<( )>,olleH|words,rtl") + << standard[3] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 7 << false; + QTest::newRow("<(dlrow )>,olleH|words") + << standard[3] << 1 << 7 << QQuickTextInput::SelectWords << 1 << 7 << true; + QTest::newRow("<(!dlrow )>,olleH|words") + << standard[3] << 0 << 7 << QQuickTextInput::SelectWords << 0 << 7 << true; + QTest::newRow("<(!dlrow ,)>olleH|words,ltr") + << standard[3] << 0 << 8 << QQuickTextInput::SelectWords << 0 << 8 << false; + QTest::newRow("<(!dlrow ,)olleH>|words,rtl") + << standard[3] << 8 << 0 << QQuickTextInput::SelectWords << 0 << 13 << false; + QTest::newRow("<(!)>dlrow|words,ltr") + << standard[3] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << false; + QTest::newRow("<(!)dlrow|words,rtl") + << standard[3] << 1 << 0 << QQuickTextInput::SelectWords << 0 << 6 << false; QTest::newRow("<()>!dlrow|words") << standard[3] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << true; QTest::newRow("!<()>dlrow|words") @@ -990,16 +992,15 @@ void tst_qquicktextinput::moveCursorSelection_data() QTest::newRow(" text |words") << standard[4] << 1 << 4 << QQuickTextInput::SelectWords << 1 << 7 << true; QTest::newRow(" spacey |words") - << standard[4] << 11 << 13 << QQuickTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365 + << standard[4] << 11 << 13 << QQuickTextInput::SelectWords << 10 << 14 << true; QTest::newRow("<( )>spacey text |words|ltr") << standard[4] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << false; QTest::newRow("<( )spacey> text |words|rtl") << standard[4] << 1 << 0 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("spacey |words|ltr") << standard[4] << 14 << 15 << QQuickTextInput::SelectWords << 10 << 15 << false; -// QTBUG-11365 -// QTest::newRow("spacey text<( )>|words|rtl") -// << standard[4] << 15 << 14 << QQuickTextInput::SelectWords << 14 << 15 << false; + QTest::newRow("spacey text<( )>|words|rtl") + << standard[4] << 15 << 14 << QQuickTextInput::SelectWords << 14 << 15 << false; QTest::newRow("<()> spacey text |words") << standard[4] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << false; QTest::newRow(" spacey text <()>|words") -- cgit v1.2.3 From 13e1c40b7be52dbb3b82116c514a6e8b6b5499b6 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 16 Oct 2012 16:33:44 +0200 Subject: Add polishItems to the designer support Change-Id: Ibec0b1f6c438f0c7b40c81ec81cd092768701f34 Reviewed-by: Thomas Hartmann --- src/quick/designer/designersupport.cpp | 5 +++++ src/quick/designer/designersupport.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/quick/designer/designersupport.cpp b/src/quick/designer/designersupport.cpp index 55a0b53df7..1b0fea9190 100644 --- a/src/quick/designer/designersupport.cpp +++ b/src/quick/designer/designersupport.cpp @@ -434,4 +434,9 @@ void DesignerSupport::createOpenGLContext(QQuickWindow *window) DesignerWindowManager::createOpenGLContext(window); } +void DesignerSupport::polishItems(QQuickWindow *window) +{ + QQuickWindowPrivate::get(window)->polishItems(); +} + QT_END_NAMESPACE diff --git a/src/quick/designer/designersupport.h b/src/quick/designer/designersupport.h index e27cb3bcb3..723e1067d8 100644 --- a/src/quick/designer/designersupport.h +++ b/src/quick/designer/designersupport.h @@ -148,6 +148,8 @@ public: static void createOpenGLContext(QQuickWindow *window); + static void polishItems(QQuickWindow *window); + private: QHash m_itemTextureHash; }; -- cgit v1.2.3 From 8160e03f99301291cf2dfa964811c12ae0aaaed4 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 19 Oct 2012 09:36:04 +0200 Subject: QQmlOpenMetaObjectType: extend interface for visual designer We need those 3 functions to rebuild OpenMetaObject in the visual designer. Change-Id: I70affe5850f46683a049615b3173a4f30c338401 Reviewed-by: Thomas Hartmann --- src/qml/qml/qqmlopenmetaobject.cpp | 17 +++++++++++++++++ src/qml/qml/qqmlopenmetaobject_p.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/src/qml/qml/qqmlopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp index a92d822774..5928a6dfb7 100644 --- a/src/qml/qml/qqmlopenmetaobject.cpp +++ b/src/qml/qml/qqmlopenmetaobject.cpp @@ -96,6 +96,23 @@ int QQmlOpenMetaObjectType::signalOffset() const return d->signalOffset; } +int QQmlOpenMetaObjectType::propertyCount() const +{ + return d->names.count(); +} + +QByteArray QQmlOpenMetaObjectType::propertyName(int idx) const +{ + Q_ASSERT(idx >= 0 && idx < d->names.count()); + + return d->mob.property(idx).name(); +} + +QMetaObject *QQmlOpenMetaObjectType::metaObject() const +{ + return d->mem; +} + int QQmlOpenMetaObjectType::createProperty(const QByteArray &name) { int id = d->mob.propertyCount(); diff --git a/src/qml/qml/qqmlopenmetaobject_p.h b/src/qml/qml/qqmlopenmetaobject_p.h index 1ca53df772..d037776150 100644 --- a/src/qml/qml/qqmlopenmetaobject_p.h +++ b/src/qml/qml/qqmlopenmetaobject_p.h @@ -69,6 +69,10 @@ public: int propertyOffset() const; int signalOffset() const; + int propertyCount() const; + QByteArray propertyName(int) const; + QMetaObject *metaObject() const; + protected: virtual void propertyCreated(int, QMetaPropertyBuilder &); virtual void clear(); -- cgit v1.2.3 From eafb8c29d37946e263d07067a173861087bd17a9 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Thu, 18 Oct 2012 17:16:40 +0200 Subject: Re-enable tst_QJSEngine::stringObjects test Corresponding bug has been fixed in QtJSBackend thus re-enable test and remove expected failures. Change-Id: I72d6ce31a1c932db29dad0758e0c2654543a5b1f Reviewed-by: Simon Hausmann --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 7892290695..87d2673c2f 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -1955,8 +1955,6 @@ void tst_QJSEngine::stringObjects() { // See ECMA-262 Section 15.5, "String Objects". - QSKIP("This test is temporarily skipped until fix is not landed: https://codereview.qt-project.org/#change,37284"); - QJSEngine eng; QString str("ciao"); // in C++ @@ -1967,7 +1965,6 @@ void tst_QJSEngine::stringObjects() QString pname = QString::number(i); QVERIFY(obj.property(pname).isString()); QCOMPARE(obj.property(pname).toString(), QString(str.at(i))); - QEXPECT_FAIL("", "FIXME: This is V8 issue 862. ECMA script standard 15.5.5.2 compliance.", Continue); QVERIFY(!obj.deleteProperty(pname)); obj.setProperty(pname, 123); QVERIFY(obj.property(pname).isString()); @@ -2006,7 +2003,6 @@ void tst_QJSEngine::stringObjects() QJSValue ret5 = eng.evaluate("delete s[0]"); QVERIFY(ret5.isBool()); - QEXPECT_FAIL("", "FIXME: This is V8 bug, please report it! ECMA script standard 15.5.5.2", Abort); QVERIFY(!ret5.toBool()); QJSValue ret6 = eng.evaluate("delete s[-1]"); -- cgit v1.2.3 From e0521a579e967d670a5f6d7d4a4cd90a6aa56e17 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 4 Oct 2012 12:15:49 +0200 Subject: Change Q_ASSERTs in qquick[threaded]windowmanager.cpp to qWarning(). As they also triggers when a non-existing file is loaded into QML2 or windows have invalid sizes. Change-Id: Iab1ce6c99f2bc2cb360ddaccce539cb97979ad5a Reviewed-by: Kai Koehne Reviewed-by: Christiaan Janssen --- src/quick/items/qquickthreadedwindowmanager.cpp | 25 +++++++++++++++---------- src/quick/items/qquickwindowmanager.cpp | 8 +++++++- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp index 50bd569496..fac4fb034f 100644 --- a/src/quick/items/qquickthreadedwindowmanager.cpp +++ b/src/quick/items/qquickthreadedwindowmanager.cpp @@ -43,6 +43,7 @@ #include "qquickthreadedwindowmanager_p.h" #include +#include #include #include @@ -396,20 +397,24 @@ void QQuickRenderThreadSingleContextWindowManager::run() WindowData *windowData = it.value(); QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window); - Q_ASSERT(windowPrivate->isRenderable()); - - gl->makeCurrent(window); + if (windowPrivate->isRenderable()) { + gl->makeCurrent(window); - if (windowData->viewportSize != windowData->windowSize) { + if (windowData->viewportSize != windowData->windowSize) { #ifdef THREAD_DEBUG - printf(" RenderThread: --- window has changed size...\n"); + printf(" RenderThread: --- window has changed size...\n"); #endif - windowData->viewportSize = windowData->windowSize; - windowData->sizeWasChanged = true; - glViewport(0, 0, windowData->viewportSize.width(), windowData->viewportSize.height()); - } + windowData->viewportSize = windowData->windowSize; + windowData->sizeWasChanged = true; + glViewport(0, 0, windowData->viewportSize.width(), windowData->viewportSize.height()); + } - windowPrivate->syncSceneGraph(); + windowPrivate->syncSceneGraph(); + } else { + qWarning().nospace() + << "Non-renderable window " << window + << " (" << window->geometry() << ")."; + } } inSync = false; diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index dd27182ffe..50887e8e99 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -225,7 +225,13 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window) if (!masterWindow) return; - Q_ASSERT(QQuickWindowPrivate::get(masterWindow)->isRenderable()); + if (!QQuickWindowPrivate::get(masterWindow)->isRenderable()) { + qWarning().nospace() + << "Unable to find a renderable master window " + << masterWindow << "when trying to render" + << window << " (" << window->geometry() << ")."; + return; + } if (!gl) { gl = new QOpenGLContext(); -- cgit v1.2.3 From 7ccd053e63a8d1f2ce361c2b910dce9ac43bb923 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 18 Oct 2012 15:02:36 +0200 Subject: Fix qmltest library. - Avoid hangs (waiting for frameSwapped) and crashes in window managers for empty windows by giving windows a minimum size if they have 0x0 (observed on Mac, Windows). - Polishing, set proper window flags, title, object name, output. Change-Id: Iad5d66c3adbbfe085390132987e95f4c69272831 Reviewed-by: Christiaan Janssen --- src/qmltest/quicktest.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 769deb08f9..0a99654d39 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -118,7 +118,7 @@ void handleCompileErrors(const QFileInfo &fi, QQuickView *view) foreach (const QQmlError &e, errors) { str << " "; if (e.url().isLocalFile()) { - str << e.url().toLocalFile(); + str << QDir::toNativeSeparators(e.url().toLocalFile()); } else { str << e.url().toString(); } @@ -269,6 +269,9 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD // Scan through all of the "tst_*.qml" files and run each of them // in turn with a QQuickView. QQuickView *view = new QQuickView; + view->setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint + | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint + | Qt::WindowCloseButtonHint); QTestRootObject rootobj; QEventLoop eventLoop; QObject::connect(view->engine(), SIGNAL(quit()), @@ -279,12 +282,13 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD (QLatin1String("qtest"), &rootobj); foreach (const QString &path, imports) view->engine()->addImportPath(path); - - foreach (QString file, files) { - QFileInfo fi(file); + foreach (const QString &file, files) { + const QFileInfo fi(file); if (!fi.exists()) continue; + view->setObjectName(fi.baseName()); + view->setWindowTitle(view->objectName()); rootobj.setHasTestCase(false); rootobj.setWindowShown(false); rootobj.hasQuit = false; @@ -306,11 +310,19 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD // an asynchronous test and we need to show the window // and wait for the first frame to be rendered // and then wait for quit indication. + view->setFramePos(QPoint(50, 50)); + if (view->size().isEmpty()) { // Avoid hangs with empty windows. + qWarning().nospace() + << "Test '" << QDir::toNativeSeparators(path) << "' has invalid size " + << view->size() << ", resizing."; + view->resize(200, 200); + } view->show(); if (qWaitForSignal(view, SIGNAL(frameSwapped()))) rootobj.setWindowShown(true); if (!rootobj.hasQuit && rootobj.hasTestCase()) eventLoop.exec(); + view->hide(); } } -- cgit v1.2.3 From 3aaadc5226e8914a562daa1d3d123da929d1affd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 22 Oct 2012 12:56:19 +0200 Subject: Skip flaky subtests of tests/auto/qmltest. - Skip test_key_click() in events/tst_events.qml. - Skip test_pixel pixel/tst_pixel.qml. Task-number: QTBUG-27671 Change-Id: Id78c34244d346910e28a2368f9fe3a41f54b8fb9 Reviewed-by: Janne Anttila Reviewed-by: Stephen Kelly --- tests/auto/qmltest/events/tst_events.qml | 1 + tests/auto/qmltest/pixel/tst_pixel.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/auto/qmltest/events/tst_events.qml b/tests/auto/qmltest/events/tst_events.qml index 059541147e..4c33988960 100644 --- a/tests/auto/qmltest/events/tst_events.qml +++ b/tests/auto/qmltest/events/tst_events.qml @@ -73,6 +73,7 @@ Rectangle { when: windowShown // Must have this line for events to work. function test_key_click() { + skip("test_key_click() is unstable, QTBUG-27671") keyClick(Qt.Key_Left) tryCompare(top, "leftKeyPressed", true, 10000) tryCompare(top, "leftKeyReleased", true, 10000) diff --git a/tests/auto/qmltest/pixel/tst_pixel.qml b/tests/auto/qmltest/pixel/tst_pixel.qml index 67eca074df..f10840b9ab 100644 --- a/tests/auto/qmltest/pixel/tst_pixel.qml +++ b/tests/auto/qmltest/pixel/tst_pixel.qml @@ -52,6 +52,7 @@ Rectangle { when: windowShown function test_pixel() { + skip("test_pixel() is unstable, QTBUG-27671") var img = grabImage(rect); compare(img.pixel(20, 20), Qt.rgba(255, 0, 0, 255)); compare(img.red(1,1), 255); -- cgit v1.2.3 From 29bfe1db8a5b4480317701ae508f0c920c925525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 16 Oct 2012 17:55:46 +0200 Subject: Make Rectangle border be inner instead of centered on the outline. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids awkward situations such as when clipping to a parent item of the same size and makes it easier to reason about the bounding rectangle of the item. Task-number: QTBUG-21341 Change-Id: If015cfbc5792429f4a407fc0547ea71eca779eda Reviewed-by: Lars Knoll Reviewed-by: Shawn Rutledge Reviewed-by: Laszlo Papp Reviewed-by: Tor Arne Vestbø --- src/quick/doc/images/rect-border-width.png | Bin 374 -> 0 bytes .../snippets/qml/rectangle/rect-border-width.qml | 59 --------------------- src/quick/items/qquickrectangle.cpp | 45 +--------------- src/quick/items/qquickrectangle_p.h | 3 -- src/quick/items/qquickrectangle_p_p.h | 4 +- src/quick/scenegraph/qsgdefaultrectanglenode.cpp | 26 +++------ 6 files changed, 10 insertions(+), 127 deletions(-) delete mode 100644 src/quick/doc/images/rect-border-width.png delete mode 100644 src/quick/doc/snippets/qml/rectangle/rect-border-width.qml diff --git a/src/quick/doc/images/rect-border-width.png b/src/quick/doc/images/rect-border-width.png deleted file mode 100644 index e232cf3ebd..0000000000 Binary files a/src/quick/doc/images/rect-border-width.png and /dev/null differ diff --git a/src/quick/doc/snippets/qml/rectangle/rect-border-width.qml b/src/quick/doc/snippets/qml/rectangle/rect-border-width.qml deleted file mode 100644 index 9616ca88d1..0000000000 --- a/src/quick/doc/snippets/qml/rectangle/rect-border-width.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//![0] -Rectangle { - width: 100; height: 100 - color: "lightblue" - - Rectangle { - anchors.fill: parent - anchors.margins: 10 - clip: true - - Rectangle { - anchors.fill: parent - border.width: 1 - } - } -} -//![0] diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp index 333946431b..46d486893e 100644 --- a/src/quick/items/qquickrectangle.cpp +++ b/src/quick/items/qquickrectangle.cpp @@ -317,23 +317,6 @@ QQuickRectangle::QQuickRectangle(QQuickItem *parent) void QQuickRectangle::doUpdate() { - Q_D(QQuickRectangle); - qreal penMargin = 0; - qreal penOffset = 0; - if (d->pen && d->pen->isValid()) { - if (d->pen->pixelAligned()) { - const int pw = qRound(d->pen->width()); - penMargin = qreal(0.5) * pw; - penOffset = (pw & 1) * qreal(0.5); - } else { - penMargin = qreal(0.5) * d->pen->width(); - } - } - if (penMargin != d->penMargin || penOffset != d->penOffset) { - d->penMargin = penMargin; - d->penOffset = penOffset; - d->dirty(QQuickItemPrivate::Size); // update clip - } update(); } @@ -348,21 +331,7 @@ void QQuickRectangle::doUpdate() \note The width of the rectangle's border does not affect the geometry of the rectangle itself or its position relative to other items if anchors are used. - If \c border.width is an odd number, the rectangle is painted at a half-pixel offset to retain - border smoothness. Also, the border is rendered evenly on either side of the - rectangle's boundaries, and the spare pixel is rendered to the right and below the - rectangle (as documented for QRect rendering). This can cause unintended effects if - \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item: - - \div {class="float-right"} - \inlineimage rect-border-width.png - \enddiv - - \snippet qml/rectangle/rect-border-width.qml 0 - - \clearfloat - Here, the innermost rectangle's border is clipped on the bottom and right edges by its - parent. To avoid this, the border width can be set to two instead of one. + The border is rendered within the rectangle's boundaries. */ QQuickPen *QQuickRectangle::border() { @@ -525,16 +494,4 @@ QSGNode *QQuickRectangle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData return rectangle; } -QRectF QQuickRectangle::boundingRect() const -{ - Q_D(const QQuickRectangle); - return QRectF(d->penOffset - d->penMargin, d->penOffset - d->penMargin, - d->width + 2 * d->penMargin, d->height + 2 * d->penMargin); -} - -QRectF QQuickRectangle::clipRect() const -{ - return QQuickRectangle::boundingRect(); -} - QT_END_NAMESPACE diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index 102506a163..481033a445 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -156,9 +156,6 @@ public: qreal radius() const; void setRadius(qreal radius); - virtual QRectF boundingRect() const; - virtual QRectF clipRect() const; - Q_SIGNALS: void colorChanged(); void radiusChanged(); diff --git a/src/quick/items/qquickrectangle_p_p.h b/src/quick/items/qquickrectangle_p_p.h index d8f3d66968..3d4d019327 100644 --- a/src/quick/items/qquickrectangle_p_p.h +++ b/src/quick/items/qquickrectangle_p_p.h @@ -66,7 +66,7 @@ class QQuickRectanglePrivate : public QQuickItemPrivate public: QQuickRectanglePrivate() : - color(Qt::white), gradient(0), pen(0), radius(0), penMargin(0), penOffset(0) + color(Qt::white), gradient(0), pen(0), radius(0) { } @@ -79,8 +79,6 @@ public: QQuickGradient *gradient; QQuickPen *pen; qreal radius; - qreal penMargin; - qreal penOffset; static int doUpdateSlotIdx; QQuickPen *getPen() { diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp index dab855064e..4d5094d526 100644 --- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp +++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp @@ -342,9 +342,12 @@ void QSGDefaultRectangleNode::update() void QSGDefaultRectangleNode::updateGeometry() { - float penWidth = m_aligned ? float(qRound(m_pen_width)) : float(m_pen_width); float width = float(m_rect.width()); float height = float(m_rect.height()); + float penWidth = qMin(qMin(width, height) * 0.5f, float(m_pen_width)); + + if (m_aligned) + penWidth = qRound(penWidth); QSGGeometry *g = geometry(); g->setDrawingMode(GL_TRIANGLE_STRIP); @@ -377,14 +380,9 @@ void QSGDefaultRectangleNode::updateGeometry() float radius = qMin(qMin(width, height) * 0.5f, float(m_radius)); QRectF innerRect = m_rect; innerRect.adjust(radius, radius, -radius, -radius); - if (m_aligned && (int(penWidth) & 1)) { - // Pen width is odd, so add the offset as documented. - innerRect.moveLeft(innerRect.left() + qreal(0.5)); - innerRect.moveTop(innerRect.top() + qreal(0.5)); - } - float innerRadius = radius - penWidth * 0.5f; - float outerRadius = radius + penWidth * 0.5f; + float innerRadius = radius - penWidth * 1.0f; + float outerRadius = radius; float delta = qMin(width, height) * 0.5f; // Number of segments per corner, approximately one per 3 pixels. @@ -630,16 +628,8 @@ void QSGDefaultRectangleNode::updateGeometry() QRectF innerRect = m_rect; QRectF outerRect = m_rect; - if (penWidth) { - if (m_aligned && (int(penWidth) & 1)) { - // Pen width is odd, so add the offset as documented. - innerRect.moveLeft(innerRect.left() + qreal(0.5)); - innerRect.moveTop(innerRect.top() + qreal(0.5)); - outerRect = innerRect; - } - innerRect.adjust(0.5f * penWidth, 0.5f * penWidth, -0.5f * penWidth, -0.5f * penWidth); - outerRect.adjust(-0.5f * penWidth, -0.5f * penWidth, 0.5f * penWidth, 0.5f * penWidth); - } + if (penWidth) + innerRect.adjust(1.0f * penWidth, 1.0f * penWidth, -1.0f * penWidth, -1.0f * penWidth); float delta = qMin(width, height) * 0.5f; int innerVertexCount = 4 + gradientIntersections * 2; -- cgit v1.2.3 From 85fd1c48f32c266168c2e3d8195f81e59a7dc5e6 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 22 Oct 2012 14:16:30 +0200 Subject: Adding invalidate function to QQmlPropertyCache This is required for tooling to update a QMetaObject inside a running QQmlEngine. Change-Id: I26d3aeed57d39c361c150261c4e1a84094e6f657 Reviewed-by: Christiaan Janssen --- src/qml/qml/qqmlpropertycache.cpp | 33 +++++++++++++++++++++++++++++++++ src/qml/qml/qqmlpropertycache_p.h | 1 + 2 files changed, 34 insertions(+) diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index 431a5be01b..c1c4a6c03d 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -848,6 +848,39 @@ void QQmlPropertyCache::update(QQmlEngine *engine, const QMetaObject *metaObject updateRecur(engine,metaObject); } +/*! \internal + invalidates and updates the PropertyCache if the QMetaObject has changed. + This function is used in the tooling to update dynamic properties. +*/ +void QQmlPropertyCache::invalidate(QQmlEngine *engine, const QMetaObject *metaObject) +{ + stringCache.clear(); + propertyIndexCache.clear(); + methodIndexCache.clear(); + signalHandlerIndexCache.clear(); + + _hasPropertyOverrides = false; + argumentsCache = 0; + + int pc = metaObject->propertyCount(); + int mc = metaObject->methodCount(); + int sc = metaObjectSignalCount(metaObject); + int reserve = pc + mc + sc; + + if (parent()) { + propertyIndexCacheStart = parent()->propertyIndexCache.count() + parent()->propertyIndexCacheStart; + methodIndexCacheStart = parent()->methodIndexCache.count() + parent()->methodIndexCacheStart; + signalHandlerIndexCacheStart = parent()->signalHandlerIndexCache.count() + parent()->signalHandlerIndexCacheStart; + stringCache.linkAndReserve(parent()->stringCache, reserve); + append(engine, metaObject, -1); + } else { + propertyIndexCacheStart = 0; + methodIndexCacheStart = 0; + signalHandlerIndexCacheStart = 0; + update(engine, metaObject); + } +} + /*! \internal \a index MUST be in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex(). diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 4310e4ea40..14be99045f 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -247,6 +247,7 @@ public: virtual ~QQmlPropertyCache(); void update(QQmlEngine *, const QMetaObject *); + void invalidate(QQmlEngine *, const QMetaObject *); QQmlPropertyCache *copy(); -- cgit v1.2.3 From 3e9caba478695443669ff880334ea69db6f764eb Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 22 Oct 2012 17:57:05 +0200 Subject: Change qml list interface Change-Id: I185c6f4cef6105544504324c1616b5995c219fe3 Reviewed-by: Christiaan Janssen --- src/particles/qquickparticlegroup.cpp | 4 +- src/qml/qml/qqmllist.cpp | 43 ++++++++++++-- src/qml/qml/qqmllist.h | 10 +++- src/qml/qml/qqmlvme.cpp | 11 +++- src/qml/qml/v8/qv8contextwrapper.cpp | 1 - src/quick/items/qquickitem.cpp | 13 ++--- src/quick/items/qquickvisualdatamodel.cpp | 3 +- src/quick/items/qquickvisualitemmodel.cpp | 42 ++++++++++---- .../qqmllistreference/tst_qqmllistreference.cpp | 66 ++++++++++++++++++++++ tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 3 +- .../tst_qquickvisualdatamodel.cpp | 2 +- 11 files changed, 160 insertions(+), 38 deletions(-) diff --git a/src/particles/qquickparticlegroup.cpp b/src/particles/qquickparticlegroup.cpp index 63d54b0e6c..cae5423379 100644 --- a/src/particles/qquickparticlegroup.cpp +++ b/src/particles/qquickparticlegroup.cpp @@ -109,9 +109,9 @@ QQmlListProperty QQuickParticleGroup::particleChildren() { QQuickParticleSystem* system = qobject_cast(parent()); if (system) - return QQmlListProperty(this, 0, &QQuickParticleSystem::statePropertyRedirect); + return QQmlListProperty(this, 0, &QQuickParticleSystem::statePropertyRedirect, 0, 0, 0); else - return QQmlListProperty(this, 0, &delayedRedirect); + return QQmlListProperty(this, 0, &delayedRedirect, 0, 0, 0); } void QQuickParticleGroup::setSystem(QQuickParticleSystem* arg) diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp index 2aef3f2cd7..e90633ac1a 100644 --- a/src/qml/qml/qqmllist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -253,6 +253,32 @@ bool QQmlListReference::canCount() const return (isValid() && d->property.count); } +/*! + Return true if at(), count(), append() and clear() are implemented, so you can manipulate + the list. + +\sa isReadable(), at(), count(), append(), clear() +*/ +bool QQmlListReference::isManipulable() const +{ + return (isValid() + && d->property.append + && d->property.count + && d->property.at + && d->property.clear); +} + + +/*! + Return true if at() and count() are implemented, so you can access the elements. + +\sa isManipulable(), at(), count() +*/ +bool QQmlListReference::isReadable() const +{ + return (isValid() && d->property.count && d->property.at); +} + /*! Appends \a object to the list. Returns true if the operation succeeded, otherwise false. @@ -365,17 +391,26 @@ writable QList violates QML's memory management rules. However, this constructo can very useful while prototyping. */ +/*! +\fn QQmlListProperty::QQmlListProperty(QObject *object, void *data, + CountFunction count, AtFunction at) + +Construct a readonly QQmlListProperty from a set of operation functions. An opaque \a data handle +may be passed which can be accessed from within the operation functions. The list property +remains valid while \a object exists. +*/ + /*! \fn QQmlListProperty::QQmlListProperty(QObject *object, void *data, AppendFunction append, - CountFunction count = 0, AtFunction at = 0, - ClearFunction clear = 0) + CountFunction count, AtFunction at, + ClearFunction clear) Construct a QQmlListProperty from a set of operation functions. An opaque \a data handle may be passed which can be accessed from within the operation functions. The list property remains valid while \a object exists. -The \a append operation is compulsory and must be provided, while the \a count, \a at and -\a clear methods are optional. +You can pass a null pointer, but than the list will be not designable or changeable by the debugger. +So provide all function, except it is not possible. */ /*! diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index bc2feaf22f..e772022636 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -69,10 +69,11 @@ public: QQmlListProperty(QObject *o, QList &list) : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at), clear(qlist_clear), dummy1(0), dummy2(0) {} - QQmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0, - ClearFunction r = 0) + QQmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c, AtFunction t, + ClearFunction r ) : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {} - + QQmlListProperty(QObject *o, void *d, CountFunction c, AtFunction t) + : object(o), data(d), append(0), count(c), at(t), clear(0), dummy1(0), dummy2(0) {} bool operator==(const QQmlListProperty &o) const { return object == o.object && data == o.data && @@ -132,6 +133,9 @@ public: bool canClear() const; bool canCount() const; + bool isManipulable() const; + bool isReadable() const; + bool append(QObject *) const; QObject *at(int) const; bool clear() const; diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 045869e15d..12de9ffebd 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -941,7 +941,10 @@ QObject *QQmlVME::run(QList *errors, QObject *assign = objects.pop(); const List &list = lists.top(); - list.qListProperty.append((QQmlListProperty*)&list.qListProperty, assign); + if (list.qListProperty.append) + list.qListProperty.append((QQmlListProperty*)&list.qListProperty, assign); + else + VME_EXCEPTION(tr("Cannot assign object to read only list"), -1); QML_END_INSTR(StoreObjectQList) QML_BEGIN_INSTR(AssignObjectList) @@ -959,8 +962,10 @@ QObject *QQmlVME::run(QList *errors, if (!ptr) VME_EXCEPTION(tr("Cannot assign object to list"), instr.line); - - list.qListProperty.append((QQmlListProperty*)&list.qListProperty, ptr); + if (list.qListProperty.append) + list.qListProperty.append((QQmlListProperty*)&list.qListProperty, ptr); + else + VME_EXCEPTION(tr("Cannot assign object to read only list"), -1); QML_END_INSTR(AssignObjectList) QML_BEGIN_INSTR(StoreInterface) diff --git a/src/qml/qml/v8/qv8contextwrapper.cpp b/src/qml/qml/v8/qv8contextwrapper.cpp index b2c60fe7a8..9f18afc5cb 100644 --- a/src/qml/qml/v8/qv8contextwrapper.cpp +++ b/src/qml/qml/v8/qv8contextwrapper.cpp @@ -309,7 +309,6 @@ v8::Handle QV8ContextWrapper::Getter(v8::Local property, const QVariant &value = cp->propertyValues.at(propertyIdx); if (value.userType() == qMetaTypeId >()) { QQmlListProperty prop(context->asQQmlContext(), (void*) qintptr(propertyIdx), - 0, QQmlContextPrivate::context_count, QQmlContextPrivate::context_at); return engine->listWrapper()->newList(prop, qMetaTypeId >()); diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 62fc81fb67..f213111ccd 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2609,12 +2609,6 @@ void QQuickItemPrivate::children_clear(QQmlListProperty *prop) p->childItems.at(0)->setParentItem(0); } -void QQuickItemPrivate::visibleChildren_append(QQmlListProperty*, QQuickItem *self) -{ - // do nothing - qmlInfo(self) << "QQuickItem: visibleChildren property is readonly and cannot be assigned to."; -} - int QQuickItemPrivate::visibleChildren_count(QQmlListProperty *prop) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast(prop->object)); @@ -3744,9 +3738,10 @@ QQmlListProperty QQuickItemPrivate::children() */ QQmlListProperty QQuickItemPrivate::visibleChildren() { - return QQmlListProperty(q_func(), 0, QQuickItemPrivate::visibleChildren_append, - QQuickItemPrivate::visibleChildren_count, - QQuickItemPrivate::visibleChildren_at); + return QQmlListProperty(q_func(), + 0, + QQuickItemPrivate::visibleChildren_count, + QQuickItemPrivate::visibleChildren_at); } diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp index 6f7afd5101..a297ec90df 100644 --- a/src/quick/items/qquickvisualdatamodel.cpp +++ b/src/quick/items/qquickvisualdatamodel.cpp @@ -597,7 +597,8 @@ QQmlListProperty QQuickVisualDataModel::groups() d, QQuickVisualDataModelPrivate::group_append, QQuickVisualDataModelPrivate::group_count, - QQuickVisualDataModelPrivate::group_at); + QQuickVisualDataModelPrivate::group_at, + 0); } /*! diff --git a/src/quick/items/qquickvisualitemmodel.cpp b/src/quick/items/qquickvisualitemmodel.cpp index 453b4a4b68..91f52695ad 100644 --- a/src/quick/items/qquickvisualitemmodel.cpp +++ b/src/quick/items/qquickvisualitemmodel.cpp @@ -62,6 +62,17 @@ class QQuickVisualItemModelPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QQuickVisualItemModel) public: + class Item { + public: + Item(QQuickItem *i) : item(i), ref(0) {} + + void addRef() { ++ref; } + bool deref() { return --ref == 0; } + + QQuickItem *item; + int ref; + }; + QQuickVisualItemModelPrivate() : QObjectPrivate() {} static void children_append(QQmlListProperty *prop, QQuickItem *item) { @@ -78,6 +89,12 @@ public: return static_cast(prop->data)->children.at(index).item; } + static void children_clear(QQmlListProperty *prop) { + static_cast(prop->data)->itemCleared(static_cast(prop->data)->children); + static_cast(prop->data)->children.clear(); + static_cast(prop->data)->emitChildrenChanged(); + } + void itemAppended() { Q_Q(QQuickVisualItemModel); QQuickVisualItemModelAttached *attached = QQuickVisualItemModelAttached::properties(children.last().item); @@ -88,6 +105,13 @@ public: emit q->countChanged(); } + void itemCleared(const QList &children) { + Q_Q(QQuickVisualItemModel); + foreach (const Item &child, children) + emit q->destroyingItem(child.item); + emit q->countChanged(); + } + void emitChildrenChanged() { Q_Q(QQuickVisualItemModel); emit q->childrenChanged(); @@ -100,16 +124,6 @@ public: return -1; } - class Item { - public: - Item(QQuickItem *i) : item(i), ref(0) {} - - void addRef() { ++ref; } - bool deref() { return --ref == 0; } - - QQuickItem *item; - int ref; - }; QList children; }; @@ -168,8 +182,12 @@ QQuickVisualItemModel::QQuickVisualItemModel(QObject *parent) QQmlListProperty QQuickVisualItemModel::children() { Q_D(QQuickVisualItemModel); - return QQmlListProperty(this, d, d->children_append, - d->children_count, d->children_at); + return QQmlListProperty(this, + d, + d->children_append, + d->children_count, + d->children_at, + d->children_clear); } /*! diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index 028eb30f53..68f4553921 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -68,6 +68,8 @@ private slots: void canAt(); void canClear(); void canCount(); + void isReadable(); + void isManipulable(); void append(); void at(); void clear(); @@ -128,6 +130,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-property @@ -143,6 +147,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-list property @@ -158,6 +164,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } } @@ -343,6 +351,64 @@ void tst_qqmllistreference::canCount() } } +void tst_qqmllistreference::isReadable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isReadable() == true); + delete tt; + QVERIFY(ref.isReadable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isReadable() == false); + } +} + +void tst_qqmllistreference::isManipulable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isManipulable() == true); + delete tt; + QVERIFY(ref.isManipulable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isManipulable() == false); + } +} + void tst_qqmllistreference::append() { TestType *tt = new TestType; diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index b3a78f6a5e..8b445e38b9 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -1551,10 +1551,9 @@ void tst_QQuickItem::visibleChildren() QCOMPARE(root->property("test4_3").toBool(), true); QCOMPARE(root->property("test4_4").toBool(), true); - QString warning1 = testFileUrl("visiblechildren.qml").toString() + ":96:32: QML Item: QQuickItem: visibleChildren property is readonly and cannot be assigned to."; + QString warning1 = testFileUrl("visiblechildren.qml").toString() + ":87: TypeError: Cannot read property 'visibleChildren' of null"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QMetaObject::invokeMethod(root, "tryWriteToReadonlyVisibleChildren"); - QCOMPARE(root->property("test5_1").toBool(), true); QMetaObject::invokeMethod(root, "reparentVisibleItem3"); QCOMPARE(root->property("test6_1").toBool(), true); diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 78ff64da07..bd2c964e1e 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -262,7 +262,7 @@ class StandardItemModel : public QStandardItemModel Q_PROPERTY(QQmlListProperty items READ items CONSTANT) Q_CLASSINFO("DefaultProperty", "items") public: - QQmlListProperty items() { return QQmlListProperty(this, 0, append); } + QQmlListProperty items() { return QQmlListProperty(this, 0, append, 0, 0, 0); } static void append(QQmlListProperty *property, StandardItem *item) { -- cgit v1.2.3 From 020dc5e140e0239868135f181267aaa449202b89 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 23 Oct 2012 14:48:50 +0200 Subject: Allow tests to run despite custom message patterns. With QT_MESSAGE_PATTERN some tests would not run without explanation. Change-Id: I68a9eda08fe56508ffaaef209a1f236621aa932e Reviewed-by: Gabriel de Dietrich --- tests/auto/qml/debugger/shared/debugutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 06aba83bcb..f1700c8fa0 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -183,7 +183,7 @@ void QQmlDebugProcess::processAppOutput() const QString line = m_outputBuffer.left(nlIndex); m_outputBuffer = m_outputBuffer.right(m_outputBuffer.size() - nlIndex - 1); - if (line.startsWith("QML Debugger:")) { + if (line.contains("QML Debugger:")) { if (line.contains("Waiting for connection ")) { m_timer.stop(); m_started = true; -- cgit v1.2.3 From dae4efc4e5157cf39ca5a2b2e5a3eebb2827069e Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 23 Oct 2012 14:11:18 +0200 Subject: Allow QQmlDebugProcess to be child of other qobjects. Some tests when failing would leave the process running. For example on my machine tst_qqmlinspector would hang and restarting it would not work because the before started process was still blocking the port. Change-Id: I32dfb4874b18d7dcf34d0f40819b17dedd794ff3 Reviewed-by: Shawn Rutledge Reviewed-by: Gabriel de Dietrich --- .../qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp | 2 +- tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 2 +- .../tst_qqmlenginedebuginspectorintegration.cpp | 2 +- tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 2 +- .../qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 2 +- tests/auto/qml/debugger/shared/debugutil.cpp | 5 +++-- tests/auto/qml/debugger/shared/debugutil_p.h | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index a98160e0db..2b9efb62d7 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -179,7 +179,7 @@ void tst_QDebugMessageService::cleanupTestCase() void tst_QDebugMessageService::init() { m_connection = new QQmlDebugConnection(); - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_client = new QQmlDebugMsgClient(m_connection); m_process->start(QStringList() << QLatin1String(NORMALMODE) << QQmlDataTest::instance()->testFile(QMLFILE)); diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index ef82d82c8e..b958a27af5 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -1002,7 +1002,7 @@ void tst_QQmlDebugJS::cleanupTestCase() bool tst_QQmlDebugJS::init(const QString &qmlFile, bool blockMode) { connection = new QQmlDebugConnection(); - process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); client = new QJSDebugClient(connection); if (blockMode) diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 3ee66fc5b8..19a39c5656 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -108,7 +108,7 @@ void tst_QQmlEngineDebugInspectorIntegration::init() const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene"); + + "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 7a75f7b1d5..f1a6c23a3f 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -86,7 +86,7 @@ void tst_QQmlInspector::init() { const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index dec4ab3449..d8b538d79e 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -240,7 +240,7 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile) arguments << QQmlDataTest::instance()->testFile(testFile); - m_process = new QQmlDebugProcess(executable); + m_process = new QQmlDebugProcess(executable, this); m_process->start(QStringList() << arguments); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index f1700c8fa0..df8042ca11 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -83,8 +83,9 @@ void QQmlDebugTestClient::messageReceived(const QByteArray &ba) emit serverMessage(ba); } -QQmlDebugProcess::QQmlDebugProcess(const QString &executable) - : m_executable(executable) +QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent) + : QObject(parent) + , m_executable(executable) , m_started(false) { m_process.setProcessChannelMode(QProcess::MergedChannels); diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index e5e8878996..0791d05205 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -84,7 +84,7 @@ class QQmlDebugProcess : public QObject { Q_OBJECT public: - QQmlDebugProcess(const QString &executable); + QQmlDebugProcess(const QString &executable, QObject *parent = 0); ~QQmlDebugProcess(); QString state(); -- cgit v1.2.3 From 16a398f598b16f196df2b011e893c653c4854ea3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 23 Oct 2012 16:40:19 +0200 Subject: Fix crash in qtlocation tests. Task-number: QTBUG-27696 Change-Id: I0cc12e1be25a789a8245fae3a444629ca57872ef Reviewed-by: Christopher Adams Reviewed-by: Martin Jones --- src/qmltest/quicktest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 0a99654d39..d622ac9497 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -322,7 +322,7 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD rootobj.setWindowShown(true); if (!rootobj.hasQuit && rootobj.hasTestCase()) eventLoop.exec(); - view->hide(); + // view->hide(); Causes a crash in Qt3D due to deletion of the GL context, see QTBUG-27696 } } -- cgit v1.2.3 From a3a611d88dff663cce3fd8033295c5190624e859 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 24 Oct 2012 13:03:57 +0200 Subject: Mark failing tests as insignificant. Change-Id: I2dbed0d5fe632a034a0f656c2e3ccc3e63d4078b Reviewed-by: Richard J. Moore --- tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro b/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro index fcfdf23d33..f1fbfde0ec 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro +++ b/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro @@ -2,6 +2,8 @@ CONFIG += testcase TARGET = tst_qqmlxmlhttprequest macx:CONFIG -= app_bundle +CONFIG+=insignificant_test # QTQAINFRA-573 + INCLUDEPATH += ../../shared/ HEADERS += ../../shared/testhttpserver.h -- cgit v1.2.3 From 250e4c9ddfa2262f2f94f1a3b5e3e77409c2ec05 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 25 Oct 2012 14:03:56 +0200 Subject: Change organisation to Qt Project. Change-Id: Ia55cf3cff4f019c82588d44c0b9c63cb97d965be Reviewed-by: Lars Knoll --- tools/qmlscene/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 7500693e6b..6aced0ba10 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -409,8 +409,8 @@ int main(int argc, char ** argv) QGuiApplication app(argc, argv); #endif app.setApplicationName("QtQmlViewer"); - app.setOrganizationName("Nokia"); - app.setOrganizationDomain("nokia.com"); + app.setOrganizationName("Qt Project"); + app.setOrganizationDomain("qt-project.org"); QTranslator translator; QTranslator qtTranslator; -- cgit v1.2.3 From 3bb681153502b1a97c839bf2931244b0246f376a Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 29 Oct 2012 12:09:55 +0100 Subject: test: Mark `tst_qquicklistview', `tst_qquicktext', and `tst_qquicktextedit' as insignificant Task-number: QTBUG-27740 Change-Id: I20b15ae35f736f1c43a85e9a37ec3fda19896b07 Reviewed-by: Caroline Chao --- tests/auto/quick/qquicklistview/qquicklistview.pro | 2 ++ tests/auto/quick/qquicktext/qquicktext.pro | 2 ++ tests/auto/quick/qquicktextedit/qquicktextedit.pro | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/auto/quick/qquicklistview/qquicklistview.pro b/tests/auto/quick/qquicklistview/qquicklistview.pro index 3e9c09d02b..b0b1fc2518 100644 --- a/tests/auto/quick/qquicklistview/qquicklistview.pro +++ b/tests/auto/quick/qquicklistview/qquicklistview.pro @@ -14,3 +14,5 @@ TESTDATA = data/* QT += core-private gui-private qml-private quick-private v8-private testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 diff --git a/tests/auto/quick/qquicktext/qquicktext.pro b/tests/auto/quick/qquicktext/qquicktext.pro index 147b2c5334..4e3844bc58 100644 --- a/tests/auto/quick/qquicktext/qquicktext.pro +++ b/tests/auto/quick/qquicktext/qquicktext.pro @@ -14,3 +14,5 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private network testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 diff --git a/tests/auto/quick/qquicktextedit/qquicktextedit.pro b/tests/auto/quick/qquicktextedit/qquicktextedit.pro index b0621bc554..44def7f0f9 100644 --- a/tests/auto/quick/qquicktextedit/qquicktextedit.pro +++ b/tests/auto/quick/qquicktextedit/qquicktextedit.pro @@ -14,3 +14,5 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private network-private testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 -- cgit v1.2.3 From 0baccec7b4c3a7487dc6ca7c3d6b71130b916efc Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Mon, 29 Oct 2012 09:30:20 +0100 Subject: Test: Fix tst_qqmlecmascript::exportDate Get timezone offset of the date specified and not the default value. Change-Id: I58dba896098cbee72a2e4ec15ba2c928121e6cff Reviewed-by: Friedemann Kleint --- tests/auto/qml/qqmlecmascript/data/exportDate.2.qml | 2 +- tests/auto/qml/qqmlecmascript/data/exportDate.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml b/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml index 8ad75aabb0..4420cf846c 100644 --- a/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml +++ b/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml @@ -12,7 +12,7 @@ MyTypeObject { // The test date is 2009-5-12 23:59:59 (local time) var compare = new Date(2009, 5-1, 12, 23, 59, 59) - var compareOffset = new Date().getTimezoneOffset() + var compareOffset = compare.getTimezoneOffset() // The date is already in local time, so we can use the partial values directly var dtAdjusted = dt diff --git a/tests/auto/qml/qqmlecmascript/data/exportDate.qml b/tests/auto/qml/qqmlecmascript/data/exportDate.qml index 13b35a9cb8..c42b092fc7 100644 --- a/tests/auto/qml/qqmlecmascript/data/exportDate.qml +++ b/tests/auto/qml/qqmlecmascript/data/exportDate.qml @@ -12,7 +12,7 @@ MyTypeObject { // The test date is 2009-5-12 00:00:01 (local time) var compare = new Date(2009, 5-1, 12, 0, 0, 1) - var compareOffset = new Date().getTimezoneOffset() + var compareOffset = compare.getTimezoneOffset() // The date is already in local time, so we can use the partial values directly var dtAdjusted = dt -- cgit v1.2.3 From acebe1738e6598e6653673bf4adf61b1cb1e0911 Mon Sep 17 00:00:00 2001 From: aavit Date: Mon, 29 Oct 2012 12:14:55 +0100 Subject: Update qml test scenes with new property names Change-Id: I67953f257f8948f3ec821cf3e5bc4763aff8d1aa Reviewed-by: Paul Olav Tvete --- tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml | 4 ++-- tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml | 2 +- tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml b/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml index b2dcf4e675..0eb0a37de8 100644 --- a/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml +++ b/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml @@ -42,7 +42,7 @@ Rectangle { anchors.fill: parent anchors.margins: 10 radius: index * 20 - border.aligned: local._index == 1 + border.pixelAligned: local._index == 1 border.width: local._index == 0 ? 0 : 0.5 opacity: 0.5 color: "steelBlue" @@ -58,7 +58,7 @@ Rectangle { anchors.fill: parent anchors.margins: 10 radius: index * 20 - border.aligned: local._index == 1 + border.pixelAligned: local._index == 1 border.width: local._index == 0 ? 0 : 0.5 opacity: 0.5 gradient: Gradient { diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml index 47687918e0..76ce60fd7d 100644 --- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml +++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml @@ -69,7 +69,7 @@ Rectangle { anchors.margins: 10 width: 200 height: 100 - culling: model.bar + cullMode: model.bar property variant frontSource: front property variant backSource: back fragmentShader: " diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml index a6fcc260cd..45f20dd5a4 100644 --- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml +++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml @@ -69,7 +69,7 @@ Rectangle { anchors.margins: 10 width: 200 height: 100 - culling: model.bar + cullMode: model.bar property variant frontSource: front property variant backSource: back fragmentShader: " -- cgit v1.2.3 From a58a4e0c7be87eb29005b84d99d85138491a7067 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 25 Oct 2012 18:33:58 +0200 Subject: Remove stale QT_MODULE() usage cases As of Qt5, this macro is defined to be empty; simply get rid of these leftovers. Change-Id: Ib3a8e8eae98e2839c3db4bf34be8dcf43f49af11 Reviewed-by: Thiago Macieira Reviewed-by: Konstantin Ritt --- src/qml/animations/qabstractanimationjob_p.h | 2 -- src/qml/animations/qanimationgroupjob_p.h | 2 -- src/qml/animations/qparallelanimationgroupjob_p.h | 2 -- src/qml/animations/qpauseanimationjob_p.h | 2 -- src/qml/animations/qsequentialanimationgroupjob_p.h | 2 -- src/qml/debugger/qdebugmessageservice_p.h | 2 -- src/quick/items/qquickitemview_p.h | 2 -- src/quick/items/qquickitemview_p_p.h | 2 -- src/quick/items/qquickitemviewtransition_p.h | 2 -- src/quick/util/qquickanimationcontroller_p.h | 2 -- 10 files changed, 20 deletions(-) diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h index 12582a2986..0bf9169d0c 100644 --- a/src/qml/animations/qabstractanimationjob_p.h +++ b/src/qml/animations/qabstractanimationjob_p.h @@ -51,8 +51,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class QAnimationGroupJob; class QAnimationJobChangeListener; class Q_QML_PRIVATE_EXPORT QAbstractAnimationJob diff --git a/src/qml/animations/qanimationgroupjob_p.h b/src/qml/animations/qanimationgroupjob_p.h index 99c80210fe..23a6aed610 100644 --- a/src/qml/animations/qanimationgroupjob_p.h +++ b/src/qml/animations/qanimationgroupjob_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class Q_QML_PRIVATE_EXPORT QAnimationGroupJob : public QAbstractAnimationJob { Q_DISABLE_COPY(QAnimationGroupJob) diff --git a/src/qml/animations/qparallelanimationgroupjob_p.h b/src/qml/animations/qparallelanimationgroupjob_p.h index 04b8e326d8..8fee4e1606 100644 --- a/src/qml/animations/qparallelanimationgroupjob_p.h +++ b/src/qml/animations/qparallelanimationgroupjob_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class Q_QML_PRIVATE_EXPORT QParallelAnimationGroupJob : public QAnimationGroupJob { Q_DISABLE_COPY(QParallelAnimationGroupJob) diff --git a/src/qml/animations/qpauseanimationjob_p.h b/src/qml/animations/qpauseanimationjob_p.h index e3b492eecf..95212526ce 100644 --- a/src/qml/animations/qpauseanimationjob_p.h +++ b/src/qml/animations/qpauseanimationjob_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class Q_QML_PRIVATE_EXPORT QPauseAnimationJob : public QAbstractAnimationJob { Q_DISABLE_COPY(QPauseAnimationJob) diff --git a/src/qml/animations/qsequentialanimationgroupjob_p.h b/src/qml/animations/qsequentialanimationgroupjob_p.h index 84d1331b64..25ac3f5eb5 100644 --- a/src/qml/animations/qsequentialanimationgroupjob_p.h +++ b/src/qml/animations/qsequentialanimationgroupjob_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class QPauseAnimationJob; class Q_QML_PRIVATE_EXPORT QSequentialAnimationGroupJob : public QAnimationGroupJob { diff --git a/src/qml/debugger/qdebugmessageservice_p.h b/src/qml/debugger/qdebugmessageservice_p.h index 181c172570..efe056333f 100644 --- a/src/qml/debugger/qdebugmessageservice_p.h +++ b/src/qml/debugger/qdebugmessageservice_p.h @@ -61,8 +61,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Qml) - class QDebugMessageServicePrivate; class QDebugMessageService : public QQmlDebugService diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h index eb7dd00509..3295467d4a 100644 --- a/src/quick/items/qquickitemview_p.h +++ b/src/quick/items/qquickitemview_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Quick) - class QQuickChangeSet; class QQuickItemViewPrivate; diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index e50cd6cc61..3805568fb4 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -54,8 +54,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Quick) - class FxViewItem { diff --git a/src/quick/items/qquickitemviewtransition_p.h b/src/quick/items/qquickitemviewtransition_p.h index bc978dcdd6..36709294fb 100644 --- a/src/quick/items/qquickitemviewtransition_p.h +++ b/src/quick/items/qquickitemviewtransition_p.h @@ -48,8 +48,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Quick) - class QQuickItem; class QQuickItemViewTransitionableItem; class QQuickItemViewTransitionJob; diff --git a/src/quick/util/qquickanimationcontroller_p.h b/src/quick/util/qquickanimationcontroller_p.h index 58b1ced1d8..4185803800 100644 --- a/src/quick/util/qquickanimationcontroller_p.h +++ b/src/quick/util/qquickanimationcontroller_p.h @@ -49,8 +49,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Quick) - class QQuickAnimationControllerPrivate; class Q_AUTOTEST_EXPORT QQuickAnimationController : public QObject, public QQmlParserStatus { -- cgit v1.2.3 From 3c4574e3631b998d228a33fe2186ea6370a69193 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 19 Oct 2012 17:20:44 +0200 Subject: CMake: Add a test for module includes Change-Id: Ie9fd7929c1ea22f8acf51bafce64ade74d51a00e Reviewed-by: Rohan McGovern --- tests/auto/cmake/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 4f15a69ec8..43f826db02 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -10,3 +10,10 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") expect_pass(test_modules) + +set(Qt5_MODULE_TEST_DEPENDS Network Gui) + +test_module_includes( + Qml QQmlEngine + Quick QQuickWindow +) -- cgit v1.2.3 From b7e319bc30f47c4ea43b8aaa9402727c775c2d0c Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 23 Oct 2012 12:44:41 +0200 Subject: Changed the plugin module name The earlier name, com.nokia.TimeExample is irrelevant now. Also updated all instances of documentation where this older module name was referred. Change-Id: Ic252d0e72af23c2d39d5fed55f242e47c1b6bde9 Reviewed-by: J-P Nurmi Reviewed-by: Jens Bache-Wiig --- examples/qml/plugins/README | 9 --- .../qml/plugins/com/nokia/TimeExample/Clock.qml | 88 --------------------- .../qml/plugins/com/nokia/TimeExample/center.png | Bin 765 -> 0 bytes .../qml/plugins/com/nokia/TimeExample/clock.png | Bin 20653 -> 0 bytes .../qml/plugins/com/nokia/TimeExample/hour.png | Bin 625 -> 0 bytes .../qml/plugins/com/nokia/TimeExample/minute.png | Bin 625 -> 0 bytes examples/qml/plugins/com/nokia/TimeExample/qmldir | 3 - .../qml/plugins/doc/images/qml-plugins-example.png | Bin 0 -> 15773 bytes examples/qml/plugins/doc/src/qmlpluginex.qdoc | 42 ++++++++++ examples/qml/plugins/imports/TimeExample/Clock.qml | 88 +++++++++++++++++++++ .../qml/plugins/imports/TimeExample/center.png | Bin 0 -> 765 bytes examples/qml/plugins/imports/TimeExample/clock.png | Bin 0 -> 20653 bytes examples/qml/plugins/imports/TimeExample/hour.png | Bin 0 -> 625 bytes .../qml/plugins/imports/TimeExample/minute.png | Bin 0 -> 625 bytes examples/qml/plugins/imports/TimeExample/qmldir | 3 + examples/qml/plugins/plugin.cpp | 2 +- examples/qml/plugins/plugins.pro | 20 ++--- examples/qml/plugins/plugins.qml | 4 +- src/qml/doc/snippets/qml/imports/timeexample.qml | 2 +- src/qml/doc/src/modules/cppplugins.qdoc | 14 ++-- src/qml/qml/qqmlextensionplugin.cpp | 12 +-- 21 files changed, 160 insertions(+), 127 deletions(-) delete mode 100644 examples/qml/plugins/README delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/Clock.qml delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/center.png delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/clock.png delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/hour.png delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/minute.png delete mode 100644 examples/qml/plugins/com/nokia/TimeExample/qmldir create mode 100644 examples/qml/plugins/doc/images/qml-plugins-example.png create mode 100644 examples/qml/plugins/doc/src/qmlpluginex.qdoc create mode 100644 examples/qml/plugins/imports/TimeExample/Clock.qml create mode 100644 examples/qml/plugins/imports/TimeExample/center.png create mode 100644 examples/qml/plugins/imports/TimeExample/clock.png create mode 100644 examples/qml/plugins/imports/TimeExample/hour.png create mode 100644 examples/qml/plugins/imports/TimeExample/minute.png create mode 100644 examples/qml/plugins/imports/TimeExample/qmldir diff --git a/examples/qml/plugins/README b/examples/qml/plugins/README deleted file mode 100644 index f4f9074059..0000000000 --- a/examples/qml/plugins/README +++ /dev/null @@ -1,9 +0,0 @@ -This example shows a module "com.nokia.TimeExample" that is implemented -by a C++ plugin (providing the "Time" type), and by QML files (providing the -"Clock" type). - -To run: - - make install - QML_IMPORT_PATH=$PWD qmlscene plugins.qml - diff --git a/examples/qml/plugins/com/nokia/TimeExample/Clock.qml b/examples/qml/plugins/com/nokia/TimeExample/Clock.qml deleted file mode 100644 index ca57caeee5..0000000000 --- a/examples/qml/plugins/com/nokia/TimeExample/Clock.qml +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: clock - width: 200; height: 200; color: "gray" - - property alias city: cityLabel.text - property variant hours - property variant minutes - property variant shift : 0 - - Image { id: background; source: "clock.png" } - - Image { - x: 92.5; y: 27 - source: "hour.png" - transform: Rotation { - id: hourRotation - origin.x: 7.5; origin.y: 73; - angle: (clock.hours * 30) + (clock.minutes * 0.5) - Behavior on angle { - SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - x: 93.5; y: 17 - source: "minute.png" - transform: Rotation { - id: minuteRotation - origin.x: 6.5; origin.y: 83; - angle: clock.minutes * 6 - Behavior on angle { - SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - anchors.centerIn: background; source: "center.png" - } - - Text { - id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" - anchors.horizontalCenter: parent.horizontalCenter - } -} diff --git a/examples/qml/plugins/com/nokia/TimeExample/center.png b/examples/qml/plugins/com/nokia/TimeExample/center.png deleted file mode 100644 index 7fbd802a44..0000000000 Binary files a/examples/qml/plugins/com/nokia/TimeExample/center.png and /dev/null differ diff --git a/examples/qml/plugins/com/nokia/TimeExample/clock.png b/examples/qml/plugins/com/nokia/TimeExample/clock.png deleted file mode 100644 index 462edacc0e..0000000000 Binary files a/examples/qml/plugins/com/nokia/TimeExample/clock.png and /dev/null differ diff --git a/examples/qml/plugins/com/nokia/TimeExample/hour.png b/examples/qml/plugins/com/nokia/TimeExample/hour.png deleted file mode 100644 index f8061a1235..0000000000 Binary files a/examples/qml/plugins/com/nokia/TimeExample/hour.png and /dev/null differ diff --git a/examples/qml/plugins/com/nokia/TimeExample/minute.png b/examples/qml/plugins/com/nokia/TimeExample/minute.png deleted file mode 100644 index 1297ec7c2b..0000000000 Binary files a/examples/qml/plugins/com/nokia/TimeExample/minute.png and /dev/null differ diff --git a/examples/qml/plugins/com/nokia/TimeExample/qmldir b/examples/qml/plugins/com/nokia/TimeExample/qmldir deleted file mode 100644 index 9304d95435..0000000000 --- a/examples/qml/plugins/com/nokia/TimeExample/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module com.nokia.TimeExample -Clock 1.0 Clock.qml -plugin qmlqtimeexampleplugin diff --git a/examples/qml/plugins/doc/images/qml-plugins-example.png b/examples/qml/plugins/doc/images/qml-plugins-example.png new file mode 100644 index 0000000000..c2d4886ea2 Binary files /dev/null and b/examples/qml/plugins/doc/images/qml-plugins-example.png differ diff --git a/examples/qml/plugins/doc/src/qmlpluginex.qdoc b/examples/qml/plugins/doc/src/qmlpluginex.qdoc new file mode 100644 index 0000000000..464f42a34c --- /dev/null +++ b/examples/qml/plugins/doc/src/qmlpluginex.qdoc @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title QML Plugin Example + \example plugins + + \brief This example creates a C++ plugin extension by subclassing QQmlExtensionPlugin. + + \image qml-plugins-example.png + + To run this example, use the following commands on the prompt: + \code + > qmake + > make + > qmlscene -I imports plugins.qml + \endcode +*/ diff --git a/examples/qml/plugins/imports/TimeExample/Clock.qml b/examples/qml/plugins/imports/TimeExample/Clock.qml new file mode 100644 index 0000000000..ca57caeee5 --- /dev/null +++ b/examples/qml/plugins/imports/TimeExample/Clock.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: clock + width: 200; height: 200; color: "gray" + + property alias city: cityLabel.text + property variant hours + property variant minutes + property variant shift : 0 + + Image { id: background; source: "clock.png" } + + Image { + x: 92.5; y: 27 + source: "hour.png" + transform: Rotation { + id: hourRotation + origin.x: 7.5; origin.y: 73; + angle: (clock.hours * 30) + (clock.minutes * 0.5) + Behavior on angle { + SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 } + } + } + } + + Image { + x: 93.5; y: 17 + source: "minute.png" + transform: Rotation { + id: minuteRotation + origin.x: 6.5; origin.y: 83; + angle: clock.minutes * 6 + Behavior on angle { + SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 } + } + } + } + + Image { + anchors.centerIn: background; source: "center.png" + } + + Text { + id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white" + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/examples/qml/plugins/imports/TimeExample/center.png b/examples/qml/plugins/imports/TimeExample/center.png new file mode 100644 index 0000000000..7fbd802a44 Binary files /dev/null and b/examples/qml/plugins/imports/TimeExample/center.png differ diff --git a/examples/qml/plugins/imports/TimeExample/clock.png b/examples/qml/plugins/imports/TimeExample/clock.png new file mode 100644 index 0000000000..462edacc0e Binary files /dev/null and b/examples/qml/plugins/imports/TimeExample/clock.png differ diff --git a/examples/qml/plugins/imports/TimeExample/hour.png b/examples/qml/plugins/imports/TimeExample/hour.png new file mode 100644 index 0000000000..f8061a1235 Binary files /dev/null and b/examples/qml/plugins/imports/TimeExample/hour.png differ diff --git a/examples/qml/plugins/imports/TimeExample/minute.png b/examples/qml/plugins/imports/TimeExample/minute.png new file mode 100644 index 0000000000..1297ec7c2b Binary files /dev/null and b/examples/qml/plugins/imports/TimeExample/minute.png differ diff --git a/examples/qml/plugins/imports/TimeExample/qmldir b/examples/qml/plugins/imports/TimeExample/qmldir new file mode 100644 index 0000000000..252e662e12 --- /dev/null +++ b/examples/qml/plugins/imports/TimeExample/qmldir @@ -0,0 +1,3 @@ +module TimeExample +Clock 1.0 Clock.qml +plugin qmlqtimeexampleplugin diff --git a/examples/qml/plugins/plugin.cpp b/examples/qml/plugins/plugin.cpp index 6fce23b62c..d9bbded996 100644 --- a/examples/qml/plugins/plugin.cpp +++ b/examples/qml/plugins/plugin.cpp @@ -146,7 +146,7 @@ class QExampleQmlPlugin : public QQmlExtensionPlugin public: void registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample")); + Q_ASSERT(uri == QLatin1String("TimeExample")); qmlRegisterType(uri, 1, 0, "Time"); } }; diff --git a/examples/qml/plugins/plugins.pro b/examples/qml/plugins/plugins.pro index e127509c0d..2c748f7952 100644 --- a/examples/qml/plugins/plugins.pro +++ b/examples/qml/plugins/plugins.pro @@ -2,24 +2,24 @@ TEMPLATE = lib CONFIG += qt plugin QT += qml -DESTDIR = com/nokia/TimeExample +DESTDIR = imports/TimeExample TARGET = qmlqtimeexampleplugin SOURCES += plugin.cpp qdeclarativesources.files += \ - com/nokia/TimeExample/qmldir \ - com/nokia/TimeExample/center.png \ - com/nokia/TimeExample/clock.png \ - com/nokia/TimeExample/Clock.qml \ - com/nokia/TimeExample/hour.png \ - com/nokia/TimeExample/minute.png + imports/TimeExample/qmldir \ + imports/TimeExample/center.png \ + imports/TimeExample/clock.png \ + imports/TimeExample/Clock.qml \ + imports/TimeExample/hour.png \ + imports/TimeExample/minute.png -qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/com/nokia/TimeExample +qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample -sources.files += plugins.pro plugin.cpp plugins.qml README +sources.files += plugins.pro plugin.cpp plugins.qml sources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins -target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/com/nokia/TimeExample +target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample INSTALLS += qdeclarativesources sources target diff --git a/examples/qml/plugins/plugins.qml b/examples/qml/plugins/plugins.qml index a184395c64..db570cf307 100644 --- a/examples/qml/plugins/plugins.qml +++ b/examples/qml/plugins/plugins.qml @@ -38,9 +38,9 @@ ** ****************************************************************************/ //![0] -import com.nokia.TimeExample 1.0 // import types from the plugin +import TimeExample 1.0 // import types from the plugin -Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml) +Clock { // this class is defined in QML (imports/TimeExample/Clock.qml) Time { // this class is defined in C++ (plugin.cpp) id: time diff --git a/src/qml/doc/snippets/qml/imports/timeexample.qml b/src/qml/doc/snippets/qml/imports/timeexample.qml index f9c2411d02..97668452c0 100644 --- a/src/qml/doc/snippets/qml/imports/timeexample.qml +++ b/src/qml/doc/snippets/qml/imports/timeexample.qml @@ -39,7 +39,7 @@ ****************************************************************************/ //! [import] -import com.nokia.TimeExample 1.0 +import TimeExample 1.0 //! [import] Item { diff --git a/src/qml/doc/src/modules/cppplugins.qdoc b/src/qml/doc/src/modules/cppplugins.qdoc index 31ff02c2f4..2a08d732c0 100644 --- a/src/qml/doc/src/modules/cppplugins.qdoc +++ b/src/qml/doc/src/modules/cppplugins.qdoc @@ -87,12 +87,12 @@ types into the runtime. For this example, the TimeExample source directory is in - \c{com/nokia/TimeExample}. The plugin's type namespace will mirror + \c{imports/TimeExample}. The plugin's type namespace will mirror this structure, so the types are registered into the namespace - "com.nokia.TimeExample". + "TimeExample". Additionally, the project file, in a \c .pro file, defines the project as a plugin library, - specifies it should be built into the \c com/nokia/TimeExample directory, and registers + specifies it should be built into the \c imports/TimeExample directory, and registers the plugin target name and various other details: \code @@ -100,21 +100,21 @@ CONFIG += qt plugin QT += qml - DESTDIR = com/nokia/TimeExample + DESTDIR = imports/TimeExample TARGET = qmlqtimeexampleplugin SOURCES += qexampleqmlplugin.cpp \endcode Finally, a \l{Module Definition qmldir Files}{qmldir file} is required - in the \c com/nokia/TimeExample directory to describe the plugin and the types that it + in the \c imports/TimeExample directory to describe the plugin and the types that it exports. The plugin includes a \c Clock.qml file along with the \c qmlqtimeexampleplugin that is built by the project (as shown above in the \c .pro file) so both of these need to be specified in the \c qmldir file: - \quotefile examples/qml/plugins/com/nokia/TimeExample/qmldir + \quotefile examples/qml/plugins/imports/TimeExample/qmldir Once the project is built and installed, the new \c Time component is - accessible by any QML component that imports the \c com.nokia.TimeExample + accessible by any QML component that imports the \c TimeExample module \snippet examples/qml/plugins/plugins.qml 0 diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index 36abc3a9e4..2f0e804019 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE To make this class available as a QML type, create a plugin that registers this type with a specific \l {QML Modules}{module} using qmlRegisterType(). For this example the plugin - module will be named \c com.nokia.TimeExample (as defined in the project + module will be named \c TimeExample (as defined in the project file further below). \snippet examples/qml/plugins/plugin.cpp plugin @@ -93,27 +93,27 @@ QT_BEGIN_NAMESPACE ensures the module is imported correctly by any QML components that use this plugin. The project file defines the project as a plugin library and specifies - it should be built into the \c com/nokia/TimeExample directory: + it should be built into the \c imports/TimeExample directory: \code TEMPLATE = lib CONFIG += qt plugin QT += qml - DESTDIR = com/nokia/TimeExample + DESTDIR = imports/TimeExample TARGET = qmlqtimeexampleplugin ... \endcode - Finally, a \l{Module Definition qmldir Files}{qmldir file} is required in the \c com/nokia/TimeExample directory + Finally, a \l{Module Definition qmldir Files}{qmldir file} is required in the \c imports/TimeExample directory that describes the plugin. This directory includes a \c Clock.qml file that should be bundled with the plugin, so it needs to be specified in the \c qmldir file: - \quotefile examples/qml/plugins/com/nokia/TimeExample/qmldir + \quotefile examples/qml/plugins/imports/TimeExample/qmldir Once the project is built and installed, the new \c Time element can be - used by any QML component that imports the \c com.nokia.TimeExample module: + used by any QML component that imports the \c TimeExample module: \snippet examples/qml/plugins/plugins.qml 0 -- cgit v1.2.3 From bbb1a9b727ea85933ef4e30c783b86cf44656247 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 19 Oct 2012 16:58:37 +0200 Subject: Doc: Removed reference to QTDIR and did some language edits Change-Id: I3c7854342fc89c97423c8540a6c5cc51070a5639 Reviewed-by: Jerome Pasion --- src/quick/doc/src/appdevguide/qmlscene.qdoc | 219 +++++++++++++++------------- 1 file changed, 115 insertions(+), 104 deletions(-) diff --git a/src/quick/doc/src/appdevguide/qmlscene.qdoc b/src/quick/doc/src/appdevguide/qmlscene.qdoc index 33beba75f8..264adffee3 100644 --- a/src/quick/doc/src/appdevguide/qmlscene.qdoc +++ b/src/quick/doc/src/appdevguide/qmlscene.qdoc @@ -26,110 +26,121 @@ ****************************************************************************/ /*! -\page qtquick-qmlscene.html -\ingroup qtquick-tools -\title Prototyping with qmlscene -\ingroup qttools -\brief a tool for testing and loading QML files - -The Qt SDK includes \c qmlscene, a tool for loading QML documents that -makes it easy to quickly develop and debug QML applications. It provides a simple -way of loading QML documents and also includes additional features useful for -the development of QML applications. - -The \c qmlscene tool should only be used for testing and developing QML applications. It is -\e not intended for use in a production environment and should not be used for the -deployment of QML applications. In those cases, a custom C++ application should be -written instead, or the QML file should be bundled in a module. See -\l {Deploying QML applications} for more information. - -The \c qmlscene tool is located at \c QTDIR/bin/qmlscene. To load a \c .qml file, -run the tool and select the file to be opened, or provide the -file path on the command line: - -\code - qmlscene myqmlfile.qml -\endcode - -To see the configuration options, run \c qmlscene with the \c -help argument. - - -\section1 Adding module import paths - -Additional module import paths can be provided using the \c -I flag. -For example, the \l{declarative/cppextensions/plugins}{QML plugins example} creates -a C++ plugin identified as \c com.nokia.TimeExample. Since this has a namespaced -identifier, \c qmlscene has to be run with the \c -I flag from the example's -base directory: - -\code -qmlscene -I . plugins.qml -\endcode - -This adds the current directory to the import path so that \c qmlscene will -find the plugin in the \c com/nokia/TimeExample directory. - -Note by default, the current directory is included in the import search path, -but namespaced modules like \c com.nokia.TimeExample are not found unless -the path is explicitly added. - - -\section1 Loading placeholder data - -Often, QML applications are prototyped with fake data that is later replaced -by real data sources from C++ plugins. The \c qmlscene tool assists in this aspect by -loading fake data into the application context: it looks for a directory named -"dummydata" in the same directory as the target QML file, and any \c .qml -files in that directory are loaded as QML objects and bound to the root context -as properties named after the files. - -For example, this QML document refers to a \c lottoNumbers property which does -not actually exist within the document: - -\qml -import QtQuick 2.0 - -ListView { - width: 200; height: 300 - model: lottoNumbers - delegate: Text { text: number } -} -\endqml - -If within the document's directory, there is a "dummydata" directory which -contains a \c lottoNumbers.qml file like this: - -\qml -import QtQuick 2.0 - -ListModel { - ListElement { number: 23 } - ListElement { number: 44 } - ListElement { number: 78 } -} -\endqml - -Then this model would be automatically loaded into the ListView in the previous document. - -Child properties are included when loaded from dummy data. The following document -refers to a \c clock.time property: - -\qml -import QtQuick 2.0 -Text { text: clock.time } -\endqml - -The text value could be filled by a \c dummydata/clock.qml file with a \c time -property in the root context: - -\qml -import QtQuick 2.0 -QtObject { property int time: 54321 } -\endqml - -To replace this with real data, you can simply bind the real data object to -the root context in C++ using QQmlContext::setContextProperty(). This -is detailed in \l{qtqml-cppintegration-topic.html}{Integrating QML and C++}. + \page qtquick-qmlscene.html + \ingroup qtquick-tools + \title Prototyping with qmlscene + \ingroup qttools + \brief Utility to test and load QML files + + Qt 5 includes \c qmlscene, a utility to load QML documents. + The \c{qmlscene} utility enables viewing your QML document even before the + application is complete. This utility also provides the following + additional features that are useful while developing QML applications: + \list + \li View the QML document in a maximized window. + \li View the QML document in full-screen mode. + \li Make the window transparent. + \li Disable multi-sampling (anti-aliasing). + \li Do not detect the version of the .qml file. + \li Run all animations in slow motion. + \li Resize the window to the size of the root item. + \li Add the list of import paths. + \li Add a named bundle. + \li Use a translation file to set the language. + \endlist + + The \c qmlscene utility is meant to be used for testing your QML + applications, and not as a launcher in a production environment. + To launch a QML application in a production environment, develop a custom + C++ application or bundle the QML file in a module. See \l {Deploying QML + applications} for more information. + + To load a .qml file, run the tool and select the file to be opened, or + provide the file path on the command prompt: + + \code + qmlscene myqmlfile.qml + \endcode + + To see the configuration options, run \c qmlscene with the \c -help + argument. + + \section1 Adding Module Import Paths + + Additional module import paths can be provided using the \c -I flag. + For example, the \l{QML Plugin Example}{QML plugin example} + creates a C++ plugin identified with the namespace, \c TimeExample. + To load the plugin, you must run \c qmlscene with the \c{-I} flag from the + example's base directory: + + \code + qmlscene -I imports plugins.qml + \endcode + + This adds the current directory to the import path so that \c qmlscene will + find the plugin in the \c imports directory. + + \note By default, the current directory is included in the import search + path, but modules in a namespace such as \c TimeExample are not found + unless the path is explicitly added. + + \section1 Loading Test Data + + Often, QML applications are prototyped with test data that is later + replaced by real data sources from C++ plugins. The \c qmlscene utility + assists in this aspect by loading test data into the application context. + It looks for a directory named \c {dummydata} in the same directory as + the target QML file, and loads the .qml files in that directory as QML + objects and bind them to the root context as properties named after the files. + + For example, the following QML document refers to a \c lottoNumbers + property which does not exist within the document: + + \qml + import QtQuick 2.0 + + ListView { + width: 200; height: 300 + model: lottoNumbers + delegate: Text { text: number } + } + \endqml + + If within the document's directory, there is a \c{dummydata} directory + which contains a \c lottoNumbers.qml file like this: + + \qml + import QtQuick 2.0 + + ListModel { + ListElement { number: 23 } + ListElement { number: 44 } + ListElement { number: 78 } + } + \endqml + + Then this model would be automatically loaded into the ListView in the + previous document. + + Child properties are included when loaded from \c dummydata. The following + document refers to a \c clock.time property: + + \qml + import QtQuick 2.0 + Text { text: clock.time } + \endqml + + The text value could be filled by a \c dummydata/clock.qml file with a + \c time property in the root context: + + \qml + import QtQuick 2.0 + QtObject { property int time: 54321 } + \endqml + + To replace this with real data, bind the real data object to + the root context in C++ using QQmlContext::setContextProperty(). This is + detailed in \l{Integrating QML and C++}. */ -- cgit v1.2.3 From 871a744df47d9d6bd6349b0f69fe091959617abd Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 23 Oct 2012 15:14:35 +0200 Subject: Prepare for removal of Softkeys API Change-Id: I28f0d1b66da10a9d578e3aea3fe73a5d28322852 Reviewed-by: Kai Koehne Reviewed-by: Janne Anttila --- src/imports/qtquick2/plugins.qmltypes | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes index 19400aa4f0..015d2ac139 100644 --- a/src/imports/qtquick2/plugins.qmltypes +++ b/src/imports/qtquick2/plugins.qmltypes @@ -3871,9 +3871,7 @@ Module { "MacWindowToolBarButtonHint": 268435456, "BypassGraphicsProxyWidget": 536870912, "WindowOkButtonHint": 524288, - "WindowCancelButtonHint": 1048576, - "WindowSoftkeysVisibleHint": 1073741824, - "WindowSoftkeysRespondHint": -2147483648 + "WindowCancelButtonHint": 1048576 } } Enum { @@ -3912,9 +3910,7 @@ Module { "MacWindowToolBarButtonHint": 268435456, "BypassGraphicsProxyWidget": 536870912, "WindowOkButtonHint": 524288, - "WindowCancelButtonHint": 1048576, - "WindowSoftkeysVisibleHint": 1073741824, - "WindowSoftkeysRespondHint": -2147483648 + "WindowCancelButtonHint": 1048576 } } Enum { @@ -4068,8 +4064,6 @@ Module { "WA_AcceptTouchEvents": 121, "WA_WState_AcceptedTouchBeginEvent": 122, "WA_TouchPadAcceptSingleTouchEvents": 123, - "WA_MergeSoftkeys": 124, - "WA_MergeSoftkeysRecursively": 125, "WA_X11DoNotAcceptFocus": 126, "WA_MacNoShadow": 127, "WA_AttributeCount": 128 -- cgit v1.2.3 From 8ce7d6a319c1fca735ecf7faff2127fb3aca1a72 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Oct 2012 15:43:42 +0100 Subject: adjust to qt_plugin.prf changes, part 1 PLUGIN_TYPE will need to be defined. do this before the respective change in qtbase, due to the reverse dependency. Change-Id: I97e7574b48512958689dab0c0697f2edc8666807 Reviewed-by: Oswald Buddenhagen --- src/plugins/accessible/quick/quick.pro | 2 ++ src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro | 1 + src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro | 1 + src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro | 1 + 4 files changed, 5 insertions(+) diff --git a/src/plugins/accessible/quick/quick.pro b/src/plugins/accessible/quick/quick.pro index b0eca3e37f..c904867ca2 100644 --- a/src/plugins/accessible/quick/quick.pro +++ b/src/plugins/accessible/quick/quick.pro @@ -1,7 +1,9 @@ TARGET = qtaccessiblequick DESTDIR = $$QT.gui.plugins/accessible +PLUGIN_TYPE = accessible load(qt_plugin) + include ($$PWD/../shared/qaccessiblebase.pri) QT += core-private gui-private v8-private qml-private quick-private diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro index 44efc12673..7f07cbeafb 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro +++ b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro @@ -1,6 +1,7 @@ TARGET = qmldbg_ost QT += qml network +PLUGIN_TYPE = qmltooling load(qt_plugin) DESTDIR = $$QT.qml.plugins/qmltooling diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro index 9e89e45793..ce74afd0ef 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro @@ -1,6 +1,7 @@ TARGET = qmldbg_qtquick2 QT += qml-private quick-private core-private gui-private v8-private +PLUGIN_TYPE = qmltooling load(qt_plugin) DESTDIR = $$QT.qml.plugins/qmltooling diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro index 1208552652..fb07f5be57 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro +++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro @@ -1,6 +1,7 @@ TARGET = qmldbg_tcp QT += qml-private network v8-private core-private +PLUGIN_TYPE = qmltooling load(qt_plugin) DESTDIR = $$QT.qml.plugins/qmltooling -- cgit v1.2.3 From 732db404eac8982a69f4cf0c99378c54914be684 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 31 Oct 2012 14:51:49 +0100 Subject: CMake: Remove obsolete test_modules test The generated module_includes test is a super-set of this test. Change-Id: I086d81806cdbc3c4afbeae0f8683a5b693b6f85a Reviewed-by: Rohan McGovern --- tests/auto/cmake/CMakeLists.txt | 2 -- tests/auto/cmake/test_modules/CMakeLists.txt | 33 ------------------ tests/auto/cmake/test_modules/main.cpp | 52 ---------------------------- 3 files changed, 87 deletions(-) delete mode 100644 tests/auto/cmake/test_modules/CMakeLists.txt delete mode 100644 tests/auto/cmake/test_modules/main.cpp diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 43f826db02..a88564e0b7 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -9,8 +9,6 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") -expect_pass(test_modules) - set(Qt5_MODULE_TEST_DEPENDS Network Gui) test_module_includes( diff --git a/tests/auto/cmake/test_modules/CMakeLists.txt b/tests/auto/cmake/test_modules/CMakeLists.txt deleted file mode 100644 index 509320bfb5..0000000000 --- a/tests/auto/cmake/test_modules/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -project(test_modules) - -# We have to find the dependencies separately because they are installed, -# whereas the modules under test are not installed yet, and are found in the -# build directory. Normally the Qt5 CMake files expect all modules in one -# installation prefix, so we work around that by finding the dependencies -# explicitly first. -find_package(Qt5Network REQUIRED) -find_package(Qt5Gui REQUIRED) - -find_package(Qt5Qml REQUIRED) -find_package(Qt5Quick REQUIRED) - -include_directories( - ${Qt5Qml_INCLUDE_DIRS} - ${Qt5Quick_INCLUDE_DIRS} -) - -add_definitions( - ${Qt5Qml_DEFINITIONS} - ${Qt5Quick_DEFINITIONS} -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - -add_executable(mainapp main.cpp) -target_link_libraries(mainapp - ${Qt5Qml_LIBRARIES} - ${Qt5Quick_LIBRARIES} -) diff --git a/tests/auto/cmake/test_modules/main.cpp b/tests/auto/cmake/test_modules/main.cpp deleted file mode 100644 index c771ead229..0000000000 --- a/tests/auto/cmake/test_modules/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -int main(int argc, char **argv) -{ - QQmlEngine qmlEngine; - - QQuickItem quickItem; - - return 0; -} -- cgit v1.2.3 From f15c56a14c671734610a701884c82a096a2cada7 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Thu, 1 Nov 2012 14:36:53 +0100 Subject: Update Nokia references to Digia's. Change-Id: I3be91d4a6a1116c79ab6aca89d189c88a265d339 Reviewed-by: Akseli Salovaara Reviewed-by: Sergio Ahumada --- examples/qml/networkaccessmanagerfactory/view.qml | 2 +- examples/quick/text/styledtext-layout.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/qml/networkaccessmanagerfactory/view.qml b/examples/qml/networkaccessmanagerfactory/view.qml index 0548c0bedc..10ad351d25 100644 --- a/examples/qml/networkaccessmanagerfactory/view.qml +++ b/examples/qml/networkaccessmanagerfactory/view.qml @@ -43,5 +43,5 @@ import QtQuick 2.0 Image { width: 100 height: 100 - source: "http://qt.nokia.com/logo.png" + source: "http://qt.digia.com/Documents/Qt_master_logo_CMYK_noback.gif" } diff --git a/examples/quick/text/styledtext-layout.qml b/examples/quick/text/styledtext-layout.qml index 8ae38e4cbc..0d76084ba6 100644 --- a/examples/quick/text/styledtext-layout.qml +++ b/examples/quick/text/styledtext-layout.qml @@ -58,7 +58,7 @@ Rectangle { textFormat: Text.StyledText horizontalAlignment: Text.AlignJustify - text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at ante dui www.nokia.com.
Curabitur ante est, pulvinar quis adipiscing a, iaculis id ipsum. Nunc blandit condimentum odio vel egestas.
  • Coffee
    1. Espresso
    2. Cappuccino
    3. Latte
  • Juice
    1. Orange
    2. Apple
    3. Pineapple
    4. Tomato

Proin consectetur sapien in ipsum lacinia sit amet mattis orci interdum. Quisque vitae accumsan lectus. Ut nisi turpis, sollicitudin ut dignissim id, fermentum ac est. Maecenas nec libero leo. Sed ac leo eget ipsum ultricies viverra sit amet eu orci. Praesent et tortor risus, viverra accumsan sapien. Sed faucibus eleifend lectus, sed euismod urna porta eu. Quisque vitae accumsan lectus. Ut nisi turpis, sollicitudin ut dignissim id, fermentum ac est. Maecenas nec libero leo. Sed ac leo eget ipsum ultricies viverra sit amet eu orci." + text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at ante dui www.digia.com.
Curabitur ante est, pulvinar quis adipiscing a, iaculis id ipsum. Nunc blandit condimentum odio vel egestas.

  • Coffee
    1. Espresso
    2. Cappuccino
    3. Latte
  • Juice
    1. Orange
    2. Apple
    3. Pineapple
    4. Tomato

Proin consectetur sapien in ipsum lacinia sit amet mattis orci interdum. Quisque vitae accumsan lectus. Ut nisi turpis, sollicitudin ut dignissim id, fermentum ac est. Maecenas nec libero leo. Sed ac leo eget ipsum ultricies viverra sit amet eu orci. Praesent et tortor risus, viverra accumsan sapien. Sed faucibus eleifend lectus, sed euismod urna porta eu. Quisque vitae accumsan lectus. Ut nisi turpis, sollicitudin ut dignissim id, fermentum ac est. Maecenas nec libero leo. Sed ac leo eget ipsum ultricies viverra sit amet eu orci." //! [layout] onLineLaidOut: { -- cgit v1.2.3 From 5433a7038bdfe407b6e16a23f5504cc8c1c212a1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Oct 2012 15:45:45 +0100 Subject: adjust to qt_plugin.prf changes, part 2 DESTDIR and INSTALLS+=target are set up automatically now, but PLUGIN_TYPE needs to be defined. Change-Id: I2dab25a2527d376eaa37f233782ffe4b6a58b8f8 Reviewed-by: Joerg Bornemann --- src/plugins/accessible/quick/quick.pro | 1 - src/plugins/accessible/shared/qaccessiblebase.pri | 3 --- src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro | 5 ----- src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro | 5 ----- src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro | 5 ----- 5 files changed, 19 deletions(-) diff --git a/src/plugins/accessible/quick/quick.pro b/src/plugins/accessible/quick/quick.pro index c904867ca2..eabe44848b 100644 --- a/src/plugins/accessible/quick/quick.pro +++ b/src/plugins/accessible/quick/quick.pro @@ -1,5 +1,4 @@ TARGET = qtaccessiblequick -DESTDIR = $$QT.gui.plugins/accessible PLUGIN_TYPE = accessible load(qt_plugin) diff --git a/src/plugins/accessible/shared/qaccessiblebase.pri b/src/plugins/accessible/shared/qaccessiblebase.pri index 56a8a1c9ef..061d154277 100644 --- a/src/plugins/accessible/shared/qaccessiblebase.pri +++ b/src/plugins/accessible/shared/qaccessiblebase.pri @@ -1,6 +1,3 @@ -target.path += $$[QT_INSTALL_PLUGINS]/accessible -INSTALLS += target - INCLUDEPATH += $$PWD DEPENDPATH += $$PWD SOURCES += $$PWD/qqmlaccessible.cpp diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro index 7f07cbeafb..6d486ecc2f 100644 --- a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro +++ b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro @@ -4,8 +4,6 @@ QT += qml network PLUGIN_TYPE = qmltooling load(qt_plugin) -DESTDIR = $$QT.qml.plugins/qmltooling - SOURCES += \ qmlostplugin.cpp \ qostdevice.cpp @@ -14,6 +12,3 @@ HEADERS += \ qmlostplugin.h \ qostdevice.h \ usbostcomm.h - -target.path += $$[QT_INSTALL_PLUGINS]/qmltooling -INSTALLS += target diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro index ce74afd0ef..6c672c2417 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro +++ b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro @@ -4,8 +4,6 @@ QT += qml-private quick-private core-private gui-private v8-private PLUGIN_TYPE = qmltooling load(qt_plugin) -DESTDIR = $$QT.qml.plugins/qmltooling - INCLUDEPATH *= $$PWD $$PWD/../shared SOURCES += \ @@ -26,6 +24,3 @@ HEADERS += \ inspecttool.h OTHER_FILES += qtquick2plugin.json - -target.path += $$[QT_INSTALL_PLUGINS]/qmltooling -INSTALLS += target diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro index fb07f5be57..22241a3560 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro +++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro @@ -4,8 +4,6 @@ QT += qml-private network v8-private core-private PLUGIN_TYPE = qmltooling load(qt_plugin) -DESTDIR = $$QT.qml.plugins/qmltooling - SOURCES += \ qtcpserverconnection.cpp \ ../shared/qpacketprotocol.cpp @@ -17,6 +15,3 @@ HEADERS += \ INCLUDEPATH += ../shared OTHER_FILES += qtcpserverconnection.json - -target.path += $$[QT_INSTALL_PLUGINS]/qmltooling -INSTALLS += target -- cgit v1.2.3 From 7d94fa8e074ba816751c60bd0ad3c63b3c0b0a27 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 26 Oct 2012 19:59:38 +0200 Subject: follow qt_tool.prf now setting up DESTDIR Change-Id: Ia07dc830586fd30f4ee98c64e9f2accae5cf2f06 Reviewed-by: Joerg Bornemann --- tools/qmlbundle/qmlbundle.pro | 2 -- tools/qmlmin/qmlmin.pro | 1 - tools/qmlplugindump/qmlplugindump.pro | 2 -- tools/qmlprofiler/qmlprofiler.pro | 2 -- tools/qmlscene/qmlscene.pro | 2 -- tools/qmltestrunner/qmltestrunner.pro | 2 -- 6 files changed, 11 deletions(-) diff --git a/tools/qmlbundle/qmlbundle.pro b/tools/qmlbundle/qmlbundle.pro index 237f933b8b..440b152149 100644 --- a/tools/qmlbundle/qmlbundle.pro +++ b/tools/qmlbundle/qmlbundle.pro @@ -1,5 +1,3 @@ -DESTDIR= $$QT.qml.bins - QT = core qml-private v8-private core-private SOURCES += main.cpp diff --git a/tools/qmlmin/qmlmin.pro b/tools/qmlmin/qmlmin.pro index c8df227765..c7da0ebe4e 100644 --- a/tools/qmlmin/qmlmin.pro +++ b/tools/qmlmin/qmlmin.pro @@ -1,5 +1,4 @@ QT = core qmldevtools-private -DESTDIR = $$QT.qml.bins SOURCES += main.cpp load(qt_tool) diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro index 03256309b6..f0cc1bf103 100644 --- a/tools/qmlplugindump/qmlplugindump.pro +++ b/tools/qmlplugindump/qmlplugindump.pro @@ -1,5 +1,3 @@ -DESTDIR = $$QT.qml.bins - QT += qml qml-private quick-private core-private SOURCES += \ diff --git a/tools/qmlprofiler/qmlprofiler.pro b/tools/qmlprofiler/qmlprofiler.pro index 70dc53bfcb..c5def993f3 100644 --- a/tools/qmlprofiler/qmlprofiler.pro +++ b/tools/qmlprofiler/qmlprofiler.pro @@ -1,5 +1,3 @@ -DESTDIR = $$QT.qml.bins - QT += qml qml-private v8-private network core-private SOURCES += main.cpp \ diff --git a/tools/qmlscene/qmlscene.pro b/tools/qmlscene/qmlscene.pro index 0d41e1f87e..623de41c5c 100644 --- a/tools/qmlscene/qmlscene.pro +++ b/tools/qmlscene/qmlscene.pro @@ -1,5 +1,3 @@ -DESTDIR= $$QT.qml.bins - QT += qml quick core-private !contains(QT_CONFIG, no-widgets):QT += widgets diff --git a/tools/qmltestrunner/qmltestrunner.pro b/tools/qmltestrunner/qmltestrunner.pro index efa0e96890..5184c1f1a4 100644 --- a/tools/qmltestrunner/qmltestrunner.pro +++ b/tools/qmltestrunner/qmltestrunner.pro @@ -1,5 +1,3 @@ -DESTDIR= $$QT.qml.bins - SOURCES += main.cpp QT += qml qmltest -- cgit v1.2.3