diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:26 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:26 +0100 |
commit | 774d0310883a9526210c4530bbb9d0af26d88699 (patch) | |
tree | d79e075f964ef213a31ee290c00d9438f3b139dc /src | |
parent | 9b3d0a24b65f6a0725951a4df0239ef19a8d3f64 (diff) | |
parent | 811337a73c160447e5218ae55e93df99ac3d9edd (diff) | |
download | qtdeclarative-baserock/morph.tar.gz |
Merge v5.1.0 releasebaserock/morph
Diffstat (limited to 'src')
79 files changed, 1333 insertions, 480 deletions
diff --git a/src/imports/dialogs/DefaultColorDialog.qml b/src/imports/dialogs/DefaultColorDialog.qml index 7322aa18e7..8636259957 100644 --- a/src/imports/dialogs/DefaultColorDialog.qml +++ b/src/imports/dialogs/DefaultColorDialog.qml @@ -39,6 +39,7 @@ *****************************************************************************/ import QtQuick 2.1 +import QtQuick.Window 2.1 import QtQuick.Dialogs 1.0 import "qml" @@ -47,14 +48,17 @@ AbstractColorDialog { Rectangle { id: content - width: 320 - height: (usePaletteMap ? width : 0) + bottomMinHeight + property int maxSize: 0.9 * Math.min(Screen.desktopAvailableWidth, Screen.desktopAvailableHeight) + implicitHeight: Math.max(maxSize, Screen.logicalPixelDensity * (usePaletteMap ? 10 : 5)) + implicitWidth: usePaletteMap ? implicitHeight - bottomMinHeight : implicitHeight * 1.5 color: palette.window property real bottomMinHeight: sliders.height + buttonRow.height + outerSpacing * 3 property real spacing: 8 property real outerSpacing: 12 property bool usePaletteMap: true - property bool inited: false + + // set the preferred width based on height, to avoid "letterboxing" the paletteMap + onHeightChanged: implicitHeight = Math.max((usePaletteMap ? 480 : bottomMinHeight), height) SystemPalette { id: palette } diff --git a/src/imports/dialogs/DefaultFileDialog.qml b/src/imports/dialogs/DefaultFileDialog.qml index 5542e59cb5..2cdb34cc03 100644 --- a/src/imports/dialogs/DefaultFileDialog.qml +++ b/src/imports/dialogs/DefaultFileDialog.qml @@ -40,6 +40,7 @@ import QtQuick 2.1 import QtQuick.Dialogs 1.0 +import QtQuick.Window 2.1 import Qt.labs.folderlistmodel 2.0 import "qml" @@ -52,13 +53,13 @@ AbstractFileDialog { currentPathField.visible = false } } + onFolderChanged: view.model.folder = folder property bool showFocusHighlight: false - property real textX: 28 + property real textX: titleBar.height property SystemPalette palette property var selectedIndices: [] property int lastClickedIdx: -1 - folder: urlToPath(view.model.folder) function dirDown(path) { view.model.folder = path @@ -106,10 +107,11 @@ AbstractFileDialog { selectedIndices.map(function(idx) { if (view.model.isFolder(idx)) { if (selectFolder) - addSelection(view.model.get(idx, "filePath")) + // TODO after QTBUG-32039: should not need to convert pathToUrl here + addSelection(pathToUrl(view.model.get(idx, "filePath"))) } else { if (!selectFolder) - addSelection(view.model.get(idx, "filePath")) + addSelection(pathToUrl(view.model.get(idx, "filePath"))) } }) } @@ -117,11 +119,12 @@ AbstractFileDialog { } Rectangle { - width: 480 // TODO: QTBUG-29817 geometry from AbstractFileDialog - height: 320 + property int maxSize: Math.min(Screen.desktopAvailableWidth, Screen.desktopAvailableHeight) + // TODO: QTBUG-29817 geometry from AbstractFileDialog + implicitWidth: Math.min(maxSize, Screen.logicalPixelDensity * 100) + implicitHeight: Math.min(maxSize, Screen.logicalPixelDensity * 80) id: window color: palette.window - anchors.centerIn: Qt.application.supportsMultipleWindows ? null : parent SystemPalette { id: palette } @@ -209,7 +212,12 @@ AbstractFileDialog { clip: true x: 0 width: parent.width - model: FolderListModel { } + model: FolderListModel { + onFolderChanged: { + root.folder = folder + currentPathField.text = root.urlToPath(view.model.folder) + } + } delegate: folderDelegate highlight: Rectangle { color: "transparent" @@ -303,10 +311,9 @@ AbstractFileDialog { anchors.leftMargin: textX; anchors.rightMargin: 4 visible: false focus: visible - text: root.urlToPath(view.model.folder) onAccepted: { root.clearSelection() - if (root.addSelection(text)) + if (root.addSelection(root.pathToUrl(text))) root.accept() else view.model.folder = root.pathFolder(text) diff --git a/src/imports/dialogs/dialogs.pro b/src/imports/dialogs/dialogs.pro index b7704dadda..e745d52e2b 100644 --- a/src/imports/dialogs/dialogs.pro +++ b/src/imports/dialogs/dialogs.pro @@ -3,6 +3,8 @@ TARGET = dialogplugin TARGETPATH = QtQuick/Dialogs IMPORT_VERSION = 1.0 +QMAKE_DOCS = $$PWD/doc/qtquickdialogs.qdocconf + SOURCES += \ qquickabstractfiledialog.cpp \ qquickplatformfiledialog.cpp \ @@ -29,6 +31,7 @@ QML_FILES += \ WidgetColorDialog.qml \ qml/Button.qml \ qml/ColorSlider.qml \ + qml/DefaultWindowDecoration.qml \ qml/TextField.qml \ qml/qmldir \ images/checkers.png \ @@ -36,6 +39,7 @@ QML_FILES += \ images/crosshairs.png \ images/slider_handle.png \ images/sunken_frame.png \ + images/window_border.png \ images/folder.png \ images/up.png diff --git a/src/imports/dialogs/doc/qtquickdialogs.qdocconf b/src/imports/dialogs/doc/qtquickdialogs.qdocconf new file mode 100644 index 0000000000..34f19b5ff3 --- /dev/null +++ b/src/imports/dialogs/doc/qtquickdialogs.qdocconf @@ -0,0 +1,36 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtQuickDialogs +description = Qt Quick Dialogs Reference Documentation +url = http://qt-project.org/doc/qt-$QT_VER/qtquickdialogs/ +version = $QT_VERSION + +qhp.projects = QtQuickDialogs + +qhp.QtQuickDialogs.file = qtquickdialogs.qhp +qhp.QtQuickDialogs.namespace = org.qt-project.qtquickdialogs.$QT_VERSION_TAG +qhp.QtQuickDialogs.virtualFolder = qtquickdialogs +qhp.QtQuickDialogs.indexTitle = Qt Quick Dialogs +qhp.QtQuickDialogs.indexRoot = + +qhp.QtQuickDialogs.filterAttributes = qtquickdialogs $QT_VERSION qtrefdoc +qhp.QtQuickDialogs.customFilters.Qt.name = QtQuickDialogs $QT_VERSION +qhp.QtQuickDialogs.customFilters.Qt.filterAttributes = qtquickdialogs $QT_VERSION + +qhp.QtQuickDialogs.subprojects = qtquickdialogsqmltypes +qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.title = QML Types +qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.indexTitle = Qt Quick Dialogs QML Types +qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.selectors = fake:qmlclass +qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.sortPages = true + +depends = qtqml qtquick qtgui qtwidgets qtdoc + +exampledirs += ../../../../examples/quick/dialogs + +examplesinstallpath = quick/dialogs + +headerdirs += .. + +sourcedirs += .. + +imagedirs += images diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc new file mode 100644 index 0000000000..ee277f48dc --- /dev/null +++ b/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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$ +** +****************************************************************************/ + +/*! + \group qtquickdialog_examples + \ingroup qtquickexamples + \title Qt Quick Examples - Dialogs + \brief A Collection of examples for \l{Qt Quick Dialogs}, written in QML. + + These examples show how to use the \l{Qt Quick Dialogs}. +*/ + diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc new file mode 100644 index 0000000000..5a1223b04d --- /dev/null +++ b/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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$ +** +****************************************************************************/ + +/*! + \group dialogs + \title Dialogs +*/ + +/*! + \page qtquickdialogs-index.html + \title Qt Quick Dialogs + + \brief Qt Quick Dialogs submodule + + The module is new in Qt 5.1. + + \section1 Dialogs + + \annotatedlist dialogs + + \section1 Related information + + \section2 Examples + \list + \li \l{Qt Quick Examples - Dialogs}{Dialogs Examples} + \endlist + + \section2 Reference + \list + \li \l{Qt Quick Dialogs QML Types}{QML Types} + \endlist + +*/ + diff --git a/src/imports/dialogs/images/window_border.png b/src/imports/dialogs/images/window_border.png Binary files differnew file mode 100644 index 0000000000..431af8545d --- /dev/null +++ b/src/imports/dialogs/images/window_border.png diff --git a/src/imports/dialogs/plugin.cpp b/src/imports/dialogs/plugin.cpp index 67653e5965..8d1501cd03 100644 --- a/src/imports/dialogs/plugin.cpp +++ b/src/imports/dialogs/plugin.cpp @@ -48,6 +48,7 @@ #include "qquickabstractcolordialog_p.h" #include "qquickplatformcolordialog_p.h" #include <private/qguiapplication_p.h> +#include <qpa/qplatformintegration.h> //#define PURE_QML_ONLY @@ -57,7 +58,7 @@ QT_BEGIN_NAMESPACE /*! \qmlmodule QtQuick.Dialogs 1 - \title Qt Quick Dialog QML Types + \title Qt Quick Dialogs QML Types \ingroup qmlmodules \brief Provides QML types for standard file, color picker and message dialogs @@ -78,9 +79,18 @@ class QtQuick2DialogsPlugin : public QQmlExtensionPlugin public: QtQuick2DialogsPlugin() : QQmlExtensionPlugin() { } + virtual void initializeEngine(QQmlEngine *engine, const char *uri) { + //qDebug() << Q_FUNC_INFO << uri << m_decorationComponentUrl; + QQuickAbstractDialog::m_decorationComponent = + new QQmlComponent(engine, m_decorationComponentUrl, QQmlComponent::Asynchronous); + } + virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Dialogs")); + bool hasTopLevelWindows = QGuiApplicationPrivate::platformIntegration()-> + hasCapability(QPlatformIntegration::MultipleWindows); QDir qmlDir(baseUrl().toLocalFile()); + m_decorationComponentUrl = QUrl::fromLocalFile(qmlDir.filePath(QString("qml/DefaultWindowDecoration.qml"))); QDir widgetsDir(baseUrl().toLocalFile()); // TODO: find the directory by searching rather than assuming a relative path widgetsDir.cd("../PrivateWidgets"); @@ -96,8 +106,7 @@ public: qmlRegisterType<QQuickPlatformFileDialog>(uri, DIALOGS_MAJOR_MINOR, "FileDialog"); else #endif - registerWidgetOrQmlImplementation<QQuickFileDialog>(widgetsDir, "WidgetFileDialog.qml", - qmlDir, "DefaultFileDialog.qml", "FileDialog", uri); + registerWidgetOrQmlImplementation<QQuickFileDialog>(widgetsDir, qmlDir, "FileDialog", uri, hasTopLevelWindows); // ColorDialog #ifndef PURE_QML_ONLY @@ -105,35 +114,37 @@ public: qmlRegisterType<QQuickPlatformColorDialog>(uri, DIALOGS_MAJOR_MINOR, "ColorDialog"); else #endif - registerWidgetOrQmlImplementation<QQuickColorDialog>(widgetsDir, "WidgetColorDialog.qml", - qmlDir, "DefaultColorDialog.qml", "ColorDialog", uri); + registerWidgetOrQmlImplementation<QQuickColorDialog>(widgetsDir, qmlDir, "ColorDialog", uri, hasTopLevelWindows); } protected: template <class WrapperType> - void registerWidgetOrQmlImplementation(QDir widgetsDir, QString widgetQmlFile, - QDir qmlDir, QString qmlFile, const char *qmlName, const char *uri) { + void registerWidgetOrQmlImplementation(QDir widgetsDir, QDir qmlDir, + const char *qmlName, const char *uri, bool hasTopLevelWindows) { + //qDebug() << Q_FUNC_INFO << qmlDir << qmlName << uri; bool needQml = true; + #ifndef PURE_QML_ONLY // If there is a qmldir and we have a QApplication instance (as opposed to a // widget-free QGuiApplication), assume that the widget-based dialog will work. - if (widgetsDir.exists("qmldir") && !widgetQmlFile.isEmpty() && + if (hasTopLevelWindows && widgetsDir.exists("qmldir") && !qstrcmp(QCoreApplication::instance()->metaObject()->className(), "QApplication")) { - QString dialogQmlPath = qmlDir.filePath(widgetQmlFile); + QString dialogQmlPath = qmlDir.filePath(QString("Widget%1.qml").arg(qmlName)); if (qmlRegisterType(QUrl::fromLocalFile(dialogQmlPath), uri, DIALOGS_MAJOR_MINOR, qmlName) >= 0) needQml = false; - // qDebug() << "registering" << qmlName << " as " << dialogQmlPath << "success?" << needQml; + // qDebug() << "registering" << qmlName << " as " << dialogQmlPath << "success?" << !needQml; } #endif if (needQml) { - QString dialogQmlPath = qmlDir.filePath(qmlFile); QByteArray abstractTypeName = QByteArray("Abstract") + qmlName; qmlRegisterType<WrapperType>(uri, DIALOGS_MAJOR_MINOR, abstractTypeName); // implementation wrapper + QString dialogQmlPath = qmlDir.filePath(QString("Default%1.qml").arg(qmlName)); // qDebug() << "registering" << qmlName << " as " << dialogQmlPath << "success?" << qmlRegisterType(QUrl::fromLocalFile(dialogQmlPath), uri, DIALOGS_MAJOR_MINOR, qmlName); } } + QUrl m_decorationComponentUrl; }; QT_END_NAMESPACE diff --git a/src/imports/dialogs/plugins.qmltypes b/src/imports/dialogs/plugins.qmltypes index 80eb8bd291..4e7090b960 100644 --- a/src/imports/dialogs/plugins.qmltypes +++ b/src/imports/dialogs/plugins.qmltypes @@ -39,6 +39,7 @@ Module { Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } + Property { name: "isWindow"; type: "bool"; isReadonly: true } Property { name: "x"; type: "int" } Property { name: "y"; type: "int" } Property { name: "width"; type: "int" } @@ -56,7 +57,7 @@ Module { Property { name: "selectExisting"; type: "bool" } Property { name: "selectMultiple"; type: "bool" } Property { name: "selectFolder"; type: "bool" } - Property { name: "folder"; type: "string" } + Property { name: "folder"; type: "QUrl" } Property { name: "nameFilters"; type: "QStringList" } Property { name: "selectedNameFilter"; type: "string" } Property { name: "fileUrl"; type: "QUrl"; isReadonly: true } @@ -86,7 +87,7 @@ Module { } Method { name: "setFolder" - Parameter { name: "f"; type: "string" } + Parameter { name: "f"; type: "QUrl" } } Method { name: "setNameFilters" @@ -116,7 +117,7 @@ Module { Method { name: "addSelection" type: "bool" - Parameter { name: "path"; type: "string" } + Parameter { name: "path"; type: "QUrl" } } } } diff --git a/src/imports/dialogs/qml/Button.qml b/src/imports/dialogs/qml/Button.qml index 491dc2e251..4a0ec12cd3 100644 --- a/src/imports/dialogs/qml/Button.qml +++ b/src/imports/dialogs/qml/Button.qml @@ -39,6 +39,7 @@ *****************************************************************************/ import QtQuick 2.1 +import QtQuick.Window 2.1 Item { id: container @@ -48,10 +49,10 @@ Item { signal clicked property alias containsMouse: mouseArea.containsMouse property alias pressed: mouseArea.pressed - implicitHeight: buttonLabel.implicitHeight - implicitWidth: buttonLabel.implicitWidth - height: buttonLabel.implicitHeight + 12 - width: Math.max(80, implicitWidth + 8) + implicitHeight: buttonLabel.implicitHeight * 1.2 + implicitWidth: Math.max(Screen.logicalPixelDensity * 10, buttonLabel.implicitWidth * 1.2) + height: implicitHeight + width: implicitWidth SystemPalette { id: palette } @@ -64,7 +65,7 @@ Item { GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) } } antialiasing: true - radius: 5 + radius: height / 4 border.color: Qt.darker(palette.button, 1.5) border.width: 1 } @@ -78,10 +79,8 @@ Item { Text { id: buttonLabel - width: parent.width - horizontalAlignment: Text.Center text: container.text color: palette.buttonText - anchors.verticalCenter: parent.verticalCenter + anchors.centerIn: parent } } diff --git a/src/imports/dialogs/qml/DefaultWindowDecoration.qml b/src/imports/dialogs/qml/DefaultWindowDecoration.qml new file mode 100644 index 0000000000..69a8658aba --- /dev/null +++ b/src/imports/dialogs/qml/DefaultWindowDecoration.qml @@ -0,0 +1,68 @@ +/***************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtQuick.Dialogs module 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.1 + +Rectangle { + color: "#80000000" + anchors.fill: parent + z: 1000000 + property alias content: borderImage.content + property bool dismissOnOuterClick: true + signal dismissed + MouseArea { + anchors.fill: parent + enabled: dismissOnOuterClick + onClicked: dismissed() + BorderImage { + id: borderImage + property Item content + + width: content ? content.width + 15 : 0 + height: content ? content.height + 15 : 0 + onWidthChanged: content.x = 5 + onHeightChanged: content.y = 5 + border { left: 10; top: 10; right: 10; bottom: 10 } + source: "../images/window_border.png" + anchors.centerIn: parent + onContentChanged: if (content) content.parent = borderImage + } + } +} diff --git a/src/imports/dialogs/qml/TextField.qml b/src/imports/dialogs/qml/TextField.qml index baa469caa9..9a6427a105 100644 --- a/src/imports/dialogs/qml/TextField.qml +++ b/src/imports/dialogs/qml/TextField.qml @@ -45,10 +45,10 @@ Item { property alias textInput: textInput property alias text: textInput.text - property real implicitWidth: textInput.implicitWidth + rect.radius * 2 - property real implicitHeight: textInput.implicitHeight + rect.radius * 2 signal accepted signal downPressed + implicitWidth: textInput.implicitWidth + rect.radius * 2 + implicitHeight: textInput.implicitHeight function copyAll() { textInput.selectAll() diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp index 9a9f3bc11b..7cfd7ea692 100644 --- a/src/imports/dialogs/qquickabstractcolordialog.cpp +++ b/src/imports/dialogs/qquickabstractcolordialog.cpp @@ -91,7 +91,7 @@ bool QQuickAbstractColorDialog::showAlphaChannel() const return m_options->testOption(QColorDialogOptions::ShowAlphaChannel); } -void QQuickAbstractColorDialog::setTitle(QString t) +void QQuickAbstractColorDialog::setTitle(const QString &t) { if (m_options->windowTitle() == t) return; m_options->setWindowTitle(t); diff --git a/src/imports/dialogs/qquickabstractcolordialog_p.h b/src/imports/dialogs/qquickabstractcolordialog_p.h index 3301605c86..46f0f84acb 100644 --- a/src/imports/dialogs/qquickabstractcolordialog_p.h +++ b/src/imports/dialogs/qquickabstractcolordialog_p.h @@ -78,7 +78,7 @@ public: public Q_SLOTS: void setVisible(bool v); void setModality(Qt::WindowModality m); - void setTitle(QString t); + void setTitle(const QString &t); void setColor(QColor arg); void setShowAlphaChannel(bool arg); diff --git a/src/imports/dialogs/qquickabstractdialog.cpp b/src/imports/dialogs/qquickabstractdialog.cpp index abdc9e067c..560cbaf3e0 100644 --- a/src/imports/dialogs/qquickabstractdialog.cpp +++ b/src/imports/dialogs/qquickabstractdialog.cpp @@ -44,11 +44,14 @@ #include <private/qguiapplication_p.h> #include <QWindow> +#include <QQmlComponent> #include <QQuickWindow> #include <qpa/qplatformintegration.h> QT_BEGIN_NAMESPACE +QQmlComponent *QQuickAbstractDialog::m_decorationComponent(0); + QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent) : QObject(parent) , m_parentWindow(0) @@ -56,6 +59,10 @@ QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent) , m_modality(Qt::WindowModal) , m_qmlImplementation(0) , m_dialogWindow(0) + , m_contentItem(0) + , m_windowDecoration(0) + , m_hasNativeWindows(QGuiApplicationPrivate::platformIntegration()-> + hasCapability(QPlatformIntegration::MultipleWindows)) { } @@ -82,36 +89,47 @@ void QQuickAbstractDialog::setVisible(bool v) if (!m_dialogWindow) { m_dialogWindow = qobject_cast<QWindow *>(m_qmlImplementation); if (!m_dialogWindow) { - QQuickItem *dlgItem = qobject_cast<QQuickItem *>(m_qmlImplementation); - if (dlgItem) { - m_dialogWindow = dlgItem->window(); + m_contentItem = qobject_cast<QQuickItem *>(m_qmlImplementation); + if (m_contentItem) { + m_dialogWindow = m_contentItem->window(); // An Item-based dialog implementation doesn't come with a window, so // we have to instantiate one iff the platform allows it. - if (!m_dialogWindow && QGuiApplicationPrivate::platformIntegration()-> - hasCapability(QPlatformIntegration::MultipleWindows)) { + if (!m_dialogWindow && m_hasNativeWindows) { QQuickWindow *win = new QQuickWindow; ((QObject *)win)->setParent(this); // memory management only m_dialogWindow = win; - dlgItem->setParentItem(win->contentItem()); - m_dialogWindow->setMinimumSize(QSize(dlgItem->width(), dlgItem->height())); + m_contentItem->setParentItem(win->contentItem()); + m_dialogWindow->setMinimumSize(QSize(m_contentItem->implicitWidth(), m_contentItem->implicitHeight())); connect(win, SIGNAL(widthChanged(int)), this, SLOT(windowGeometryChanged())); connect(win, SIGNAL(heightChanged(int)), this, SLOT(windowGeometryChanged())); } QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); - // qDebug() << "item implementation" << dlgItem << "has window" << m_dialogWindow << "and parent" << parentItem; // If the platform does not support multiple windows, but the dialog is - // implemented as an Item, then just reparent it and make it visible. - // TODO QTBUG-29818: put it into a fake Item-based window, when we have a reusable self-decorated one. - if (parentItem && !m_dialogWindow) - dlgItem->setParentItem(parentItem); + // implemented as an Item, then try to decorate it as a fake window and make it visible. + if (parentItem && !m_dialogWindow && !m_windowDecoration) { + if (m_decorationComponent) { + if (m_decorationComponent->isLoading()) + connect(m_decorationComponent, SIGNAL(statusChanged(QQmlComponent::Status)), + this, SLOT(decorationLoaded())); + else + decorationLoaded(); + } + // Window decoration wasn't possible, so just reparent it into the scene + else { + m_contentItem->setParentItem(parentItem); + m_contentItem->setZ(10000); + } + } } } if (m_dialogWindow) connect(m_dialogWindow, SIGNAL(visibleChanged(bool)), this, SLOT(visibleChanged(bool))); } - if (m_dialogWindow) { + if (m_windowDecoration) { + m_windowDecoration->setVisible(v); + } else if (m_dialogWindow) { if (v) { m_dialogWindow->setTransientParent(parentWindow()); m_dialogWindow->setTitle(title()); @@ -124,6 +142,38 @@ void QQuickAbstractDialog::setVisible(bool v) emit visibilityChanged(); } +void QQuickAbstractDialog::decorationLoaded() +{ + bool ok = false; + QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); + if (m_decorationComponent->isError()) { + qWarning() << m_decorationComponent->errors(); + } else { + QObject *decoration = m_decorationComponent->create(); + m_windowDecoration = qobject_cast<QQuickItem *>(decoration); + if (m_windowDecoration) { + m_windowDecoration->setParentItem(parentItem); + // Give the window decoration its content to manage + QVariant contentVariant; + contentVariant.setValue<QQuickItem*>(m_contentItem); + m_windowDecoration->setProperty("content", contentVariant); + connect(m_windowDecoration, SIGNAL(dismissed()), this, SLOT(reject())); + ok = true; + } else { + qWarning() << m_decorationComponent->url() << + "cannot be used as a window decoration because it's not an Item"; + delete m_windowDecoration; + delete m_decorationComponent; + m_decorationComponent = 0; + } + } + // Window decoration wasn't possible, so just reparent it into the scene + if (!ok) { + m_contentItem->setParentItem(parentItem); + m_contentItem->setZ(10000); + } +} + void QQuickAbstractDialog::setModality(Qt::WindowModality m) { if (m_modality == m) return; @@ -152,7 +202,6 @@ void QQuickAbstractDialog::visibleChanged(bool v) void QQuickAbstractDialog::windowGeometryChanged() { QQuickItem *content = qobject_cast<QQuickItem*>(m_qmlImplementation); -qDebug() << Q_FUNC_INFO << m_dialogWindow << content; if (m_dialogWindow && content) { content->setWidth(m_dialogWindow->width()); content->setHeight(m_dialogWindow->height()); diff --git a/src/imports/dialogs/qquickabstractdialog_p.h b/src/imports/dialogs/qquickabstractdialog_p.h index 2ad24f98e0..5e3d9b43f7 100644 --- a/src/imports/dialogs/qquickabstractdialog_p.h +++ b/src/imports/dialogs/qquickabstractdialog_p.h @@ -66,6 +66,7 @@ class QQuickAbstractDialog : public QObject Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) + Q_PROPERTY(bool isWindow READ isWindow CONSTANT) Q_PROPERTY(int x READ x WRITE setX NOTIFY geometryChanged) Q_PROPERTY(int y READ y WRITE setY NOTIFY geometryChanged) Q_PROPERTY(int width READ width WRITE setWidth NOTIFY geometryChanged) @@ -87,8 +88,9 @@ public: virtual void setVisible(bool v); virtual void setModality(Qt::WindowModality m); - virtual void setTitle(QString t) = 0; + virtual void setTitle(const QString &t) = 0; void setQmlImplementation(QObject* obj); + bool isWindow() const { return m_hasNativeWindows; } void setX(int arg); void setY(int arg); void setWidth(int arg); @@ -107,6 +109,7 @@ Q_SIGNALS: void rejected(); protected Q_SLOTS: + void decorationLoaded(); void accept(); void reject(); void visibleChanged(bool v); @@ -124,6 +127,13 @@ protected: protected: // variables for pure-QML implementations only QObject *m_qmlImplementation; QWindow *m_dialogWindow; + QQuickItem *m_contentItem; + QQuickItem *m_windowDecoration; + bool m_hasNativeWindows; + + static QQmlComponent *m_decorationComponent; + + friend class QtQuick2DialogsPlugin; Q_DISABLE_COPY(QQuickAbstractDialog) }; diff --git a/src/imports/dialogs/qquickabstractfiledialog.cpp b/src/imports/dialogs/qquickabstractfiledialog.cpp index 32442de41f..d8a75feb53 100644 --- a/src/imports/dialogs/qquickabstractfiledialog.cpp +++ b/src/imports/dialogs/qquickabstractfiledialog.cpp @@ -78,7 +78,7 @@ QString QQuickAbstractFileDialog::title() const return m_options->windowTitle(); } -void QQuickAbstractFileDialog::setTitle(QString t) +void QQuickAbstractFileDialog::setTitle(const QString &t) { if (m_options->windowTitle() == t) return; m_options->setWindowTitle(t); @@ -106,18 +106,19 @@ void QQuickAbstractFileDialog::setSelectFolder(bool selectFolder) updateModes(); } -QString QQuickAbstractFileDialog::folder() +QUrl QQuickAbstractFileDialog::folder() { if (m_dlgHelper && !m_dlgHelper->directory().isEmpty()) - return m_dlgHelper->directory(); - return m_options->initialDirectory(); + return QUrl::fromLocalFile(m_dlgHelper->directory()); + return QUrl::fromLocalFile(m_options->initialDirectory()); } -void QQuickAbstractFileDialog::setFolder(QString f) +void QQuickAbstractFileDialog::setFolder(const QUrl &f) { + QString dir = f.path(); if (m_dlgHelper) - m_dlgHelper->setDirectory(f); - m_options->setInitialDirectory(f); + m_dlgHelper->setDirectory(dir); + m_options->setInitialDirectory(dir); emit folderChanged(); } @@ -141,7 +142,7 @@ QString QQuickAbstractFileDialog::selectedNameFilter() return ret; } -void QQuickAbstractFileDialog::selectNameFilter(QString f) +void QQuickAbstractFileDialog::selectNameFilter(const QString &f) { // This should work whether the dialog is currently being shown already, or ahead of time. m_options->setInitiallySelectedNameFilter(f); diff --git a/src/imports/dialogs/qquickabstractfiledialog_p.h b/src/imports/dialogs/qquickabstractfiledialog_p.h index 965f1a7029..5ce48e8055 100644 --- a/src/imports/dialogs/qquickabstractfiledialog_p.h +++ b/src/imports/dialogs/qquickabstractfiledialog_p.h @@ -67,7 +67,7 @@ class QQuickAbstractFileDialog : public QQuickAbstractDialog Q_PROPERTY(bool selectExisting READ selectExisting WRITE setSelectExisting NOTIFY fileModeChanged) Q_PROPERTY(bool selectMultiple READ selectMultiple WRITE setSelectMultiple NOTIFY fileModeChanged) Q_PROPERTY(bool selectFolder READ selectFolder WRITE setSelectFolder NOTIFY fileModeChanged) - Q_PROPERTY(QString folder READ folder WRITE setFolder NOTIFY folderChanged) + Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged) Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters NOTIFY nameFiltersChanged) Q_PROPERTY(QString selectedNameFilter READ selectedNameFilter WRITE selectNameFilter NOTIFY filterSelected) Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY selectionAccepted) @@ -81,7 +81,7 @@ public: bool selectExisting() const { return m_selectExisting; } bool selectMultiple() const { return m_selectMultiple; } bool selectFolder() const { return m_selectFolder; } - QString folder(); + QUrl folder(); QStringList nameFilters() const { return m_options->nameFilters(); } QString selectedNameFilter(); QUrl fileUrl(); @@ -89,13 +89,13 @@ public: public Q_SLOTS: void setVisible(bool v); - void setTitle(QString t); + void setTitle(const QString &t); void setSelectExisting(bool s); void setSelectMultiple(bool s); void setSelectFolder(bool s); - void setFolder(QString f); + void setFolder(const QUrl &f); void setNameFilters(const QStringList &f); - void selectNameFilter(QString f); + void selectNameFilter(const QString &f); Q_SIGNALS: void folderChanged(); diff --git a/src/imports/dialogs/qquickcolordialog.cpp b/src/imports/dialogs/qquickcolordialog.cpp index 39af99770e..d0e0e11b07 100644 --- a/src/imports/dialogs/qquickcolordialog.cpp +++ b/src/imports/dialogs/qquickcolordialog.cpp @@ -64,13 +64,13 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::AbstractColorDialog::accepted - The \a accepted signal is emitted by \l accept(). + This signal is emitted by \l accept(). */ /*! \qmlsignal QtQuick::Dialogs::AbstractColorDialog::rejected - The \a accepted signal is emitted by \l reject(). + This signal is emitted by \l reject(). */ /*! @@ -110,12 +110,6 @@ QQuickColorDialog::~QQuickColorDialog() */ /*! - \qmlproperty bool AbstractColorDialog::filePaths - - A list of files to be populated as the user chooses. -*/ - -/*! \qmlproperty QObject AbstractColorDialog::implementation The QML object which implements the actual file dialog. Should be either a diff --git a/src/imports/dialogs/qquickfiledialog.cpp b/src/imports/dialogs/qquickfiledialog.cpp index f78e8a6f8d..2ee4afc5d2 100644 --- a/src/imports/dialogs/qquickfiledialog.cpp +++ b/src/imports/dialogs/qquickfiledialog.cpp @@ -64,13 +64,13 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::AbstractFileDialog::accepted - The \a accepted signal is emitted by \l accept(). + This signal is emitted by \l accept(). */ /*! \qmlsignal QtQuick::Dialogs::AbstractFileDialog::rejected - The \a accepted signal is emitted by \l reject(). + This signal is emitted by \l reject(). */ /*! @@ -105,10 +105,7 @@ QQuickFileDialog::~QQuickFileDialog() QList<QUrl> QQuickFileDialog::fileUrls() { - QList<QUrl> ret; - foreach (QString path, m_selections) - ret << QUrl::fromLocalFile(path); - return ret; + return m_selections; } /*! @@ -118,13 +115,13 @@ QList<QUrl> QQuickFileDialog::fileUrls() */ /*! - \qmlproperty bool AbstractFileDialog::filePaths + \qmlproperty bool AbstractFileDialog::fileUrls A list of files to be populated as the user chooses. */ /*! - \brief Clears \l filePaths + \brief Clears \l fileUrls */ void QQuickFileDialog::clearSelection() { @@ -132,20 +129,18 @@ void QQuickFileDialog::clearSelection() } /*! - \brief Adds one file to \l filePaths + \brief Adds one file to \l fileUrls - \l path should be given as an absolute file system path. If it is given as a - file:// URL, it will be converted to a path. Returns true on success, - false if the given path is not valid given the current setting properties. + \l path should be given as an absolute file:// path URL. + Returns true on success, false if the given path is + not valid given the current property settings. */ -bool QQuickFileDialog::addSelection(QString path) +bool QQuickFileDialog::addSelection(const QUrl &path) { - if (path.startsWith("file:")) - path = QUrl(path).toLocalFile(); - QFileInfo info(path); + QFileInfo info(path.toLocalFile()); if (info.exists() && ((info.isDir() && m_selectFolder) || !info.isDir())) { if (m_selectFolder) - m_selections.append(pathFolder(path).toLocalFile()); + m_selections.append(pathFolder(path.toLocalFile())); else m_selections.append(path); return true; diff --git a/src/imports/dialogs/qquickfiledialog_p.h b/src/imports/dialogs/qquickfiledialog_p.h index 93e11f9e3e..0176bc3fe4 100644 --- a/src/imports/dialogs/qquickfiledialog_p.h +++ b/src/imports/dialogs/qquickfiledialog_p.h @@ -72,7 +72,7 @@ signals: public Q_SLOTS: void clearSelection(); - bool addSelection(QString path); + bool addSelection(const QUrl &path); protected: virtual QPlatformFileDialogHelper *helper() { return 0; } @@ -81,7 +81,7 @@ protected: Q_INVOKABLE QUrl pathFolder(const QString &path); private: - QStringList m_selections; + QList<QUrl> m_selections; Q_DISABLE_COPY(QQuickFileDialog) }; diff --git a/src/imports/dialogs/qquickplatformcolordialog.cpp b/src/imports/dialogs/qquickplatformcolordialog.cpp index 491a2e687c..8dc6d09f2c 100644 --- a/src/imports/dialogs/qquickplatformcolordialog.cpp +++ b/src/imports/dialogs/qquickplatformcolordialog.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE \qmltype ColorDialog \instantiates QQuickPlatformColorDialog \inqmlmodule QtQuick.Dialogs 1 - \ingroup qtquick-visual + \ingroup dialogs \brief Dialog component for choosing a color. \since Qt 5.1 @@ -102,8 +102,8 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::ColorDialog::accepted - The \a accepted signal is emitted when the user has finished using the - dialog. You can then inspect the \a color property to get the selection. + This handler is called when the user has finished using the + dialog. You can then inspect the \l color property to get the selection. Example: @@ -117,7 +117,7 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::ColorDialog::rejected - The \a rejected signal is emitted when the user has dismissed the dialog, + This handler is called when the user has dismissed the dialog, either by closing the dialog window or by pressing the Cancel button. */ diff --git a/src/imports/dialogs/qquickplatformfiledialog.cpp b/src/imports/dialogs/qquickplatformfiledialog.cpp index d767f65499..3da9f6c3b2 100644 --- a/src/imports/dialogs/qquickplatformfiledialog.cpp +++ b/src/imports/dialogs/qquickplatformfiledialog.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE \qmltype FileDialog \instantiates QQuickPlatformFileDialog \inqmlmodule QtQuick.Dialogs 1 - \ingroup qtquick-visual + \ingroup dialogs \brief Dialog component for choosing files from a local filesystem. \since Qt 5.1 @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE id: fileDialog title: "Please choose a file" onAccepted: { - console.log("You chose: " + fileDialog.filePaths) + console.log("You chose: " + fileDialog.fileUrls) Qt.quit() } onRejected: { @@ -103,15 +103,15 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::FileDialog::accepted - The \a accepted signal is emitted when the user has finished using the - dialog. You can then inspect the \a filePath or \a filePaths properties to + This handler is called when the user has finished using the + dialog. You can then inspect the \l fileUrl or \l fileUrls properties to get the selection. Example: \qml FileDialog { - onAccepted: { console.log("Selected file: " + filePath) } + onAccepted: { console.log("Selected file: " + fileUrl) } } \endqml */ @@ -119,7 +119,7 @@ QT_BEGIN_NAMESPACE /*! \qmlsignal QtQuick::Dialogs::FileDialog::rejected - The \a rejected signal is emitted when the user has dismissed the dialog, + This handler is called when the user has dismissed the dialog, either by closing the dialog window or by pressing the Cancel button. */ @@ -191,7 +191,7 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper() containing the dialog's parent Item, modal with respect to the whole application, or non-modal. - By default it is \l WindowModal. + By default it is \c Qt.WindowModal. Modality does not mean that there are any blocking calls to wait for the dialog to be accepted or rejected; it's only that the user will be @@ -252,7 +252,7 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper() */ /*! - \qmlproperty string FileDialog::folder + \qmlproperty url FileDialog::folder The path to the currently selected folder. Setting this property before invoking open() will cause the file browser to be initially positioned on @@ -295,18 +295,18 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper() */ /*! - \qmlproperty string FileDialog::filePath + \qmlproperty url FileDialog::fileUrl The path of the file which was selected by the user. \note This property is set only if exactly one file was selected. In all - other cases, it will return an empty string. + other cases, it will be empty. - \sa filePaths + \sa fileUrls */ /*! - \qmlproperty list<string> FileDialog::filePaths + \qmlproperty list<url> FileDialog::fileUrls The list of file paths which were selected by the user. */ diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index 2181562098..90e8a56399 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE /*! \qmlmodule QtQml.Models 2 - \title Qt QML Model QML Types + \title Qt QML Models QML Types \ingroup qmlmodules \brief Provides QML types for data models \since 5.1 @@ -60,7 +60,8 @@ QT_BEGIN_NAMESPACE import QtQml.Models 2.1 \endcode - Note that QtQml.Models module started at version 2.1 to match the version of the parent module. + Note that QtQml.Models module started at version 2.1 to match the version + of the parent module, \l{Qt QML}. */ diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes index e5381629cc..cc619dc4ff 100644 --- a/src/imports/qtquick2/plugins.qmltypes +++ b/src/imports/qtquick2/plugins.qmltypes @@ -3,12 +3,20 @@ import QtQuick.tooling 1.1 // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // -// This file was auto-generated with the command 'qmlplugindump -builtins'. +// This file was auto-generated with the command 'qmlplugindump -notrelocatable -builtins'. Module { Component { name: "QAbstractItemModel" prototype: "QObject" + Enum { + name: "LayoutChangeHint" + values: { + "NoLayoutChangeHint": 0, + "VerticalSortHint": 1, + "HorizontalSortHint": 2 + } + } Signal { name: "dataChanged" Parameter { name: "topLeft"; type: "QModelIndex" } @@ -167,6 +175,7 @@ Module { name: "QInputMethod" prototype: "QObject" exports: ["QtQuick/InputMethod 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Action" values: { @@ -215,6 +224,7 @@ Module { Component { name: "QObject" exports: ["QtQml/QtObject 2.0", "QtQuick/QtObject 2.0"] + exportMetaObjectRevisions: [0, 0] Property { name: "objectName"; type: "string" } Signal { name: "objectNameChanged" @@ -228,9 +238,26 @@ Module { } } Component { + name: "QQmlApplication" + prototype: "QObject" + Property { name: "arguments"; type: "QStringList"; isReadonly: true } + Property { name: "name"; type: "string" } + Property { name: "version"; type: "string" } + Signal { name: "aboutToQuit" } + Method { + name: "setName" + Parameter { name: "arg"; type: "string" } + } + Method { + name: "setVersion" + Parameter { name: "arg"; type: "string" } + } + } + Component { name: "QQmlBind" prototype: "QObject" exports: ["QtQml/Binding 2.0", "QtQuick/Binding 2.0"] + exportMetaObjectRevisions: [0, 0] Property { name: "target"; type: "QObject"; isPointer: true } Property { name: "property"; type: "string" } Property { name: "value"; type: "QVariant" } @@ -244,6 +271,7 @@ Module { "QtQml/Component 2.0", "QtQuick/Component 2.0" ] + exportMetaObjectRevisions: [0, 0, 0] attachedType: "QQmlComponentAttached" Enum { name: "CompilationMode" @@ -298,13 +326,105 @@ Module { name: "QQmlConnections" prototype: "QObject" exports: ["QtQml/Connections 2.0", "QtQuick/Connections 2.0"] + exportMetaObjectRevisions: [0, 0] Property { name: "target"; type: "QObject"; isPointer: true } Property { name: "ignoreUnknownSignals"; type: "bool" } } Component { + name: "QQmlDelegateModel" + defaultProperty: "delegate" + prototype: "QQmlInstanceModel" + exports: ["QtQuick/VisualDataModel 2.0"] + exportMetaObjectRevisions: [0] + attachedType: "QQmlDelegateModelAttached" + Property { name: "model"; type: "QVariant" } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "filterOnGroup"; type: "string" } + Property { name: "items"; type: "QQmlDelegateModelGroup"; isReadonly: true; isPointer: true } + Property { + name: "persistedItems" + type: "QQmlDelegateModelGroup" + isReadonly: true + isPointer: true + } + Property { name: "groups"; type: "QQmlDelegateModelGroup"; isList: true; isReadonly: true } + Property { name: "parts"; type: "QObject"; isReadonly: true; isPointer: true } + Property { name: "rootIndex"; type: "QVariant" } + Signal { name: "filterGroupChanged" } + Signal { name: "defaultGroupsChanged" } + Method { + name: "modelIndex" + type: "QVariant" + Parameter { name: "idx"; type: "int" } + } + Method { name: "parentModelIndex"; type: "QVariant" } + } + Component { + name: "QQmlDelegateModelAttached" + prototype: "QObject" + Property { name: "model"; type: "QQmlDelegateModel"; isReadonly: true; isPointer: true } + Property { name: "groups"; type: "QStringList" } + Property { name: "isUnresolved"; type: "bool"; isReadonly: true } + Signal { name: "unresolvedChanged" } + } + Component { + name: "QQmlDelegateModelGroup" + prototype: "QObject" + exports: ["QtQuick/VisualDataGroup 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "name"; type: "string" } + Property { name: "includeByDefault"; type: "bool" } + Signal { name: "defaultIncludeChanged" } + Signal { + name: "changed" + Parameter { name: "removed"; type: "QQmlV8Handle" } + Parameter { name: "inserted"; type: "QQmlV8Handle" } + } + Method { + name: "insert" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "create" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "resolve" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "remove" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "addGroups" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "removeGroups" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "setGroups" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "move" + Parameter { type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "get" + type: "QQmlV8Handle" + Parameter { name: "index"; type: "int" } + } + } + Component { name: "QQmlDelegateModelParts"; prototype: "QObject" } + Component { name: "QQmlEasingValueType" prototype: "QQmlValueType" exports: ["QtQuick/Easing 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Type" values: { @@ -363,8 +483,111 @@ Module { Property { name: "bezierCurve"; type: "QVariantList" } } Component { + name: "QQmlInstanceModel" + prototype: "QObject" + Property { name: "count"; type: "int"; isReadonly: true } + Signal { + name: "modelUpdated" + Parameter { name: "changeSet"; type: "QQmlChangeSet" } + Parameter { name: "reset"; type: "bool" } + } + Signal { + name: "createdItem" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "initItem" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "destroyingItem" + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + } + Component { + name: "QQmlInstantiator" + defaultProperty: "delegate" + prototype: "QObject" + exports: ["QtQml/Instantiator 2.1", "QtQuick/Instantiator 2.1"] + exportMetaObjectRevisions: [0, 0] + Property { name: "active"; type: "bool" } + Property { name: "asynchronous"; type: "bool" } + Property { name: "model"; type: "QVariant" } + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "object"; type: "QObject"; isReadonly: true; isPointer: true } + Signal { + name: "objectAdded" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "objectRemoved" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Method { + name: "objectAt" + type: "QObject*" + Parameter { name: "index"; type: "int" } + } + } + Component { + name: "QQmlListElement" + prototype: "QObject" + exports: ["QtQuick/ListElement 2.0"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QQmlListModel" + prototype: "QAbstractListModel" + exports: ["QtQuick/ListModel 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "dynamicRoles"; type: "bool" } + Method { name: "clear" } + Method { + name: "remove" + Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "append" + Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "insert" + Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } + } + Method { + name: "get" + type: "QQmlV8Handle" + Parameter { name: "index"; type: "int" } + } + Method { + name: "set" + Parameter { name: "index"; type: "int" } + Parameter { type: "QQmlV8Handle" } + } + Method { + name: "setProperty" + Parameter { name: "index"; type: "int" } + Parameter { name: "property"; type: "string" } + Parameter { name: "value"; type: "QVariant" } + } + Method { + name: "move" + Parameter { name: "from"; type: "int" } + Parameter { name: "to"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Method { name: "sync" } + } + Component { name: "QQmlLocale" exports: ["QtQuick/Locale 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "MeasurementSystem" values: { @@ -404,9 +627,24 @@ Module { } } Component { + name: "QQmlObjectModel" + defaultProperty: "children" + prototype: "QQmlInstanceModel" + exports: ["QtQuick/VisualItemModel 2.0"] + exportMetaObjectRevisions: [0] + attachedType: "QQmlObjectModelAttached" + Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } + } + Component { + name: "QQmlObjectModelAttached" + prototype: "QObject" + Property { name: "index"; type: "int"; isReadonly: true } + } + Component { name: "QQmlTimer" prototype: "QObject" exports: ["QtQml/Timer 2.0", "QtQuick/Timer 2.0"] + exportMetaObjectRevisions: [0, 0] Property { name: "interval"; type: "int" } Property { name: "running"; type: "bool" } Property { name: "repeat"; type: "bool" } @@ -422,6 +660,7 @@ Module { name: "QQuickAbstractAnimation" prototype: "QObject" exports: ["QtQuick/Animation 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Loops" values: { @@ -461,14 +700,18 @@ Module { name: "QQuickAccessibleAttached" prototype: "QObject" exports: ["QtQuick/Accessible 2.0"] + exportMetaObjectRevisions: [0] Property { name: "role"; type: "QAccessible::Role" } Property { name: "name"; type: "string" } Property { name: "description"; type: "string" } + Method { name: "valueChanged" } + Method { name: "cursorPositionChanged" } } Component { name: "QQuickAnchorAnimation" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/AnchorAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "targets"; type: "QQuickItem"; isList: true; isReadonly: true } Property { name: "duration"; type: "int" } Property { name: "easing"; type: "QEasingCurve" } @@ -485,6 +728,7 @@ Module { name: "QQuickAnchorChanges" prototype: "QQuickStateOperation" exports: ["QtQuick/AnchorChanges 2.0"] + exportMetaObjectRevisions: [0] Property { name: "target"; type: "QQuickItem"; isPointer: true } Property { name: "anchors"; type: "QQuickAnchorSet"; isReadonly: true; isPointer: true } } @@ -527,6 +771,7 @@ Module { defaultProperty: "data" prototype: "QQuickImage" exports: ["QtQuick/AnimatedImage 2.0"] + exportMetaObjectRevisions: [0] Property { name: "playing"; type: "bool" } Property { name: "paused"; type: "bool" } Property { name: "currentFrame"; type: "int" } @@ -539,6 +784,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/AnimatedSprite 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "LoopParameters" values: { @@ -698,6 +944,7 @@ Module { defaultProperty: "animation" prototype: "QObject" exports: ["QtQuick/AnimationController 2.0"] + exportMetaObjectRevisions: [0] Property { name: "progress"; type: "double" } Property { name: "animation"; type: "QQuickAbstractAnimation"; isPointer: true } Method { name: "reload" } @@ -712,8 +959,9 @@ Module { } Component { name: "QQuickApplication" - prototype: "QObject" + prototype: "QQmlApplication" exports: ["QtQuick/Application 2.0"] + exportMetaObjectRevisions: [0] Property { name: "active"; type: "bool"; isReadonly: true } Property { name: "layoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true } Property { name: "supportsMultipleWindows"; type: "bool"; isReadonly: true } @@ -723,6 +971,7 @@ Module { defaultProperty: "data" prototype: "QQuickImplicitSizeItem" exports: ["QtQuick/Positioner 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQuickPositionerAttached" Property { name: "spacing"; type: "double" } Property { name: "populate"; type: "QQuickTransition"; isPointer: true } @@ -734,6 +983,7 @@ Module { defaultProperty: "animation" prototype: "QObject" exports: ["QtQuick/Behavior 2.0"] + exportMetaObjectRevisions: [0] Property { name: "animation"; type: "QQuickAbstractAnimation"; isPointer: true } Property { name: "enabled"; type: "bool" } } @@ -742,6 +992,7 @@ Module { defaultProperty: "data" prototype: "QQuickImageBase" exports: ["QtQuick/BorderImage 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "TileMode" values: { @@ -760,6 +1011,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/Canvas 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "RenderTarget" values: { @@ -846,6 +1098,7 @@ Module { name: "QQuickColorAnimation" prototype: "QQuickPropertyAnimation" exports: ["QtQuick/ColorAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "from"; type: "QColor" } Property { name: "to"; type: "QColor" } } @@ -854,6 +1107,7 @@ Module { defaultProperty: "data" prototype: "QQuickBasePositioner" exports: ["QtQuick/Column 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickCurve" @@ -867,6 +1121,7 @@ Module { name: "QQuickDoubleValidator" prototype: "QDoubleValidator" exports: ["QtQuick/DoubleValidator 2.0"] + exportMetaObjectRevisions: [0] Property { name: "locale"; type: "string" } Signal { name: "localeNameChanged" } } @@ -874,13 +1129,15 @@ Module { name: "QQuickDrag" prototype: "QObject" exports: ["QtQuick/Drag 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQuickDragAttached" Enum { name: "Axis" values: { "XAxis": 1, "YAxis": 2, - "XAndYAxis": 3 + "XAndYAxis": 3, + "XandYAxis": 3 } } Property { name: "target"; type: "QQuickItem"; isPointer: true } @@ -914,6 +1171,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/DropArea 2.0"] + exportMetaObjectRevisions: [0] Property { name: "containsDrag"; type: "bool"; isReadonly: true } Property { name: "keys"; type: "QStringList" } Property { name: "drag"; type: "QQuickDropAreaDrag"; isReadonly: true; isPointer: true } @@ -945,6 +1203,7 @@ Module { defaultProperty: "flickableData" prototype: "QQuickItem" exports: ["QtQuick/Flickable 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "BoundsBehavior" values: { @@ -1054,6 +1313,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/Flipable 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Side" values: { @@ -1070,6 +1330,7 @@ Module { defaultProperty: "data" prototype: "QQuickBasePositioner" exports: ["QtQuick/Flow 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Flow" values: { @@ -1086,11 +1347,13 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/FocusScope 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickFontLoader" prototype: "QObject" exports: ["QtQuick/FontLoader 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Status" values: { @@ -1108,6 +1371,7 @@ Module { name: "QQuickFontValueType" prototype: "QQmlValueType" exports: ["QtQuick/Font 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "FontWeight" values: { @@ -1146,6 +1410,7 @@ Module { defaultProperty: "stops" prototype: "QObject" exports: ["QtQuick/Gradient 2.0"] + exportMetaObjectRevisions: [0] Property { name: "stops"; type: "QQuickGradientStop"; isList: true; isReadonly: true } Signal { name: "updated" } } @@ -1153,6 +1418,7 @@ Module { name: "QQuickGradientStop" prototype: "QObject" exports: ["QtQuick/GradientStop 2.0"] + exportMetaObjectRevisions: [0] Property { name: "position"; type: "double" } Property { name: "color"; type: "QColor" } } @@ -1160,7 +1426,8 @@ Module { name: "QQuickGrid" defaultProperty: "data" prototype: "QQuickBasePositioner" - exports: ["QtQuick/Grid 2.0"] + exports: ["QtQuick/Grid 2.0", "QtQuick/Grid 2.1"] + exportMetaObjectRevisions: [0, 1] Enum { name: "Flow" values: { @@ -1168,6 +1435,22 @@ Module { "TopToBottom": 1 } } + Enum { + name: "HAlignment" + values: { + "AlignLeft": 1, + "AlignRight": 2, + "AlignHCenter": 4 + } + } + Enum { + name: "VAlignment" + values: { + "AlignTop": 32, + "AlignBottom": 64, + "AlignVCenter": 128 + } + } Property { name: "rows"; type: "int" } Property { name: "columns"; type: "int" } Property { name: "rowSpacing"; type: "double" } @@ -1175,18 +1458,43 @@ Module { Property { name: "flow"; type: "Flow" } Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } Property { name: "effectiveLayoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true } + Property { name: "horizontalItemAlignment"; revision: 1; type: "HAlignment" } + Property { + name: "effectiveHorizontalItemAlignment" + revision: 1 + type: "HAlignment" + isReadonly: true + } + Property { name: "verticalItemAlignment"; revision: 1; type: "VAlignment" } + Signal { + name: "horizontalAlignmentChanged" + revision: 1 + Parameter { name: "alignment"; type: "HAlignment" } + } + Signal { + name: "effectiveHorizontalAlignmentChanged" + revision: 1 + Parameter { name: "alignment"; type: "HAlignment" } + } + Signal { + name: "verticalAlignmentChanged" + revision: 1 + Parameter { name: "alignment"; type: "VAlignment" } + } } Component { name: "QQuickGridMesh" prototype: "QQuickShaderEffectMesh" exports: ["QtQuick/GridMesh 2.0"] + exportMetaObjectRevisions: [0] Property { name: "resolution"; type: "QSize" } } Component { name: "QQuickGridView" defaultProperty: "data" prototype: "QQuickItemView" - exports: ["QtQuick/GridView 2.0"] + exports: ["QtQuick/GridView 2.0", "QtQuick/GridView 2.1"] + exportMetaObjectRevisions: [0, 1] attachedType: "QQuickGridViewAttached" Enum { name: "Flow" @@ -1223,6 +1531,7 @@ Module { defaultProperty: "data" prototype: "QQuickImageBase" exports: ["QtQuick/Image 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "HAlignment" values: { @@ -1305,11 +1614,14 @@ Module { prototype: "QQuickItem" Property { name: "implicitWidth"; type: "double"; isReadonly: true } Property { name: "implicitHeight"; type: "double"; isReadonly: true } + Signal { name: "implicitWidthChanged2"; revision: 1 } + Signal { name: "implicitHeightChanged2"; revision: 1 } } Component { name: "QQuickIntValidator" prototype: "QIntValidator" exports: ["QtQuick/IntValidator 2.0"] + exportMetaObjectRevisions: [0] Property { name: "locale"; type: "string" } Signal { name: "localeNameChanged" } } @@ -1317,7 +1629,8 @@ Module { name: "QQuickItem" defaultProperty: "data" prototype: "QObject" - exports: ["QtQuick/Item 2.0"] + exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1"] + exportMetaObjectRevisions: [0, 1] Enum { name: "TransformOrigin" values: { @@ -1361,6 +1674,7 @@ Module { Property { name: "clip"; type: "bool" } Property { name: "focus"; type: "bool" } Property { name: "activeFocus"; type: "bool"; isReadonly: true } + Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } Property { name: "rotation"; type: "double" } Property { name: "scale"; type: "double" } Property { name: "transformOrigin"; type: "TransformOrigin" } @@ -1392,6 +1706,11 @@ Module { Parameter { type: "bool" } } Signal { + name: "activeFocusOnTabChanged" + revision: 1 + Parameter { type: "bool" } + } + Signal { name: "parentChanged" Parameter { type: "QQuickItem"; isPointer: true } } @@ -1411,6 +1730,11 @@ Module { name: "clipChanged" Parameter { type: "bool" } } + Signal { + name: "windowChanged" + revision: 1 + Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } + } Method { name: "update" } Method { name: "contains" @@ -1427,6 +1751,16 @@ Module { } Method { name: "forceActiveFocus" } Method { + name: "forceActiveFocus" + Parameter { name: "reason"; type: "Qt::FocusReason" } + } + Method { + name: "nextItemInFocusChain" + type: "QQuickItem*" + Parameter { name: "forward"; type: "bool" } + } + Method { name: "nextItemInFocusChain"; type: "QQuickItem*" } + Method { name: "childAt" type: "QQuickItem*" Parameter { name: "x"; type: "double" } @@ -1486,6 +1820,8 @@ Module { name: "QQuickItemView" defaultProperty: "flickableData" prototype: "QQuickFlickable" + exports: ["QtQuick/ItemView 2.1"] + exportMetaObjectRevisions: [1] Enum { name: "LayoutDirection" values: { @@ -1577,6 +1913,7 @@ Module { } Method { name: "positionViewAtBeginning" } Method { name: "positionViewAtEnd" } + Method { name: "forceLayout"; revision: 1 } } Component { name: "QQuickItemViewAttached" @@ -1595,6 +1932,7 @@ Module { name: "QQuickKeyNavigationAttached" prototype: "QObject" exports: ["QtQuick/KeyNavigation 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Priority" values: { @@ -1614,6 +1952,7 @@ Module { name: "QQuickKeysAttached" prototype: "QObject" exports: ["QtQuick/Keys 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Priority" values: { @@ -1789,62 +2128,16 @@ Module { name: "QQuickLayoutMirroringAttached" prototype: "QObject" exports: ["QtQuick/LayoutMirroring 2.0"] + exportMetaObjectRevisions: [0] Property { name: "enabled"; type: "bool" } Property { name: "childrenInherit"; type: "bool" } } Component { - name: "QQuickListElement" - prototype: "QObject" - exports: ["QtQuick/ListElement 2.0"] - } - Component { - name: "QQuickListModel" - prototype: "QAbstractListModel" - exports: ["QtQuick/ListModel 2.0"] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "dynamicRoles"; type: "bool" } - Method { name: "clear" } - Method { - name: "remove" - Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "append" - Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "insert" - Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "get" - type: "QQmlV8Handle" - Parameter { name: "index"; type: "int" } - } - Method { - name: "set" - Parameter { name: "index"; type: "int" } - Parameter { type: "QQmlV8Handle" } - } - Method { - name: "setProperty" - Parameter { name: "index"; type: "int" } - Parameter { name: "property"; type: "string" } - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "move" - Parameter { name: "from"; type: "int" } - Parameter { name: "to"; type: "int" } - Parameter { name: "count"; type: "int" } - } - Method { name: "sync" } - } - Component { name: "QQuickListView" defaultProperty: "data" prototype: "QQuickItemView" - exports: ["QtQuick/ListView 2.0"] + exports: ["QtQuick/ListView 2.0", "QtQuick/ListView 2.1"] + exportMetaObjectRevisions: [0, 1] attachedType: "QQuickListViewAttached" Enum { name: "Orientation" @@ -1882,6 +2175,7 @@ Module { defaultProperty: "data" prototype: "QQuickImplicitSizeItem" exports: ["QtQuick/Loader 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Status" values: { @@ -1909,6 +2203,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/MouseArea 2.0"] + exportMetaObjectRevisions: [0] Property { name: "mouseX"; type: "double"; isReadonly: true } Property { name: "mouseY"; type: "double"; isReadonly: true } Property { name: "containsMouse"; type: "bool"; isReadonly: true } @@ -1979,6 +2274,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/MultiPointTouchArea 2.0"] + exportMetaObjectRevisions: [0] Property { name: "touchPoints"; type: "QQuickTouchPoint"; isList: true; isReadonly: true } Property { name: "minimumTouchPoints"; type: "int" } Property { name: "maximumTouchPoints"; type: "int" } @@ -2011,6 +2307,7 @@ Module { name: "QQuickNumberAnimation" prototype: "QQuickPropertyAnimation" exports: ["QtQuick/NumberAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "from"; type: "double" } Property { name: "to"; type: "double" } } @@ -2019,6 +2316,7 @@ Module { defaultProperty: "data" prototype: "QObject" exports: ["QtQuick/Package 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQuickPackageAttached" Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } } @@ -2032,6 +2330,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/PaintedItem 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "RenderTarget" values: { @@ -2050,12 +2349,14 @@ Module { defaultProperty: "animations" prototype: "QQuickAnimationGroup" exports: ["QtQuick/ParallelAnimation 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickParentAnimation" defaultProperty: "animations" prototype: "QQuickAnimationGroup" exports: ["QtQuick/ParentAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "target"; type: "QQuickItem"; isPointer: true } Property { name: "newParent"; type: "QQuickItem"; isPointer: true } Property { name: "via"; type: "QQuickItem"; isPointer: true } @@ -2064,6 +2365,7 @@ Module { name: "QQuickParentChange" prototype: "QQuickStateOperation" exports: ["QtQuick/ParentChange 2.0"] + exportMetaObjectRevisions: [0] Property { name: "target"; type: "QQuickItem"; isPointer: true } Property { name: "parent"; type: "QQuickItem"; isPointer: true } Property { name: "x"; type: "QQmlScriptString" } @@ -2078,6 +2380,7 @@ Module { defaultProperty: "pathElements" prototype: "QObject" exports: ["QtQuick/Path 2.0"] + exportMetaObjectRevisions: [0] Property { name: "pathElements"; type: "QQuickPathElement"; isList: true; isReadonly: true } Property { name: "startX"; type: "double" } Property { name: "startY"; type: "double" } @@ -2088,6 +2391,7 @@ Module { name: "QQuickPathAnimation" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/PathAnimation 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Orientation" values: { @@ -2140,6 +2444,7 @@ Module { name: "QQuickPathArc" prototype: "QQuickCurve" exports: ["QtQuick/PathArc 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "ArcDirection" values: { @@ -2156,6 +2461,7 @@ Module { name: "QQuickPathAttribute" prototype: "QQuickPathElement" exports: ["QtQuick/PathAttribute 2.0"] + exportMetaObjectRevisions: [0] Property { name: "name"; type: "string" } Property { name: "value"; type: "double" } } @@ -2163,11 +2469,13 @@ Module { name: "QQuickPathCatmullRomCurve" prototype: "QQuickCurve" exports: ["QtQuick/PathCurve 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickPathCubic" prototype: "QQuickCurve" exports: ["QtQuick/PathCubic 2.0"] + exportMetaObjectRevisions: [0] Property { name: "control1X"; type: "double" } Property { name: "control1Y"; type: "double" } Property { name: "control2X"; type: "double" } @@ -2186,6 +2494,7 @@ Module { name: "QQuickPathInterpolator" prototype: "QObject" exports: ["QtQuick/PathInterpolator 2.0"] + exportMetaObjectRevisions: [0] Property { name: "path"; type: "QQuickPath"; isPointer: true } Property { name: "progress"; type: "double" } Property { name: "x"; type: "double"; isReadonly: true } @@ -2196,17 +2505,20 @@ Module { name: "QQuickPathLine" prototype: "QQuickCurve" exports: ["QtQuick/PathLine 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickPathPercent" prototype: "QQuickPathElement" exports: ["QtQuick/PathPercent 2.0"] + exportMetaObjectRevisions: [0] Property { name: "value"; type: "double" } } Component { name: "QQuickPathQuad" prototype: "QQuickCurve" exports: ["QtQuick/PathQuad 2.0"] + exportMetaObjectRevisions: [0] Property { name: "controlX"; type: "double" } Property { name: "controlY"; type: "double" } Property { name: "relativeControlX"; type: "double" } @@ -2216,6 +2528,7 @@ Module { name: "QQuickPathSvg" prototype: "QQuickCurve" exports: ["QtQuick/PathSvg 2.0"] + exportMetaObjectRevisions: [0] Property { name: "path"; type: "string" } } Component { @@ -2223,6 +2536,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/PathView 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQuickPathViewAttached" Enum { name: "HighlightRangeMode" @@ -2313,6 +2627,7 @@ Module { name: "QQuickPauseAnimation" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/PauseAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "duration"; type: "int" } Signal { name: "durationChanged" @@ -2331,13 +2646,15 @@ Module { name: "QQuickPinch" prototype: "QObject" exports: ["QtQuick/Pinch 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "Axis" values: { "NoDrag": 0, "XAxis": 1, "YAxis": 2, - "XAndYAxis": 3 + "XAndYAxis": 3, + "XandYAxis": 3 } } Property { name: "target"; type: "QQuickItem"; isPointer: true } @@ -2357,6 +2674,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/PinchArea 2.0"] + exportMetaObjectRevisions: [0] Property { name: "enabled"; type: "bool" } Property { name: "pinch"; type: "QQuickPinch"; isReadonly: true; isPointer: true } Signal { @@ -2383,6 +2701,7 @@ Module { name: "QQuickPropertyAction" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/PropertyAction 2.0"] + exportMetaObjectRevisions: [0] Property { name: "target"; type: "QObject"; isPointer: true } Property { name: "property"; type: "string" } Property { name: "properties"; type: "string" } @@ -2402,6 +2721,7 @@ Module { name: "QQuickPropertyAnimation" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/PropertyAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "duration"; type: "int" } Property { name: "from"; type: "QVariant" } Property { name: "to"; type: "QVariant" } @@ -2436,6 +2756,7 @@ Module { name: "QQuickPropertyChanges" prototype: "QQuickStateOperation" exports: ["QtQuick/PropertyChanges 2.0"] + exportMetaObjectRevisions: [0] Property { name: "target"; type: "QObject"; isPointer: true } Property { name: "restoreEntryValues"; type: "bool" } Property { name: "explicit"; type: "bool" } @@ -2445,6 +2766,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/Rectangle 2.0"] + exportMetaObjectRevisions: [0] Property { name: "color"; type: "QColor" } Property { name: "gradient"; type: "QQuickGradient"; isPointer: true } Property { name: "border"; type: "QQuickPen"; isReadonly: true; isPointer: true } @@ -2455,6 +2777,7 @@ Module { defaultProperty: "delegate" prototype: "QQuickItem" exports: ["QtQuick/Repeater 2.0"] + exportMetaObjectRevisions: [0] Property { name: "model"; type: "QVariant" } Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } Property { name: "count"; type: "int"; isReadonly: true } @@ -2478,6 +2801,7 @@ Module { name: "QQuickRotation" prototype: "QQuickTransform" exports: ["QtQuick/Rotation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "origin"; type: "QVector3D" } Property { name: "angle"; type: "double" } Property { name: "axis"; type: "QVector3D" } @@ -2486,6 +2810,7 @@ Module { name: "QQuickRotationAnimation" prototype: "QQuickPropertyAnimation" exports: ["QtQuick/RotationAnimation 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "RotationDirection" values: { @@ -2504,6 +2829,7 @@ Module { defaultProperty: "data" prototype: "QQuickBasePositioner" exports: ["QtQuick/Row 2.0"] + exportMetaObjectRevisions: [0] Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } Property { name: "effectiveLayoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true } } @@ -2511,6 +2837,7 @@ Module { name: "QQuickScale" prototype: "QQuickTransform" exports: ["QtQuick/Scale 2.0"] + exportMetaObjectRevisions: [0] Property { name: "origin"; type: "QVector3D" } Property { name: "xScale"; type: "double" } Property { name: "yScale"; type: "double" } @@ -2530,6 +2857,7 @@ Module { name: "QQuickScriptAction" prototype: "QQuickAbstractAnimation" exports: ["QtQuick/ScriptAction 2.0"] + exportMetaObjectRevisions: [0] Property { name: "script"; type: "QQmlScriptString" } Property { name: "scriptName"; type: "string" } } @@ -2538,12 +2866,14 @@ Module { defaultProperty: "animations" prototype: "QQuickAnimationGroup" exports: ["QtQuick/SequentialAnimation 2.0"] + exportMetaObjectRevisions: [0] } Component { name: "QQuickShaderEffect" defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/ShaderEffect 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "CullMode" values: { @@ -2572,6 +2902,7 @@ Module { name: "QQuickShaderEffectMesh" prototype: "QObject" exports: ["QtQuick/ShaderEffectMesh 2.0"] + exportMetaObjectRevisions: [0] Signal { name: "geometryChanged" } } Component { @@ -2579,6 +2910,7 @@ Module { defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick/ShaderEffectSource 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "WrapMode" values: { @@ -2612,6 +2944,7 @@ Module { name: "QQuickSmoothedAnimation" prototype: "QQuickNumberAnimation" exports: ["QtQuick/SmoothedAnimation 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "ReversingMode" values: { @@ -2628,6 +2961,7 @@ Module { name: "QQuickSpringAnimation" prototype: "QQuickNumberAnimation" exports: ["QtQuick/SpringAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "velocity"; type: "double" } Property { name: "spring"; type: "double" } Property { name: "damping"; type: "double" } @@ -2640,6 +2974,7 @@ Module { name: "QQuickSprite" prototype: "QQuickStochasticState" exports: ["QtQuick/Sprite 2.0"] + exportMetaObjectRevisions: [0] Property { name: "source"; type: "QUrl" } Property { name: "reverse"; type: "bool" } Property { name: "frameSync"; type: "bool" } @@ -2759,6 +3094,7 @@ Module { defaultProperty: "sprites" prototype: "QQuickItem" exports: ["QtQuick/SpriteSequence 2.0"] + exportMetaObjectRevisions: [0] Property { name: "running"; type: "bool" } Property { name: "interpolate"; type: "bool" } Property { name: "goalSprite"; type: "string" } @@ -2802,6 +3138,7 @@ Module { defaultProperty: "changes" prototype: "QObject" exports: ["QtQuick/State 2.0"] + exportMetaObjectRevisions: [0] Property { name: "name"; type: "string" } Property { name: "when"; type: "QQmlBinding"; isPointer: true } Property { name: "extend"; type: "string" } @@ -2812,6 +3149,7 @@ Module { name: "QQuickStateChangeScript" prototype: "QQuickStateOperation" exports: ["QtQuick/StateChangeScript 2.0"] + exportMetaObjectRevisions: [0] Property { name: "script"; type: "QQmlScriptString" } Property { name: "name"; type: "string" } } @@ -2819,6 +3157,7 @@ Module { name: "QQuickStateGroup" prototype: "QObject" exports: ["QtQuick/StateGroup 2.0"] + exportMetaObjectRevisions: [0] Property { name: "state"; type: "string" } Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } @@ -2882,6 +3221,7 @@ Module { name: "QQuickSystemPalette" prototype: "QObject" exports: ["QtQuick/SystemPalette 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "ColorGroup" values: { @@ -2912,6 +3252,7 @@ Module { defaultProperty: "data" prototype: "QQuickImplicitSizeItem" exports: ["QtQuick/Text 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "HAlignment" values: { @@ -3062,11 +3403,13 @@ Module { } Method { name: "doLayout" } } + Component { name: "QQuickTextDocument"; prototype: "QObject" } Component { name: "QQuickTextEdit" defaultProperty: "data" prototype: "QQuickImplicitSizeItem" - exports: ["QtQuick/TextEdit 2.0"] + exports: ["QtQuick/TextEdit 2.0", "QtQuick/TextEdit 2.1"] + exportMetaObjectRevisions: [0, 1] Enum { name: "HAlignment" values: { @@ -3144,6 +3487,7 @@ Module { Property { name: "persistentSelection"; type: "bool" } Property { name: "textMargin"; type: "double" } Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" } + Property { name: "selectByKeyboard"; revision: 1; type: "bool" } Property { name: "selectByMouse"; type: "bool" } Property { name: "mouseSelectionMode"; type: "SelectionMode" } Property { name: "canPaste"; type: "bool"; isReadonly: true } @@ -3152,6 +3496,13 @@ Module { Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true } Property { name: "baseUrl"; type: "QUrl" } Property { name: "renderType"; type: "RenderType" } + Property { + name: "textDocument" + revision: 1 + type: "QQuickTextDocument" + isReadonly: true + isPointer: true + } Signal { name: "contentSizeChanged" } Signal { name: "colorChanged" @@ -3202,6 +3553,11 @@ Module { Parameter { name: "textMargin"; type: "double" } } Signal { + name: "selectByKeyboardChanged" + revision: 1 + Parameter { name: "selectByKeyboard"; type: "bool" } + } + Signal { name: "selectByMouseChanged" Parameter { name: "selectByMouse"; type: "bool" } } @@ -3280,6 +3636,7 @@ Module { defaultProperty: "data" prototype: "QQuickImplicitSizeItem" exports: ["QtQuick/TextInput 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "EchoMode" values: { @@ -3482,6 +3839,7 @@ Module { name: "QQuickTouchPoint" prototype: "QObject" exports: ["QtQuick/TouchPoint 2.0"] + exportMetaObjectRevisions: [0] Property { name: "pointId"; type: "int"; isReadonly: true } Property { name: "pressed"; type: "bool"; isReadonly: true } Property { name: "x"; type: "double"; isReadonly: true } @@ -3502,6 +3860,7 @@ Module { defaultProperty: "animations" prototype: "QObject" exports: ["QtQuick/Transition 2.0"] + exportMetaObjectRevisions: [0] Property { name: "from"; type: "string" } Property { name: "to"; type: "string" } Property { name: "reversible"; type: "bool" } @@ -3513,6 +3872,7 @@ Module { name: "QQuickTranslate" prototype: "QQuickTransform" exports: ["QtQuick/Translate 2.0"] + exportMetaObjectRevisions: [0] Property { name: "x"; type: "double" } Property { name: "y"; type: "double" } } @@ -3520,6 +3880,7 @@ Module { name: "QQuickVector3dAnimation" prototype: "QQuickPropertyAnimation" exports: ["QtQuick/Vector3dAnimation 2.0"] + exportMetaObjectRevisions: [0] Property { name: "from"; type: "QVector3D" } Property { name: "to"; type: "QVector3D" } } @@ -3527,6 +3888,7 @@ Module { name: "QQuickViewSection" prototype: "QObject" exports: ["QtQuick/ViewSection 2.0"] + exportMetaObjectRevisions: [0] Enum { name: "SectionCriteria" values: { @@ -3552,6 +3914,7 @@ Module { name: "QQuickViewTransitionAttached" prototype: "QObject" exports: ["QtQuick/ViewTransition 2.0"] + exportMetaObjectRevisions: [0] Property { name: "index"; type: "int"; isReadonly: true } Property { name: "item"; type: "QQuickItem"; isReadonly: true; isPointer: true } Property { name: "destination"; type: "QPointF"; isReadonly: true } @@ -3559,134 +3922,10 @@ Module { Property { name: "targetItems"; type: "QObject"; isList: true; isReadonly: true } } Component { - name: "QQuickVisualDataGroup" - prototype: "QObject" - exports: ["QtQuick/VisualDataGroup 2.0"] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "name"; type: "string" } - Property { name: "includeByDefault"; type: "bool" } - Signal { name: "defaultIncludeChanged" } - Signal { - name: "changed" - Parameter { name: "removed"; type: "QQmlV8Handle" } - Parameter { name: "inserted"; type: "QQmlV8Handle" } - } - Method { - name: "insert" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "create" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "resolve" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "remove" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "addGroups" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "removeGroups" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "setGroups" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "move" - Parameter { type: "QQmlV8Function"; isPointer: true } - } - Method { - name: "get" - type: "QQmlV8Handle" - Parameter { name: "index"; type: "int" } - } - } - Component { - name: "QQuickVisualDataModel" - defaultProperty: "delegate" - prototype: "QQuickVisualModel" - exports: ["QtQuick/VisualDataModel 2.0"] - attachedType: "QQuickVisualDataModelAttached" - Property { name: "model"; type: "QVariant" } - Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } - Property { name: "filterOnGroup"; type: "string" } - Property { name: "items"; type: "QQuickVisualDataGroup"; isReadonly: true; isPointer: true } - Property { - name: "persistedItems" - type: "QQuickVisualDataGroup" - isReadonly: true - isPointer: true - } - Property { name: "groups"; type: "QQuickVisualDataGroup"; isList: true; isReadonly: true } - Property { name: "parts"; type: "QObject"; isReadonly: true; isPointer: true } - Property { name: "rootIndex"; type: "QVariant" } - Signal { name: "filterGroupChanged" } - Signal { name: "defaultGroupsChanged" } - Method { - name: "modelIndex" - type: "QVariant" - Parameter { name: "idx"; type: "int" } - } - Method { name: "parentModelIndex"; type: "QVariant" } - } - Component { - name: "QQuickVisualDataModelAttached" - prototype: "QObject" - Property { name: "model"; type: "QQuickVisualDataModel"; isReadonly: true; isPointer: true } - Property { name: "groups"; type: "QStringList" } - Property { name: "isUnresolved"; type: "bool"; isReadonly: true } - Signal { name: "unresolvedChanged" } - } - Component { name: "QQuickVisualDataModelParts"; prototype: "QObject" } - Component { - name: "QQuickVisualItemModel" - defaultProperty: "children" - prototype: "QQuickVisualModel" - exports: ["QtQuick/VisualItemModel 2.0"] - attachedType: "QQuickVisualItemModelAttached" - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - } - Component { - name: "QQuickVisualItemModelAttached" - prototype: "QObject" - Property { name: "index"; type: "int"; isReadonly: true } - } - Component { - name: "QQuickVisualModel" - prototype: "QObject" - Property { name: "count"; type: "int"; isReadonly: true } - Signal { - name: "modelUpdated" - Parameter { name: "changeSet"; type: "QQuickChangeSet" } - Parameter { name: "reset"; type: "bool" } - } - Signal { - name: "createdItem" - Parameter { name: "index"; type: "int" } - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Signal { - name: "initItem" - Parameter { name: "index"; type: "int" } - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - Signal { - name: "destroyingItem" - Parameter { name: "item"; type: "QQuickItem"; isPointer: true } - } - } - Component { name: "QQuickWorkerScript" prototype: "QObject" exports: ["QtQuick/WorkerScript 2.0"] + exportMetaObjectRevisions: [0] Property { name: "source"; type: "QUrl" } Signal { name: "message" @@ -3701,6 +3940,7 @@ Module { name: "QRegExpValidator" prototype: "QValidator" exports: ["QtQuick/RegExpValidator 2.0"] + exportMetaObjectRevisions: [0] Property { name: "regExp"; type: "QRegExp" } Signal { name: "regExpChanged" @@ -3866,9 +4106,11 @@ Module { "SplashScreen": 15, "Desktop": 17, "SubWindow": 18, + "ForeignWindow": 33, "WindowType_Mask": 255, "MSWindowsFixedSizeDialogHint": 256, "MSWindowsOwnDC": 512, + "BypassWindowManagerHint": 1024, "X11BypassWindowManagerHint": 1024, "FramelessWindowHint": 2048, "WindowTitleHint": 4096, @@ -3907,9 +4149,11 @@ Module { "SplashScreen": 15, "Desktop": 17, "SubWindow": 18, + "ForeignWindow": 33, "WindowType_Mask": 255, "MSWindowsFixedSizeDialogHint": 256, "MSWindowsOwnDC": 512, + "BypassWindowManagerHint": 1024, "X11BypassWindowManagerHint": 1024, "FramelessWindowHint": 2048, "WindowTitleHint": 4096, @@ -4105,7 +4349,8 @@ Module { "AA_X11InitThreads": 10, "AA_SynthesizeTouchForUnhandledMouseEvents": 11, "AA_SynthesizeMouseForUnhandledTouchEvents": 12, - "AA_AttributeCount": 13 + "AA_UseHighDpiPixmaps": 13, + "AA_AttributeCount": 14 } } Enum { @@ -4790,6 +5035,15 @@ Module { } } Enum { + name: "Edge" + values: { + "TopEdge": 1, + "LeftEdge": 2, + "RightEdge": 4, + "BottomEdge": 8 + } + } + Enum { name: "ConnectionType" values: { "AutoConnection": 0, @@ -4916,6 +5170,7 @@ Module { "ImhDate": 128, "ImhTime": 256, "ImhPreferLatin": 512, + "ImhMultiLine": 1024, "ImhDigitsOnly": 65536, "ImhFormattedNumbersOnly": 131072, "ImhUppercaseOnly": 262144, @@ -4941,6 +5196,7 @@ Module { "ImhDate": 128, "ImhTime": 256, "ImhPreferLatin": 512, + "ImhMultiLine": 1024, "ImhDigitsOnly": 65536, "ImhFormattedNumbersOnly": 131072, "ImhUppercaseOnly": 262144, @@ -5010,7 +5266,8 @@ Module { "ItemIsDropEnabled": 8, "ItemIsUserCheckable": 16, "ItemIsEnabled": 32, - "ItemIsTristate": 64 + "ItemIsTristate": 64, + "ItemNeverHasChildren": 128 } } Enum { diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 7584241ca6..0bec4cddf2 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -291,6 +291,11 @@ Item { } function tryCompare(obj, prop, value, timeout) { + if (arguments.length == 2) { + qtest_results.fail("A value is required for tryCompare", + util.callerFile(), util.callerLine()) + throw new Error("QtQuickTest::fail") + } if (!timeout) timeout = 5000 if (!qtest_compareInternal(obj[prop], value)) diff --git a/src/imports/widgets/plugins.qmltypes b/src/imports/widgets/plugins.qmltypes index 583a36a357..9e73330c12 100644 --- a/src/imports/widgets/plugins.qmltypes +++ b/src/imports/widgets/plugins.qmltypes @@ -39,6 +39,7 @@ Module { Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } + Property { name: "isWindow"; type: "bool"; isReadonly: true } Property { name: "x"; type: "int" } Property { name: "y"; type: "int" } Property { name: "width"; type: "int" } @@ -56,7 +57,7 @@ Module { Property { name: "selectExisting"; type: "bool" } Property { name: "selectMultiple"; type: "bool" } Property { name: "selectFolder"; type: "bool" } - Property { name: "folder"; type: "string" } + Property { name: "folder"; type: "QUrl" } Property { name: "nameFilters"; type: "QStringList" } Property { name: "selectedNameFilter"; type: "string" } Property { name: "fileUrl"; type: "QUrl"; isReadonly: true } @@ -86,7 +87,7 @@ Module { } Method { name: "setFolder" - Parameter { name: "f"; type: "string" } + Parameter { name: "f"; type: "QUrl" } } Method { name: "setNameFilters" diff --git a/src/imports/widgets/qquickqcolordialog.cpp b/src/imports/widgets/qquickqcolordialog.cpp index abe6ffd004..d10eacee60 100644 --- a/src/imports/widgets/qquickqcolordialog.cpp +++ b/src/imports/widgets/qquickqcolordialog.cpp @@ -68,8 +68,11 @@ public: virtual void exec() { m_dialog.exec(); } virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) { - m_dialog.windowHandle()->setTransientParent(parent); - m_dialog.windowHandle()->setFlags(f); + m_dialog.winId(); + QWindow *window = m_dialog.windowHandle(); + Q_ASSERT(window); + window->setTransientParent(parent); + window->setFlags(f); m_dialog.setWindowModality(m); m_dialog.setWindowTitle(QPlatformColorDialogHelper::options()->windowTitle()); m_dialog.setOptions((QColorDialog::ColorDialogOptions)((int)(QPlatformColorDialogHelper::options()->options()))); diff --git a/src/imports/widgets/qquickqfiledialog.cpp b/src/imports/widgets/qquickqfiledialog.cpp index 672c6d1bf4..498e34a24c 100644 --- a/src/imports/widgets/qquickqfiledialog.cpp +++ b/src/imports/widgets/qquickqfiledialog.cpp @@ -96,8 +96,11 @@ public: virtual void exec() { m_dialog.exec(); } virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) { - m_dialog.windowHandle()->setTransientParent(parent); - m_dialog.windowHandle()->setFlags(f); + m_dialog.winId(); + QWindow *window = m_dialog.windowHandle(); + Q_ASSERT(window); + window->setTransientParent(parent); + window->setFlags(f); m_dialog.setWindowModality(m); m_dialog.show(); return m_dialog.isVisible(); @@ -132,14 +135,14 @@ private: \qmlsignal QtQuick::Dialogs::FileDialog::accepted The \a accepted signal is emitted when the user has finished using the - dialog. You can then inspect the \a filePath or \a filePaths properties to + dialog. You can then inspect the \a fileUrl or \a fileUrls properties to get the selection. Example: \qml FileDialog { - onAccepted: { console.log("Selected file: " + filePath) } + onAccepted: { console.log("Selected file: " + fileUrl) } } \endqml */ diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes index b79702edb6..59e69114e1 100644 --- a/src/imports/window/plugins.qmltypes +++ b/src/imports/window/plugins.qmltypes @@ -3,7 +3,7 @@ import QtQuick.tooling 1.1 // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // -// This file was auto-generated with the command '../../../bin/qmlplugindump.app/Contents/MacOS/qmlplugindump QtQuick.Window 2.1 -notrelocatable'. +// This file was auto-generated with the command 'qmlplugindump QtQuick.Window 2.1 -notrelocatable'. Module { Component { @@ -23,15 +23,23 @@ Module { name: "QQuickScreen" prototype: "QObject" exports: ["QtQuick.Window/Screen 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQuickScreenAttached" } Component { name: "QQuickScreenAttached" prototype: "QObject" + Property { name: "name"; revision: 1; type: "string"; isReadonly: true } Property { name: "width"; type: "int"; isReadonly: true } Property { name: "height"; type: "int"; isReadonly: true } + Property { name: "desktopAvailableWidth"; revision: 1; type: "int"; isReadonly: true } + Property { name: "desktopAvailableHeight"; revision: 1; type: "int"; isReadonly: true } + Property { name: "logicalPixelDensity"; revision: 1; type: "double"; isReadonly: true } Property { name: "primaryOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true } Property { name: "orientation"; type: "Qt::ScreenOrientation"; isReadonly: true } + Signal { name: "nameChanged"; revision: 1 } + Signal { name: "desktopGeometryChanged"; revision: 1 } + Signal { name: "logicalPixelDensityChanged"; revision: 1 } Method { name: "angleBetween" type: "int" @@ -62,6 +70,11 @@ Module { Signal { name: "beforeRendering" } Signal { name: "afterRendering" } Signal { + name: "closing" + revision: 1 + Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true } + } + Signal { name: "colorChanged" Parameter { type: "QColor" } } @@ -95,6 +108,7 @@ Module { Property { name: "maximumWidth"; revision: 1; type: "int" } Property { name: "maximumHeight"; revision: 1; type: "int" } Property { name: "visible"; type: "bool" } + Property { name: "active"; revision: 1; type: "bool"; isReadonly: true } Property { name: "visibility"; revision: 1; type: "Visibility" } Property { name: "contentOrientation"; revision: 1; type: "Qt::ScreenOrientation" } Property { name: "opacity"; revision: 1; type: "double" } @@ -155,6 +169,7 @@ Module { revision: 1 Parameter { name: "visibility"; type: "QWindow::Visibility" } } + Signal { name: "activeChanged"; revision: 1 } Signal { name: "contentOrientationChanged" revision: 1 @@ -169,6 +184,7 @@ Module { revision: 1 Parameter { name: "opacity"; type: "double" } } + Method { name: "requestActivate"; revision: 1 } Method { name: "setVisible" Parameter { name: "visible"; type: "bool" } @@ -222,5 +238,9 @@ Module { revision: 1 Parameter { name: "h"; type: "int" } } + Method { + name: "alert" + Parameter { name: "msec"; type: "int" } + } } } diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp index b85f23c48b..1240b2ef4c 100644 --- a/src/plugins/accessible/quick/qaccessiblequickview.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp @@ -81,10 +81,8 @@ QAccessibleInterface *QAccessibleQuickWindow::parent() const QAccessibleInterface *QAccessibleQuickWindow::child(int index) const { - if (index == 0) { - if (QQuickItem *declarativeRoot = rootItem()) - return new QAccessibleQuickItem(declarativeRoot); - } + if (index == 0) + return QAccessible::queryAccessibleInterface(rootItem()); return 0; } diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp index c649370680..b82e1850f7 100644 --- a/src/qml/animations/qsequentialanimationgroupjob.cpp +++ b/src/qml/animations/qsequentialanimationgroupjob.cpp @@ -226,14 +226,14 @@ void QSequentialAnimationGroupJob::updateCurrentTime(int currentTime) if (atEnd()) { //we make sure that we don't exceed the duration here m_currentTime += m_currentAnimation->currentTime() - newCurrentTime; - stop(); + RETURN_IF_DELETED(stop()); } } else { //the only case where currentAnimation could be null //is when all animations have been removed Q_ASSERT(!firstChild()); m_currentTime = 0; - stop(); + RETURN_IF_DELETED(stop()); } m_previousLoop = m_currentLoop; diff --git a/src/qml/debugger/qqmlprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp index 963a861821..0ba939cdca 100644 --- a/src/qml/debugger/qqmlprofilerservice.cpp +++ b/src/qml/debugger/qqmlprofilerservice.cpp @@ -105,7 +105,7 @@ QByteArray QQmlProfilerData::toByteArray() const case QQmlProfilerService::SceneGraphWindowsRenderShow: ds << subtime_1 << subtime_2 << subtime_3; break; // WindowsAnimations: update time case QQmlProfilerService::SceneGraphWindowsAnimations: ds << subtime_1; break; - // WindowsRenderWindow: polish time, sync time, render time, swap time + // WindowsRenderWindow: polish time case QQmlProfilerService::SceneGraphWindowsPolishFrame: ds << subtime_1; break; default:break; } diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 84cf64eddd..2198428a38 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -18,7 +18,7 @@ qhp.QtQml.indexRoot = qhp.QtQml.filterAttributes = qtqml $QT_VERSION qtrefdoc qhp.QtQml.customFilters.Qt.name = QtQml $QT_VERSION qhp.QtQml.customFilters.Qt.filterAttributes = qtqml $QT_VERSION -qhp.QtQml.subprojects = classes examples +qhp.QtQml.subprojects = qmltypes classes examples qhp.QtQml.subprojects.classes.title = C++ Classes qhp.QtQml.subprojects.classes.indexTitle = Qt QML C++ Classes qhp.QtQml.subprojects.classes.selectors = class fake:headerfile @@ -26,15 +26,21 @@ qhp.QtQml.subprojects.classes.sortPages = true qhp.QtQml.subprojects.examples.title = Examples qhp.QtQml.subprojects.examples.indexTitle = Qt Quick Code Samples qhp.QtQml.subprojects.examples.selectors = fake:example +qhp.QtQml.subprojects.qmltypes.title = QML Types +qhp.QtQml.subprojects.qmltypes.indexTitle = Qt QML QML Types +qhp.QtQml.subprojects.qmltypes.selectors = fake:qmlclass +qhp.QtQml.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qtqml/qtqml.tags depends += qtcore qtxmlpatterns qtgui qtquick qtdoc -headerdirs += .. +headerdirs += .. \ + ../../imports/models -sourcedirs += .. +sourcedirs += .. \ + ../../imports/models exampledirs += ../../../examples/qml \ ../ \ diff --git a/src/qml/doc/src/javascript/hostenvironment.qdoc b/src/qml/doc/src/javascript/hostenvironment.qdoc index a63ef617c0..3bd64ac115 100644 --- a/src/qml/doc/src/javascript/hostenvironment.qdoc +++ b/src/qml/doc/src/javascript/hostenvironment.qdoc @@ -166,6 +166,15 @@ Item { } \endqml +\li The \c with statement is deprecated. Using the \c with statement will issue a warning +at loading time and we plan on removing support for it in Qt 5.2. It is generally considered +a language feature that is not recommended for use due reducing the readability of code and disabling +many optimizations in the engine. It is also forbidden in ECMAScript 5 strict mode. + +\li JavaScript binding expressions are executed in non-strict mode. However we +plan on changing the default for bindings in Qt 5.2 to execute always in +ECMAScript 5 strict mode. + \endlist diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc index f0aadbaf32..3def3209cc 100644 --- a/src/qml/doc/src/qmltypereference.qdoc +++ b/src/qml/doc/src/qmltypereference.qdoc @@ -58,8 +58,13 @@ follows: import QtQuick 2.0 \endqml -See the \l{Qt Quick} module documentation for more information about the -\c QtQuick namespace and what it provides to QML application developers. +See the \l{Qt Quick} module documentation for more information about the \c +QtQuick namespace and what it provides to QML application developers. + +The QML types for creating lists and models, such as \l ListModel and \l +ListElement, are moved to a submodule, \c QtQml.Models. The \l{Qt QML Models QML +Types}{Qt QML Models} page has more information. + The documentation for the types below applies equally to the types of the same name provided by the \l{Qt Quick} module, as they are in fact identical. diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc index 2c6bc640ff..26e4867bbc 100644 --- a/src/qml/doc/src/qtqml.qdoc +++ b/src/qml/doc/src/qtqml.qdoc @@ -84,6 +84,19 @@ various QML object types: \li \l Timer \endlist +\section2 Lists and Models + +New in Qt 5.1, the model types are moved to a submodule, \c QtQml.Models. The +\l{Qt QML Models QML Types}{Qt QML Models} page has more information. + +\list +\li \l DelegateModel +\li \l DelegateModelGroup +\li \l ListElement +\li \l ListModel +\li \l ObjectModel +\endlist + \section1 JavaScript Environment for QML Applications JavaScript expressions allow QML code to contain application logic. Qt QML diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc index 6ca979db37..9ad8c23a42 100644 --- a/src/qml/doc/src/whatsnew.qdoc +++ b/src/qml/doc/src/whatsnew.qdoc @@ -29,7 +29,34 @@ \title Qt QML Release Notes \page qtqml-releasenotes.html -\section1 Qt QML in Qt 5 +\section1 Qt QML in Qt 5.1 + +Qt 5.1 introduces several bug fixes and new functionalities to Qt QML. This is +a summary of the new changes: +\list +\li New QQmlApplicationEngine convenience class for QML applications. +\li New Instantiatior type for generic, dynamic object creation. +\li New properties for \l Qt.application: arguments, name, and version. +\li The 'with' statement has been deprecated and is slated for removal in a + future version of the language. +\li New \l Qt.platform object with an os property +\li New \l qmlClearTypeRegistations() function drops all data from qmlRegisterType calls +\li New \l qmlRegisterType function for registering composite types. +\endlist + +\section2 New Submodule + +The \l{Qt QML Models QML Types}{Qt QML Models} is a new submodule in Qt 5.1 and +provides several QML types for handling data with models and lists. These types +replace types such as \l VisualItem, \l VisualDataModel, and \l VisualDataGroup. + +\list +\li \l{Qt QML Models QML Types}{Models} +\endlist + +The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release. + +\section1 Qt QML in Qt 5.0 The \l{Qt QML} module is new in Qt 5.0. It provides the QML engine and implements the QML language supporting infrastructure. @@ -88,6 +115,8 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the \list \li Arbitrary functionality may be provided in a namespace through a singleton type. See qmlRegisterSingletonType() for more information. \li JavaScript (.js) files may now import QML modules and other JavaScript files using the ".import" syntax. +\li Plugins may now use QQmlExtensionPlugin::baseUrl to get the directory from which the plugin is loaded. + This will be useful if the plugin needs to load QML or other assets from the same directory. \endlist \section2 Other diff --git a/src/qml/qml/parser/qqmljs.g b/src/qml/qml/parser/qqmljs.g index ff4f54374b..5d279ef1a2 100644 --- a/src/qml/qml/parser/qqmljs.g +++ b/src/qml/qml/parser/qqmljs.g @@ -2615,6 +2615,10 @@ case $rule_number: { node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; + if (lexer->qmlMode()) { + const QString msg = qApp->translate("QQmlParser", "Deprecated JavaScript `with' statement detected in QML expression. Support for this will be removed in Qt 5.2!"); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, node->withToken, msg)); + } } break; ./ diff --git a/src/qml/qml/parser/qqmljsparser.cpp b/src/qml/qml/parser/qqmljsparser.cpp index a0fa7a4711..46b5c041d4 100644 --- a/src/qml/qml/parser/qqmljsparser.cpp +++ b/src/qml/qml/parser/qqmljsparser.cpp @@ -1515,6 +1515,10 @@ case 311: { node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; + if (lexer->qmlMode()) { + const QString msg = qApp->translate("QQmlParser", "Deprecated JavaScript `with' statement detected in QML expression. Support for this will be removed in Qt 5.2!"); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, node->withToken, msg)); + } } break; case 312: { diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index fb0133f305..b48a776b4f 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -49,7 +49,6 @@ #include <QtCore/qbytearray.h> #include <QtCore/qmetaobject.h> -#include <QtCore/qdebug.h> #define QML_VERSION 0x020000 #define QML_VERSION_STR "2.0" @@ -477,7 +476,7 @@ inline int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, i { if (url.isRelative()) { // User input check must go here, because QQmlPrivate::qmlregister is also used internally for composite types - qWarning() << "qmlRegisterType requires absolute URLs."; + qWarning("qmlRegisterType requires absolute URLs."); return 0; } diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index 25095a465e..9181dad519 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -72,6 +72,7 @@ void QQmlApplicationEnginePrivate::init() QCoreApplication::installTranslator(qtTranslator); translators << qtTranslator; #endif + QCoreApplication::instance()->setProperty("__qml_using_qqmlapplicationengine", QVariant(true)); } void QQmlApplicationEnginePrivate::loadTranslations(const QUrl &rootFile) @@ -166,9 +167,14 @@ void QQmlApplicationEnginePrivate::_q_finishLoad(QObject *o) \list \li Connecting Qt.quit() to QCoreApplication::quit() \li Automatically loads translation files from an i18n directory adjacent to the main QML file. + \li Automatically sets an incubuation controller if the scene contains a QQuickWindow. \endlist The engine behavior can be further tweaked by using the inherited methods from QQmlEngine. + + \note In the future QQmlApplicationEngine may automatically apply file selectors. + To ensure forwards compatibility, do not use folder names containing a '+' character in your QML file + structure. */ /*! diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 64662138e1..9998af3890 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -391,9 +391,9 @@ The following functions are also on the Qt object. \list \li \c "android" - Android \li \c "blackberry" - BlackBerry OS - \li \c "ios" - Apple iOS + \li \c "ios" - iOS \li \c "linux" - Linux - \li \c "mac" - Mac OS X + \li \c "osx" - OS X \li \c "unix" - Other Unix-based OS \li \c "windows" - Windows \li \c "wince" - Windows CE diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index f77b176404..30eca7b112 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE /*! - \since 5.0 + \since Qt 5.0 \inmodule QtQml \class QQmlExtensionPlugin \brief The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins. @@ -156,6 +156,13 @@ QQmlExtensionPlugin::~QQmlExtensionPlugin() { } +/*! + \since Qt 5.1 + \brief Returns the URL of the directory from which the extension is loaded. + + This is useful when the plugin also needs to load QML files or other + assets from the same directory. +*/ QUrl QQmlExtensionPlugin::baseUrl() const { Q_D(const QQmlExtensionPlugin); diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h index 170c7915a5..245651979b 100644 --- a/src/qml/qml/qqmlextensionplugin.h +++ b/src/qml/qml/qqmlextensionplugin.h @@ -68,6 +68,7 @@ public: virtual void registerTypes(const char *uri) = 0; virtual void initializeEngine(QQmlEngine *engine, const char *uri); +private: Q_DISABLE_COPY(QQmlExtensionPlugin) }; diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp index de48f60f56..04862379be 100644 --- a/src/qml/qml/qqmlplatform.cpp +++ b/src/qml/qml/qqmlplatform.cpp @@ -66,7 +66,7 @@ QString QQmlPlatform::os() #elif defined(Q_OS_IOS) return QLatin1String("ios"); #elif defined(Q_OS_MAC) - return QLatin1String("mac"); + return QLatin1String("osx"); #elif defined(Q_OS_WINCE) return QLatin1String("wince"); #elif defined(Q_OS_WIN) diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index b1ffc9a2d5..4712fbd614 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -1317,25 +1317,10 @@ QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QS Q_ASSERT(metaObject); QQmlPropertyData rv; - { - const QMetaObject *cmo = metaObject; - const QByteArray propertyName = property.toUtf8(); - while (cmo) { - int idx = cmo->indexOfProperty(propertyName); - if (idx != -1) { - QMetaProperty p = cmo->property(idx); - if (p.isScriptable()) { - rv.load(p); - return rv; - } else { - while (cmo && cmo->propertyOffset() >= idx) - cmo = cmo->superClass(); - } - } else { - cmo = 0; - } - } - } + + /* It's important to check the method list before checking for properties; + * otherwise, if the meta object is dynamic, a property will be created even + * if not found and it might obscure a method having the same name. */ //Used to block access to QObject::destroyed() and QObject::deleteLater() from QML static const int destroyedIdx1 = QObject::staticMetaObject.indexOfSignal("destroyed(QObject*)"); @@ -1357,6 +1342,31 @@ QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QS } } + { + const QMetaObject *cmo = metaObject; + const QByteArray propertyName = property.toUtf8(); + while (cmo) { + int idx = cmo->indexOfProperty(propertyName); + if (idx != -1) { + QMetaProperty p = cmo->property(idx); + if (p.isScriptable()) { + rv.load(p); + return rv; + } else { + bool changed = false; + while (cmo && cmo->propertyOffset() >= idx) { + cmo = cmo->superClass(); + changed = true; + } + /* If the "cmo" variable didn't change, set it to 0 to + * avoid running into an infinite loop */ + if (!changed) cmo = 0; + } + } else { + cmo = 0; + } + } + } return rv; } @@ -1395,7 +1405,8 @@ qQmlPropertyCacheProperty(QQmlEngine *engine, QObject *obj, const T &name, if (cache) { rv = cache->property(name, obj, context); - } else { + } + if (!rv) { local = qQmlPropertyCacheCreate(obj->metaObject(), qQmlPropertyCacheToString(name)); if (local.isValid()) rv = &local; diff --git a/src/qml/qml/qqmlscript.cpp b/src/qml/qml/qqmlscript.cpp index 613ff24f20..ba2882f3e7 100644 --- a/src/qml/qml/qqmlscript.cpp +++ b/src/qml/qml/qqmlscript.cpp @@ -1318,13 +1318,15 @@ bool QQmlScript::Parser::parse(const QString &qmlcode, const QByteArray & /* pre QQmlJS::Parser parser(&data->engine); - if (! parser.parse() || !_errors.isEmpty()) { + if (! parser.parse() || !parser.diagnosticMessages().isEmpty()) { // Extract errors from the parser foreach (const DiagnosticMessage &m, parser.diagnosticMessages()) { - if (m.isWarning()) + if (m.isWarning()) { + qWarning("%s:%d : %s", qPrintable(_scriptFile), m.loc.startLine, qPrintable(m.message)); continue; + } QQmlError error; error.setUrl(url); diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index 0336457027..53f70ad132 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -524,7 +524,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject QQmlData *ddata = QQmlData::get(object, false); if (ddata && ddata->propertyCache) result = ddata->propertyCache->property(property, object, context); - else + if (!result) result = QQmlPropertyCache::property(engine->engine(), object, property, context, local); } diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 53b8a3c79d..747c9391e9 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -121,15 +121,16 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent) /*! \qmltype VisualDataModel \instantiates QQmlDelegateModel - \inqmlmodule QtQml 2 + \inqmlmodule QtQuick 2 \ingroup qtquick-models \brief Encapsulates a model and delegate The VisualDataModel type encapsulates a model and the delegate that will be instantiated for items in a model. - This type is provided by \c {QtQuick 2} for compatibility reasons. The same implementation - is now primarily available as DelegateModel in the QtQml.Models module. + This type is provided by the \l{Qt QML} module due to compatibility reasons. + The same implementation is now primarily available as DelegateModel in the + \l{Qt QML Models QML Types}{Qt QML Models} module. \sa {QtQml.Models2::DelegateModel} */ @@ -142,12 +143,6 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent) The DelegateModel type encapsulates a model and the delegate that will be instantiated for items in the model. - This element is also available as DelegateModel in the \c QtQuick module. For full details, - see the \l DelegateModel documentation. - - The DelegateModel type encapsulates a model and the delegate that will - be instantiated for items in the model. - It is usually not necessary to create a DelegateModel. However, it can be useful for manipulating and accessing the \l modelIndex when a QAbstractItemModel subclass is used as the @@ -158,6 +153,9 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent) The example below illustrates using a DelegateModel with a ListView. \snippet delegatemodel/visualdatamodel.qml 0 + + \note This type is also available as \l VisualDataModel in the \l{Qt QML} + module due to compatibility reasons. */ QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt) @@ -856,7 +854,8 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba delete cacheItem->object; cacheItem->object = 0; cacheItem->scriptRef -= 1; - cacheItem->contextData->destroy(); + if (cacheItem->contextData) + cacheItem->contextData->destroy(); cacheItem->contextData = 0; if (!cacheItem->isReferenced()) { @@ -2169,14 +2168,31 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package) } /*! + \qmltype VisualDataGroup + \instantiates QQmlDelegateModelGroup + \inqmlmodule QtQuick 2 + \ingroup qtquick-models + \brief Encapsulates a filtered set of visual data items + + The VisualDataGroup type provides a means to address the model data of a + model's delegate items, as well as sort and filter these delegate items. + + This type is provided by the \l{Qt QML} module due to compatibility reasons. + The same implementation is now primarily available as \l DelegateModelGroup + in the \l{Qt QML Models QML Types}{Qt QML Models} module. + + \sa {QtQml.Models2::DelegateModelGroup} +*/ +/*! \qmltype DelegateModelGroup \instantiates QQmlDelegateModelGroup - \inqmlmodule QtQml 2 + \inqmlmodule QtQml.Models 2 \ingroup qtquick-models \brief Encapsulates a filtered set of visual data items - The DelegateModelGroup type provides a means to address the model data of a DelegateModel's - delegate items, as well as sort and filter these delegate items. + The DelegateModelGroup type provides a means to address the model data of a + DelegateModel's delegate items, as well as sort and filter these delegate + items. The initial set of instantiable delegate items in a DelegateModel is represented by its \l {QtQml.Models2::DelegateModel::items}{items} group, which normally directly reflects @@ -2200,24 +2216,11 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package) type or to cherry-pick specific items that should be instantiated irregardless of whether they're currently within a view's visible area. - \sa {QML Dynamic View Ordering Tutorial} -*/ -/*! - \qmltype DelegateModelGroup - \instantiates QQmlDelegateModelGroup - \inqmlmodule QtQml.Models 2 - \brief Encapsulates a filtered set of visual data items - - The DelegateModelGroup type provides a means to address the model data of a DelegateModel's - delegate items, as well as sort and filter these delegate items. - - This element is also available as DelegateModelGroup in the \c QtQuick module. For full details, - see the \l DelegateModelGroup documentation. + \note This type is also available as \l VisualDataGroup in the \l{Qt QML} + module due to compatibility reasons. - \sa {QtQuick::DelegateModelGroup} + \sa {QML Dynamic View Ordering Tutorial} */ - - QQmlDelegateModelGroup::QQmlDelegateModelGroup(QObject *parent) : QObject(*new QQmlDelegateModelGroupPrivate, parent) { diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 9277b6ea8f..0cfd9c6ccb 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1426,22 +1426,12 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru \qmltype ListModel \instantiates QQmlListModel \inqmlmodule QtQml.Models 2 - \brief Defines a free-form list data source - - The ListModel is a simple container of ListElement definitions, each containing data roles. - The contents can be defined dynamically, or explicitly in QML. - - This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListModel -*/ -/*! - \qmltype ListModel - \instantiates QQmlListModel - \inqmlmodule QtQml 2 - \brief Defines a free-form list data source \ingroup qtquick-models + \brief Defines a free-form list data source - The ListModel is a simple container of ListElement definitions, each containing data roles. - The contents can be defined dynamically, or explicitly in QML. + The ListModel is a simple container of ListElement definitions, each + containing data roles. The contents can be defined dynamically, or + explicitly in QML. The number of elements in the model can be obtained from its \l count property. A number of familiar methods are also provided to manipulate the contents of the @@ -1801,7 +1791,7 @@ QHash<int, QByteArray> QQmlListModel::roleNames() const } /*! - \qmlproperty bool QtQml2::ListModel::dynamicRoles + \qmlproperty bool ListModel::dynamicRoles By default, the type of a role is fixed the first time the role is used. For example, if you create a role called @@ -1847,7 +1837,7 @@ void QQmlListModel::setDynamicRoles(bool enableDynamicRoles) } /*! - \qmlproperty int QtQml2::ListModel::count + \qmlproperty int ListModel::count The number of data entries in the model. */ int QQmlListModel::count() const @@ -2537,16 +2527,6 @@ bool QQmlListModelParser::definesEmptyList(const QString &s) \instantiates QQmlListElement \inqmlmodule QtQml.Models 2 \brief Defines a data item in a ListModel - - List elements are defined inside ListModel definitions, and represent items in a list. - - This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListElement -*/ -/*! - \qmltype ListElement - \instantiates QQmlListElement - \inqmlmodule QtQml 2 - \brief Defines a data item in a ListModel \ingroup qtquick-models List elements are defined inside ListModel definitions, and represent items in a diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index 0190081320..44c349fbe6 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -229,6 +229,9 @@ private: QStringHash<Role *> roleHash; }; +/*! +\internal +*/ class ListElement { public: @@ -292,6 +295,9 @@ private: friend class ListModel; }; +/*! +\internal +*/ class ListModel { public: @@ -375,4 +381,3 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(ListModel *); #endif // QQUICKLISTMODEL_P_P_H - diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp index 3e8a67a7d2..f2a7477c1b 100644 --- a/src/qml/types/qqmlobjectmodel.cpp +++ b/src/qml/types/qqmlobjectmodel.cpp @@ -169,7 +169,7 @@ public: /*! \qmltype VisualItemModel \instantiates QQmlObjectModel - \inqmlmodule QtQml 2 + \inqmlmodule QtQuick 2 \brief Defines a set of objects to be used as a model The VisualItemModel type encapsulates contains the objects to be used diff --git a/src/qmldevtools/qmldevtools.pro b/src/qmldevtools/qmldevtools.pro index a65ef94da9..10e1ce0275 100644 --- a/src/qmldevtools/qmldevtools.pro +++ b/src/qmldevtools/qmldevtools.pro @@ -3,9 +3,10 @@ TARGET = QtQmlDevTools QT = core CONFIG += static no_module_headers internal_module -MODULE_PRIVATE_INCLUDES = \ +MODULE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE \ - \$\$QT_MODULE_INCLUDE_BASE/QtQml \ + \$\$QT_MODULE_INCLUDE_BASE/QtQml +MODULE_PRIVATE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE/QtQml/$$QT.qml.VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtQml/$$QT.qml.VERSION/QtQml diff --git a/src/quick/designer/designerwindowmanager_p.h b/src/quick/designer/designerwindowmanager_p.h index 02aacf06bd..3bbd0c2825 100644 --- a/src/quick/designer/designerwindowmanager_p.h +++ b/src/quick/designer/designerwindowmanager_p.h @@ -67,7 +67,7 @@ class QSGContext; class QAnimationDriver; class QOpenGLContext; -class DesignerWindowManager : public QObject, public QSGRenderLoop +class DesignerWindowManager : public QSGRenderLoop { Q_OBJECT public: diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf index fba4ff89df..30861d9b2e 100644 --- a/src/quick/doc/qtquick.qdocconf +++ b/src/quick/doc/qtquick.qdocconf @@ -34,7 +34,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example tagfile = ../../../doc/qtquick/qtquick.tags -depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtdoc +depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtquicklayouts qtdoc qtquickdialogs headerdirs += .. @@ -58,3 +58,8 @@ sourcedirs += ../../imports #add plugins directory because of dependencies headerdirs += ../../plugins sourcedirs += ../../plugins + +#exclude certain directories +excludedirs += ../../imports/dialogs \ + ../../imports/models \ + ../../../examples/quick/dialogs diff --git a/src/quick/doc/src/concepts/positioning/layouts.qdoc b/src/quick/doc/src/concepts/positioning/layouts.qdoc index 785bcc6ca6..35be2f6235 100644 --- a/src/quick/doc/src/concepts/positioning/layouts.qdoc +++ b/src/quick/doc/src/concepts/positioning/layouts.qdoc @@ -28,9 +28,9 @@ /*! \ingroup qtquick-positioners \page qtquick-positioning-layouts.html -\title Item Layouts +\title Item Positioners -Positioner items are container items that manage the positions and sizes of +Positioner items are container items that manage the positions of items in a declarative user interface. Positioners behave in a similar way to the \l{Widgets and Layouts}{layout managers} used with standard Qt widgets, except that they are also containers in their own right. @@ -38,6 +38,10 @@ except that they are also containers in their own right. Positioners make it easier to work with many items when they need to be arranged in a regular layout. +\l{Qt Quick Layouts} can also be used to arrange Qt Quick items in a user interface. +They manage both the positions and the sizes of items on a declarative user interface, +and are well suited for resizable user interfaces. + \section1 Positioners A set of standard positioners are provided in the basic set of Qt Quick diff --git a/src/quick/doc/src/concepts/positioning/topic.qdoc b/src/quick/doc/src/concepts/positioning/topic.qdoc index 25fc6eaab7..bae6a7f71b 100644 --- a/src/quick/doc/src/concepts/positioning/topic.qdoc +++ b/src/quick/doc/src/concepts/positioning/topic.qdoc @@ -34,7 +34,7 @@ Visual items in QML can be positioned in a variety of ways. The most important positioning-related concept is that of anchoring, a form of relative positioning where items can be anchored (or attached) to each other at certain boundaries. Other positioning concepts include absolute positioning, -positioning with coordinate bindings, and layouts. +positioning with coordinate bindings, positioners, and layouts. \section1 Manual Positioning @@ -134,21 +134,20 @@ positioning, whereas a "contaminated" anchor layout is one which uses both anchoring and bindings (either on position-related [x,y] properties or on dimension-related [width,height] properties) to determine the position. -\section1 Layouts - -Qt Quick also provides some built-in layout items. For many use cases, the -best layout to use is a simple grid, row, or column, and Qt Quick provides -items which will layout children in these formations in the most efficient -manner possible. +\section1 Positioners -There are many well-known layouts which work well in user-interfaces, such as -grids and lists, rows and columns. Qt Quick supports these sort of pre-defined -layouts, which can often be more performant to draw than anchor or -binding-based layouts. See the documentation on -\l{qtquick-positioning-layouts.html}{layout types} for more -information about utilizing pre-defined layouts. +Qt Quick also provides some built-in positioner items. For many use cases, the best +positioner to use is a simple grid, row, or column, and Qt Quick provides items which +will position children in these formations in the most efficient manner possible. +See the documentation on \l{qtquick-positioning-layouts.html}{item positioners types} +for more information about utilizing pre-defined positioners. +\section1 Layouts +From Qt 5.1, the module \l {Qt Quick Layouts} can also be used to arrange Qt Quick +items in a user interface. Unlike positioners, the types in Qt Quick Layouts manage +both the positions and sizes of items in a declarative interface. They are well +suited for resizable user interfaces. \section1 Right-To-Left Support diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 7e49ac0f51..6863758455 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -56,14 +56,20 @@ information about the concepts which are central to \c QtQuick. Qt Quick includes several submodules which contain additional types. \list - \li \l{QtQuick.XmlListModel 2}{XML List Model} - contains types + \li \l{Qt Quick XmlListModel QML Types}{XML List Model} - contains types for creating models from XML data - \li \l{QtQuick.LocalStorage 2}{Local Storage} - a submodule + \li \l{Qt Quick Local Storage QML Types}{Local Storage} - a submodule containing a JavaScript interface for an SQLite database - \li \l{QtQuick.Particles 2}{Particles} - provides a particle + \li \l{Qt Quick Particles QML Types}{Particles} - provides a particle system for QML applications - \li \l{QtQuick.Window 2}{Window} - contains types for creating + \li \l{Qt Quick Window QML Types}{Window} - contains types for creating top-level windows and accessing screen information + \li \l{Qt Quick Dialogs QML Types}{Dialogs} - contains types for creating and + interacting with system dialogs + \li \l{Qt Quick Controls QML Types}{Controls} - provides a set of reusable + UI components + \li \l{Qt Quick Layouts QML Types}{Layouts} - contains types that are used + to arrange items in the user interface \endlist \section1 Basic Types @@ -228,13 +234,26 @@ Animation paths \section2 Model/View Types And Data Storage And Access -Models And Model Data +QML Lists and Models + +The \l{Qt QML Models QML Types}{Qt QML Models} submodule provides the types for +structuring data with models and lists. +\list +\li \l ListModel - Defines a list of data +\li \l ListElement - Defines a data item in a \l ListModel +\endlist + +These QML types are part of Qt Quick for backwards compatibility, but for +newer applications, \l{Qt QML Models QML Types}{Qt QML Models} provides +the same functionality. \list -\li \l {QtQuick2::ListModel}{ListModel} - Defines a list of data -\li \l {QtQuick2::ListElement}{ListElement} - Defines a data item in a \l {QtQuick2::ListModel}{ListModel} \li \l {VisualItemModel} - Contains items that already defines its own visual delegate \li \l {VisualDataModel} - Encapsulates a model and a delegate -\li \l {VisualDataGroup} -Encapsulates a filtered set of visual data items +\li \l {VisualDataGroup} - Encapsulates a filtered set of visual data items +\endlist + +XML Lists +\list \li \l {XmlListModel} - Specifies a model using XPath expressions \li \l {XmlRole} - Specifies a role for an \l {XmlListModel} \endlist diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc index cafe10db45..deb6aa164c 100644 --- a/src/quick/doc/src/qtquick.qdoc +++ b/src/quick/doc/src/qtquick.qdoc @@ -43,7 +43,7 @@ QML types for creating user interfaces with the QML language, and a \l{Qt Quick C++ Classes}{C++ API} for extending QML applications with C++ code. \note From Qt 5.1, a set of Qt Quick based UI controls is available to -create classic desktop-style user interfaces. Please see \l{Qt Quick Controls} +create user interfaces. Please see \l{Qt Quick Controls} for more information. For those new to QML and Qt Quick, please see @@ -125,6 +125,8 @@ Additional Qt Quick information: system for Qt Quick \li \l{QtQuick.Window 2}{Window} - contains types for creating top-level windows and accessing screen information + \li \l{Qt Quick Dialogs}{Dialogs} - contains types for creating and + interacting with system dialogs \endlist \li \l{Qt Quick Release Notes} - list of changes and additions in the Qt Quick \li \l{Qt Quick Code Samples} - list of all Qt Quick examples diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc index baa0312aa4..26d88699bc 100644 --- a/src/quick/doc/src/whatsnew.qdoc +++ b/src/quick/doc/src/whatsnew.qdoc @@ -29,7 +29,45 @@ \title Qt Quick Release Notes \page qtquick-releasenotes.html -\section1 Qt Quick in Qt 5 +\section1 Qt Quick in Qt 5.1 + +\l{Qt Quick} 2.1 is new in Qt 5.1. This is a summary of improvements and new +features introduced by the new import and new classes in Qt 5.1: +\list +\li New threaded render loop for Mac, Linux, and Embedded. +\li New render loop for windows for smoother animations. +\li New \l Window properties: activeFocusItem, minimumWidth, minimumHeight, + maximumWidth, maximumHeight, visibility, contentOrientation, and opacity. +\li New \l Screen attached properties: name, desktopAvailableWidth, + desktopAvailableHeight, logicalPixelDensity +\li New \l Grid properties: horizontalAlignment, verticalAlignment, and + effectiveHorizontalAlignment. +\li New \l TextEdit properties: selectByKeyboard and textDocument +\li A \l Window declared inside another Window or \l Item will automatically be + transient for (centered upon) the outer window. +\li These types are now part of \l{Qt QML}: + \list + \li \l {VisualItemModel} + \li \l {VisualDataModel} - Encapsulates a model and a delegate + \li \l {VisualDataGroup} + \endlist + These types are kept due to compatibility reasons and are replaced by the + \l{Qt QML Models QML Types}{Qt QML Models} types. + \endlist +\endlist + +\section2 New Submodules + +In Qt 5.1, there are several new modules which extend Qt Quick functionalities. +\list +\li \l{Qt Quick Dialogs} - contains types for creating and interacting with system dialogs +\li \l{Qt Quick Controls} - provides a set of reusable UI components +\li \l{Qt Quick Layouts} - contains types that are used to arrange items in the user interface +\endlist + +The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release. + +\section1 Qt Quick in Qt 5.0 The \l {Qt Quick} module is new in Qt 5. It provides the visual canvas and scenegraph back-end as well as the \c QtQuick QML module for QML application development. diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 5709d58d58..c948d87cc0 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -2624,7 +2624,7 @@ static v8::Handle<v8::Value> ctx2d_createImageData(const v8::Arguments &args) } /*! - \qmlmethod CanvasImageData QtQuick2::Canvas::getImageData(real sx, real sy, real sw, real sh) + \qmlmethod CanvasImageData QtQuick2::Context2D::getImageData(real sx, real sy, real sw, real sh) Returns an CanvasImageData object containing the image data for the given rectangle of the canvas. */ static v8::Handle<v8::Value> ctx2d_getImageData(const v8::Arguments &args) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index d6a663ab77..110e14d266 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1363,7 +1363,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj) \brief Property used to mirror layout behavior The LayoutMirroring attached property is used to horizontally mirror \l {anchor-layout}{Item anchors}, - \l{Item Layouts}{positioner} types (such as \l Row and \l Grid) + \l{Item Positioners}{positioner} types (such as \l Row and \l Grid) and views (such as \l GridView and horizontal \l ListView). Mirroring is a visual change: left anchors become right anchors, and positioner types like \l Grid and \l Row reverse the horizontal layout of child items. @@ -1403,7 +1403,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj) This property holds whether the item's layout is mirrored horizontally. Setting this to true horizontally reverses \l {anchor-layout}{anchor} settings such that left anchors become right, - and right anchors become left. For \l{Item Layouts}{positioner} types + and right anchors become left. For \l{Item Positioners}{positioner} types (such as \l Row and \l Grid) and view types (such as \l {GridView}{GridView} and \l {ListView}{ListView}) this also mirrors the horizontal layout direction of the item. @@ -2050,7 +2050,10 @@ bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item) { bool result = true; - if (item->window() && item == item->window()->contentItem()) + if (!item->window()) + return false; + + if (item == item->window()->contentItem()) return true; #ifndef QT_NO_ACCESSIBILITY @@ -2093,7 +2096,6 @@ bool QQuickItemPrivate::focusNextPrev(QQuickItem *item, bool forward) QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, bool forward) { Q_ASSERT(item); - Q_ASSERT(item->activeFocusOnTab()); bool all = QQuickItemPrivate::qt_tab_all_widgets(); @@ -2107,6 +2109,10 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo from = item->parentItem(); } bool skip = false; + const QQuickItem * const contentItem = item->window()->contentItem(); + const QQuickItem * const originalItem = item; + QQuickItem * startItem = item; + QQuickItem * firstFromItem = from; QQuickItem *current = item; do { skip = false; @@ -2157,8 +2163,25 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo skip = true; } } - from = last; + if (current == startItem && from == firstFromItem) { + // wrapped around, avoid endless loops + if (originalItem == contentItem) { +#ifdef FOCUS_DEBUG + qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem"; +#endif + return item->window()->contentItem(); + } else { +#ifdef FOCUS_DEBUG + qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return " << startItem; +#endif + return startItem; + } + } + if (!firstFromItem) { //start from root + startItem = current; + firstFromItem = from; + } } while (skip || !current->activeFocusOnTab() || !current->isEnabled() || !current->isVisible() || !(all || QQuickItemPrivate::canAcceptTabFocus(current))); @@ -4375,7 +4398,8 @@ void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e) return; //only care about KeyPress now - if (q->activeFocusOnTab() && e->type() == QEvent::KeyPress) { + if ((q == q->window()->contentItem() || q->activeFocusOnTab()) + && e->type() == QEvent::KeyPress) { bool res = false; if (!(e->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier? if (e->key() == Qt::Key_Backtab diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 84eafec1d7..d7256f3568 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -324,7 +324,7 @@ public: Q_INVOKABLE void mapToItem(QQmlV8Function*) const; Q_INVOKABLE void forceActiveFocus(); Q_INVOKABLE void forceActiveFocus(Qt::FocusReason reason); - Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward = true); + Q_REVISION(1) Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward = true); Q_INVOKABLE QQuickItem *childAt(qreal x, qreal y) const; #ifndef QT_NO_IM diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp index 789d2e62aa..b07a38cdaf 100644 --- a/src/quick/items/qquickpositioners.cpp +++ b/src/quick/items/qquickpositioners.cpp @@ -626,7 +626,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) more information about its position within the Column. For more information on using Column and other related positioner-types, see - \l{Item Layouts}. + \l{Item Positioners}. \section1 Using Transitions @@ -644,7 +644,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) \image verticalpositioner_transition.gif - \sa Row, Grid, Flow, Positioner, {Qt Quick Examples - Positioners} + \sa Row, Grid, Flow, Positioner, ColumnLayout, {Qt Quick Examples - Positioners} */ /*! \qmlproperty Transition QtQuick2::Column::populate @@ -795,10 +795,10 @@ void QQuickColumn::reportConflictingAnchors() more information about its position within the Row. For more information on using Row and other related positioner-types, see - \l{Item Layouts}. + \l{Item Positioners}. - \sa Column, Grid, Flow, Positioner, {Qt Quick Examples - Positioners} + \sa Column, Grid, Flow, Positioner, RowLayout, {Qt Quick Examples - Positioners} */ /*! \qmlproperty Transition QtQuick2::Row::populate @@ -1028,10 +1028,10 @@ void QQuickRow::reportConflictingAnchors() or anchor itself with any of the \l {Item::anchors}{anchor} properties. For more information on using Grid and other related positioner-types, see - \l{Item Layouts}. + \l{Item Positioners}. - \sa Flow, Row, Column, Positioner, {Qt Quick Examples - Positioners} + \sa Flow, Row, Column, Positioner, GridLayout, {Qt Quick Examples - Positioners} */ /*! \qmlproperty Transition QtQuick2::Grid::populate @@ -1570,7 +1570,7 @@ void QQuickGrid::reportConflictingAnchors() or anchor itself with any of the \l {Item::anchors}{anchor} properties. For more information on using Flow and other related positioner-types, see - \l{Item Layouts}. + \l{Item Positioners}. \sa Column, Row, Grid, Positioner, {Qt Quick Examples - Positioners} */ diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 102066704b..f39a15070c 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -912,8 +912,8 @@ QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa { QQuickShaderEffectNode *node = static_cast<QQuickShaderEffectNode *>(oldNode); - // In the case of a bad vertex shader, don't try to create a node... - if (m_common.attributes.isEmpty()) { + // In the case of zero-size or a bad vertex shader, don't try to create a node... + if (m_common.attributes.isEmpty() || width() <= 0 || height() <= 0) { if (node) delete node; return 0; diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index bd0bb2348e..9debfe35b3 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -942,7 +942,7 @@ void QQuickShaderEffectSource::releaseResources() QSGNode *QQuickShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { - if (!m_sourceItem || m_sourceItem->width() == 0 || m_sourceItem->height() == 0) { + if (!m_sourceItem || m_sourceItem->width() <= 0 || m_sourceItem->height() <= 0) { if (m_texture) m_texture->setItem(0); delete oldNode; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 4a34adabe8..619c72afb8 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -74,6 +74,8 @@ QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); +bool QQuickWindowPrivate::defaultAlphaBuffer(0); + void QQuickWindowPrivate::updateFocusItemTransform() { Q_Q(QQuickWindow); @@ -87,44 +89,49 @@ void QQuickWindowPrivate::updateFocusItemTransform() #endif } - class QQuickWindowIncubationController : public QObject, public QQmlIncubationController { Q_OBJECT public: - QQuickWindowIncubationController(const QQuickWindow *window) - : m_window(QQuickWindowPrivate::get(const_cast<QQuickWindow *>(window))) + QQuickWindowIncubationController(QSGRenderLoop *loop) + : m_renderLoop(loop), m_timer(0) { // Allow incubation for 1/3 of a frame. m_incubation_time = qMax(1, int(1000 / QGuiApplication::primaryScreen()->refreshRate()) / 3); - m_animation_driver = m_window->windowManager->animationDriver(); + m_animation_driver = m_renderLoop->animationDriver(); if (m_animation_driver) { connect(m_animation_driver, SIGNAL(stopped()), this, SLOT(animationStopped())); - connect(window, SIGNAL(frameSwapped()), this, SLOT(incubate())); + connect(m_renderLoop, SIGNAL(timeToIncubate()), this, SLOT(incubate())); } } protected: - virtual bool event(QEvent *e) + void timerEvent(QTimerEvent *) { - if (e->type() == QEvent::User) { - incubate(); - return true; + killTimer(m_timer); + m_timer = 0; + incubate(); + } + + void incubateAgain() { + if (m_timer == 0) { + // Wait for a while before processing the next batch. Using a + // timer to avoid starvation of system events. + m_timer = startTimer(m_incubation_time); } - return QObject::event(e); } public slots: void incubate() { if (incubatingObjectCount()) { - if (m_animation_driver && m_animation_driver->isRunning()) { + if (m_renderLoop->interleaveIncubation()) { incubateFor(m_incubation_time); } else { incubateFor(m_incubation_time * 2); if (incubatingObjectCount()) - QCoreApplication::postEvent(this, new QEvent(QEvent::User)); + incubateAgain(); } } } @@ -134,14 +141,15 @@ public slots: protected: virtual void incubatingObjectCountChanged(int count) { - if (count && (!m_animation_driver || !m_animation_driver->isRunning())) - QCoreApplication::postEvent(this, new QEvent(QEvent::User)); + if (count && !m_renderLoop->interleaveIncubation()) + incubateAgain(); } private: - QQuickWindowPrivate *m_window; + QSGRenderLoop *m_renderLoop; int m_incubation_time; QAnimationDriver *m_animation_driver; + int m_timer; }; #include "qquickwindow.moc" @@ -347,6 +355,7 @@ QQuickWindowPrivate::QQuickWindowPrivate() , persistentGLContext(true) , persistentSceneGraph(true) , lastWheelEventAccepted(false) + , componentCompleted(true) , renderTarget(0) , renderTargetId(0) , incubationController(0) @@ -2777,7 +2786,7 @@ QQmlIncubationController *QQuickWindow::incubationController() const Q_D(const QQuickWindow); if (!d->incubationController) - d->incubationController = new QQuickWindowIncubationController(this); + d->incubationController = new QQuickWindowIncubationController(d->windowManager); return d->incubationController; } @@ -2969,7 +2978,7 @@ QSGTexture *QQuickWindow::createTextureFromId(uint id, const QSize &size, Create Setting the clear color has no effect when clearing is disabled. By default, the clear color is white. - \sa setClearBeforeRendering() + \sa setClearBeforeRendering(), setDefaultAlphaBuffer() */ void QQuickWindow::setColor(const QColor &color) @@ -2979,7 +2988,7 @@ void QQuickWindow::setColor(const QColor &color) return; if (color.alpha() != d->clearColor.alpha()) { - QSurfaceFormat fmt = format(); + QSurfaceFormat fmt = requestedFormat(); if (color.alpha() < 255) fmt.setAlphaBufferSize(8); else @@ -2997,6 +3006,31 @@ QColor QQuickWindow::color() const } /*! + \brief Returns whether to use alpha transparency on newly created windows. + + \since Qt 5.1 + \sa setDefaultAlphaBuffer() + */ +bool QQuickWindow::hasDefaultAlphaBuffer() +{ + return QQuickWindowPrivate::defaultAlphaBuffer; +} + +/*! + \brief \a useAlpha specifies whether to use alpha transparency on newly created windows. + \since Qt 5.1 + + In any application which expects to create translucent windows, it's + necessary to set this to true before creating the first QQuickWindow, + because all windows will share the same \l QOpenGLContext. The default + value is false. + */ +void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha) +{ + QQuickWindowPrivate::defaultAlphaBuffer = useAlpha; +} + +/*! \qmlproperty string QtQuick.Window2::Window::title The window's title in the windowing system. diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index fc148aabe6..a0bc832334 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -115,6 +115,9 @@ public: void setColor(const QColor &color); QColor color() const; + static bool hasDefaultAlphaBuffer(); + static void setDefaultAlphaBuffer(bool useAlpha); + void setPersistentOpenGLContext(bool persistent); bool isPersistentOpenGLContext() const; diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 9e3251b240..2dddd9ab68 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -209,6 +209,7 @@ public: uint persistentSceneGraph : 1; uint lastWheelEventAccepted : 1; + bool componentCompleted : 1; QOpenGLFramebufferObject *renderTarget; uint renderTargetId; @@ -219,6 +220,8 @@ public: mutable QQuickWindowIncubationController *incubationController; + static bool defaultAlphaBuffer; + static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event); // data property diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp index f826a53a29..b91edc2fd5 100644 --- a/src/quick/items/qquickwindowmodule.cpp +++ b/src/quick/items/qquickwindowmodule.cpp @@ -42,18 +42,40 @@ #include "qquickwindowmodule_p.h" #include "qquickscreen_p.h" #include <QtQuick/QQuickWindow> +#include <QtCore/QCoreApplication> +#include <QtQml/QQmlEngine> QT_BEGIN_NAMESPACE +class QQuickWindowQmlImpl : public QQuickWindow, public QQmlParserStatus +{ + Q_INTERFACES(QQmlParserStatus) + Q_OBJECT +protected: + void classBegin() { + //Give QQuickView behavior when created from QML with QQmlApplicationEngine + if (QCoreApplication::instance()->property("__qml_using_qqmlapplicationengine") == QVariant(true)) { + QQmlEngine* e = qmlEngine(this); + if (e && !e->incubationController()) + e->setIncubationController(incubationController()); + } + } + + void componentComplete() {} +}; + void QQuickWindowModule::defineModule() { const char uri[] = "QtQuick.Window"; qmlRegisterType<QQuickWindow>(uri, 2, 0, "Window"); qmlRegisterRevision<QWindow,1>(uri, 2, 1); - qmlRegisterType<QQuickWindow,1>(uri, 2, 1, "Window"); + qmlRegisterRevision<QQuickWindow,1>(uri, 2, 1);//Type moved to a subclass, but also has new members + qmlRegisterType<QQuickWindowQmlImpl>(uri, 2, 1, "Window"); qmlRegisterUncreatableType<QQuickScreen>(uri, 2, 0, "Screen", QStringLiteral("Screen can only be used via the attached property.")); } +#include "qquickwindowmodule.moc" + QT_END_NAMESPACE diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index d3710c7bd5..61fb1bc5b9 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -47,13 +47,16 @@ #include <QtQuick/private/qsgdefaultimagenode_p.h> #include <QtQuick/private/qsgdefaultglyphnode_p.h> #include <QtQuick/private/qsgdistancefieldglyphnode_p.h> +#include <QtQuick/private/qsgdistancefieldglyphnode_p_p.h> #include <QtQuick/private/qsgshareddistancefieldglyphcache_p.h> +#include <QtQuick/QSGFlatColorMaterial> #include <QtQuick/private/qsgtexture_p.h> #include <QtQuick/private/qquickpixmapcache_p.h> #include <QGuiApplication> #include <QOpenGLContext> +#include <QQuickWindow> #include <QtGui/qopenglframebufferobject.h> #include <private/qqmlglobal_p.h> @@ -262,9 +265,35 @@ void QSGContext::initialize(QOpenGLContext *context) Q_ASSERT(!d->gl); d->gl = context; + precompileMaterials(); + emit initialized(); } +#define QSG_PRECOMPILE_MATERIAL(name) { name m; prepareMaterial(&m); } + +/* + * Some glsl compilers take their time compiling materials, and + * the way the scene graph is being processed, these materials + * get compiled when they are first taken into use. This can + * easily lead to skipped frames. By precompiling the most + * common materials, we potentially add a few milliseconds to the + * start up, and reduce the chance of avoiding skipped frames + * later on. + */ +void QSGContext::precompileMaterials() +{ + if (qEnvironmentVariableIsEmpty("QSG_NO_MATERIAL_PRELOADING")) { + QSG_PRECOMPILE_MATERIAL(QSGVertexColorMaterial); + QSG_PRECOMPILE_MATERIAL(QSGFlatColorMaterial); + QSG_PRECOMPILE_MATERIAL(QSGOpaqueTextureMaterial); + QSG_PRECOMPILE_MATERIAL(QSGTextureMaterial); + QSG_PRECOMPILE_MATERIAL(SmoothTextureMaterial); + QSG_PRECOMPILE_MATERIAL(SmoothColorMaterial); + QSG_PRECOMPILE_MATERIAL(QSGDistanceFieldTextMaterial); + } +} + /*! Returns if the scene graph context is ready or not, meaning that it has a valid @@ -398,6 +427,8 @@ QSurfaceFormat QSGContext::defaultSurfaceFormat() const QSurfaceFormat format; format.setDepthBufferSize(24); format.setStencilBufferSize(8); + if (QQuickWindow::hasDefaultAlphaBuffer()) + format.setAlphaBufferSize(8); format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); return format; } diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index b069c53dd3..bbc42674c6 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -90,6 +90,7 @@ public: bool isReady() const; + virtual void precompileMaterials(); QSGMaterialShader *prepareMaterial(QSGMaterial *material); virtual void renderNextFrame(QSGRenderer *renderer, GLuint fboId); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 3a608a911d..e099d94a53 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -82,7 +82,7 @@ QSGRenderLoop::~QSGRenderLoop() { } -class QSGGuiThreadRenderLoop : public QObject, public QSGRenderLoop +class QSGGuiThreadRenderLoop : public QSGRenderLoop { Q_OBJECT public: diff --git a/src/quick/scenegraph/qsgrenderloop_p.h b/src/quick/scenegraph/qsgrenderloop_p.h index b18e6f00ad..6ff9c4c5f9 100644 --- a/src/quick/scenegraph/qsgrenderloop_p.h +++ b/src/quick/scenegraph/qsgrenderloop_p.h @@ -51,8 +51,10 @@ class QQuickWindow; class QSGContext; class QAnimationDriver; -class Q_QUICK_PRIVATE_EXPORT QSGRenderLoop +class Q_QUICK_PRIVATE_EXPORT QSGRenderLoop : public QObject { + Q_OBJECT + public: virtual ~QSGRenderLoop(); @@ -77,6 +79,11 @@ public: static QSGRenderLoop *instance(); static void setInstance(QSGRenderLoop *instance); + virtual bool interleaveIncubation() const { return false; } + +signals: + void timeToIncubate(); + private: static QSGRenderLoop *s_instance; }; diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index c4a9328ceb..bfd9a2fb20 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -574,6 +574,7 @@ void QSGRenderThread::syncAndRender() int waitTime = vsyncDelta - (int) waitTimer.elapsed(); if (waitTime > 0) msleep(waitTime); + emit wm->timeToIncubate(); return; } @@ -600,6 +601,7 @@ void QSGRenderThread::syncAndRender() d->fireFrameSwapped(); } RLDEBUG(" Render: - rendering done"); + emit wm->timeToIncubate(); #ifndef QSG_NO_RENDER_TIMING if (qsg_render_timing) @@ -723,7 +725,7 @@ QSGContext *QSGThreadedRenderLoop::sceneGraphContext() const return m_thread->sg; } -bool QSGThreadedRenderLoop::anyoneShowing() +bool QSGThreadedRenderLoop::anyoneShowing() const { for (int i=0; i<m_windows.size(); ++i) { QQuickWindow *c = m_windows.at(i).window; @@ -733,6 +735,11 @@ bool QSGThreadedRenderLoop::anyoneShowing() return false; } +bool QSGThreadedRenderLoop::interleaveIncubation() const +{ + return m_animation_driver->isRunning() && anyoneShowing(); +} + void QSGThreadedRenderLoop::animationStarted() { RLDEBUG("GUI: animationStarted()"); @@ -1011,7 +1018,6 @@ void QSGThreadedRenderLoop::polishAndSync() RLDEBUG("GUI: - animations advancing"); m_animation_driver->advance(); RLDEBUG("GUI: - animations done"); - // We need to trigger another sync to keep animations running... maybePostPolishRequest(); } else if (m_sync_triggered_update) { @@ -1032,7 +1038,7 @@ void QSGThreadedRenderLoop::polishAndSync() polishTime, waitTime - polishTime, syncTime - waitTime, - timer.elapsed() - syncTime); + timer.nsecsElapsed() - syncTime); } #endif } diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h index aab0e8726f..6ff5cabf43 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h +++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QSGRenderThread; -class QSGThreadedRenderLoop : public QObject, public QSGRenderLoop +class QSGThreadedRenderLoop : public QSGRenderLoop { Q_OBJECT public: @@ -79,7 +79,7 @@ public: bool event(QEvent *); - void wakeup(); + bool interleaveIncubation() const; public slots: void animationStarted(); @@ -91,7 +91,7 @@ private: void releaseResources(QQuickWindow *window, bool inDestructor); bool checkAndResetForceUpdate(QQuickWindow *window); - bool anyoneShowing(); + bool anyoneShowing() const; void initialize(); void maybePostPolishRequest(); diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index ce43ccf531..8e97f65ea5 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -102,6 +102,11 @@ QSGWindowsRenderLoop::QSGWindowsRenderLoop() #endif } +bool QSGWindowsRenderLoop::interleaveIncubation() const +{ + return m_animationDriver->isRunning() && anyoneShowing(); +} + QSGWindowsRenderLoop::WindowData *QSGWindowsRenderLoop::windowData(QQuickWindow *window) { for (int i=0; i<m_windows.size(); ++i) { @@ -390,6 +395,8 @@ void QSGWindowsRenderLoop::render() // and thus another render pass, so to keep things running, // make sure there is another frame pending. maybePostUpdateTimer(); + + emit timeToIncubate(); } } diff --git a/src/quick/scenegraph/qsgwindowsrenderloop_p.h b/src/quick/scenegraph/qsgwindowsrenderloop_p.h index dc3a409cd5..218e18c3e2 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop_p.h +++ b/src/quick/scenegraph/qsgwindowsrenderloop_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE -class QSGWindowsRenderLoop : public QObject, public QSGRenderLoop +class QSGWindowsRenderLoop : public QSGRenderLoop { Q_OBJECT public: @@ -80,6 +80,9 @@ public: void resize(QQuickWindow *, const QSize &) { } bool event(QEvent *event); + bool anyoneShowing() const; + + bool interleaveIncubation() const; public slots: void started(); @@ -93,7 +96,6 @@ private: void handleObscurity(); void maybePostUpdateTimer(); - bool anyoneShowing() const; WindowData *windowData(QQuickWindow *window); QList<WindowData> m_windows; |