diff options
23 files changed, 132 insertions, 54 deletions
diff --git a/.qmake.conf b/.qmake.conf index 1ee23b1b..ba3d879b 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,6 +2,6 @@ load(qt_build_config) CONFIG += warning_clean android|ios|qnx|isEmpty(QT.widgets.name): CONFIG += no_desktop -DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST +DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS -MODULE_VERSION = 5.15.0 +MODULE_VERSION = 6.0.0 diff --git a/dependencies.yaml b/dependencies.yaml new file mode 100644 index 00000000..614cc0cc --- /dev/null +++ b/dependencies.yaml @@ -0,0 +1,4 @@ +dependencies: + ../qtgraphicaleffects: + ref: d355f47a57248a79ad85adfd83c33a1b1fb63062 + required: false diff --git a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp index 1e47f23e..69987a4a 100644 --- a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp +++ b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp @@ -108,22 +108,43 @@ void SortFilterProxyModel::setFilterRole(const QByteArray &role) QString SortFilterProxyModel::filterString() const { - return filterRegExp().pattern(); + return m_filterString; } void SortFilterProxyModel::setFilterString(const QString &filter) { - setFilterRegExp(QRegExp(filter, filterCaseSensitivity(), static_cast<QRegExp::PatternSyntax>(filterSyntax()))); + m_filterString = filter; + updateRegularExpression(); } SortFilterProxyModel::FilterSyntax SortFilterProxyModel::filterSyntax() const { - return static_cast<FilterSyntax>(filterRegExp().patternSyntax()); + return m_filterSyntax; } void SortFilterProxyModel::setFilterSyntax(SortFilterProxyModel::FilterSyntax syntax) { - setFilterRegExp(QRegExp(filterString(), filterCaseSensitivity(), static_cast<QRegExp::PatternSyntax>(syntax))); + m_filterSyntax = syntax; + updateRegularExpression(); +} + +void SortFilterProxyModel::updateRegularExpression() +{ + auto options = filterCaseSensitivity() == Qt::CaseInsensitive + ? QRegularExpression::CaseInsensitiveOption + : QRegularExpression::NoPatternOption; + + switch (filterSyntax()) { + case RegExp: + setFilterRegularExpression(QRegularExpression(filterString(), options)); + break; + case Wildcard: + setFilterRegularExpression(QRegularExpression(QRegularExpression::wildcardToRegularExpression(filterString()), options)); + break; + case FixedString: + setFilterRegularExpression(QRegularExpression(QRegularExpression::escape(filterString()), options)); + break; + } } QJSValue SortFilterProxyModel::get(int idx) const @@ -165,8 +186,8 @@ QHash<int, QByteArray> SortFilterProxyModel::roleNames() const bool SortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QRegExp rx = filterRegExp(); - if (rx.isEmpty()) + QRegularExpression rx = filterRegularExpression(); + if (!rx.isValid()) return true; QAbstractItemModel *model = sourceModel(); if (filterRole().isEmpty()) { diff --git a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.h b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.h index dbc73e84..68cf0690 100644 --- a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.h +++ b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.h @@ -111,9 +111,12 @@ protected: int roleKey(const QByteArray &role) const; QHash<int, QByteArray> roleNames() const; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; + void updateRegularExpression(); private: bool m_complete; + FilterSyntax m_filterSyntax; + QString m_filterString; QByteArray m_sortRole; QByteArray m_filterRole; }; diff --git a/src/controls/Private/qquickcontrolsprivate_p.h b/src/controls/Private/qquickcontrolsprivate_p.h index 4302f80a..c4c41507 100644 --- a/src/controls/Private/qquickcontrolsprivate_p.h +++ b/src/controls/Private/qquickcontrolsprivate_p.h @@ -53,6 +53,8 @@ class QQuickControlsPrivate1Attached : public QObject Q_OBJECT Q_PROPERTY(QQuickWindow* window READ window NOTIFY windowChanged) + Q_MOC_INCLUDE(<QtQuick/qquickwindow.h>) + public: QQuickControlsPrivate1Attached(QObject* attachee); diff --git a/src/controls/Private/qquicksceneposlistener_p.h b/src/controls/Private/qquicksceneposlistener_p.h index 61447c7d..f2c1e967 100644 --- a/src/controls/Private/qquicksceneposlistener_p.h +++ b/src/controls/Private/qquicksceneposlistener_p.h @@ -56,6 +56,8 @@ class QQuickScenePosListener1 : public QObject, public QQuickItemChangeListener Q_PROPERTY(QPointF scenePos READ scenePos NOTIFY scenePosChanged FINAL) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickScenePosListener1(QObject *parent = 0); ~QQuickScenePosListener1(); diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp index fa51c4a3..20d89356 100644 --- a/src/controls/Private/qquickstyleitem.cpp +++ b/src/controls/Private/qquickstyleitem.cpp @@ -1041,8 +1041,7 @@ QSize QQuickStyleItem1::sizeFromContents(int width, int height) case MenuItem: case ComboBoxItem: if (static_cast<QStyleOptionMenuItem *>(m_styleoption)->menuItemType == QStyleOptionMenuItem::Scroller) { - size.setHeight(qMax(QApplication::globalStrut().height(), - qApp->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, 0, 0))); + size.setHeight(qApp->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, 0, 0)); } else { size = qApp->style()->sizeFromContents(QStyle::CT_MenuItem, m_styleoption, QSize(width,height)); } diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml index 64e68515..2ab9d2e0 100644 --- a/src/controls/TableViewColumn.qml +++ b/src/controls/TableViewColumn.qml @@ -1,11 +1,11 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Controls module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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 The Qt Company Ltd 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$ ** diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 402161c2..d289780e 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -365,8 +365,8 @@ ScrollView { Set this property to wrap the text to the TextArea item's width. \list - \li TextEdit.NoWrap - no wrapping will be performed. - \li TextEdit.WordWrap (default) - wrapping is done on word boundaries only. + \li TextEdit.NoWrap (default) - no wrapping will be performed. + \li TextEdit.WordWrap - wrapping is done on word boundaries only. \li TextEdit.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word. \li TextEdit.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word. \endlist diff --git a/src/controls/TreeView.qml b/src/controls/TreeView.qml index 2bedb9e6..9ecc732b 100644 --- a/src/controls/TreeView.qml +++ b/src/controls/TreeView.qml @@ -1,11 +1,11 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Controls module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "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 The Qt Company Ltd 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$ ** diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 446357aa..529fb96d 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -65,6 +65,7 @@ #include "Private/qquickstyleitem_p.h" #endif +#include <QtCore/qfile.h> #ifndef QT_NO_TRANSLATION #include <QtCore/qcoreapplication.h> #include <QtCore/qlibraryinfo.h> diff --git a/src/controls/qquickaction_p.h b/src/controls/qquickaction_p.h index 97601a32..8d6757b5 100644 --- a/src/controls/qquickaction_p.h +++ b/src/controls/qquickaction_p.h @@ -69,6 +69,8 @@ class QQuickAction1 : public QObject Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged) #endif + Q_MOC_INCLUDE("qquickexclusivegroup_p.h") + public: explicit QQuickAction1(QObject *parent = 0); ~QQuickAction1(); diff --git a/src/controls/qquickmenu_p.h b/src/controls/qquickmenu_p.h index 0594f391..762774a7 100644 --- a/src/controls/qquickmenu_p.h +++ b/src/controls/qquickmenu_p.h @@ -77,6 +77,9 @@ class QQuickMenu1 : public QQuickMenuText1 Q_PROPERTY(bool __isProxy READ isProxy WRITE setProxy NOTIFY __proxyChanged) Q_ENUMS(MenuType) + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + Q_MOC_INCLUDE("qquickaction_p.h") + public: // MenuType must stay in sync with QPlatformMenu::MenuType enum MenuType { DefaultMenu = 0, EditMenu }; diff --git a/src/controls/qquickmenubar_p.h b/src/controls/qquickmenubar_p.h index e6dc9647..d2e44435 100644 --- a/src/controls/qquickmenubar_p.h +++ b/src/controls/qquickmenubar_p.h @@ -61,6 +61,8 @@ class QQuickMenuBar1: public QObject Q_PROPERTY(QQuickWindow *__parentWindow READ parentWindow WRITE setParentWindow) Q_PROPERTY(bool __isNative READ isNative WRITE setNative NOTIFY nativeChanged) + Q_MOC_INCLUDE(<QtQuick/qquickwindow.h>) + Q_SIGNALS: void menusChanged(); void nativeChanged(); diff --git a/src/controls/qquickmenuitem_p.h b/src/controls/qquickmenuitem_p.h index ae7ed0e6..f28fafd9 100644 --- a/src/controls/qquickmenuitem_p.h +++ b/src/controls/qquickmenuitem_p.h @@ -81,6 +81,8 @@ class QQuickMenuBase1: public QObject Q_PROPERTY(bool __isNative READ isNative CONSTANT) Q_PROPERTY(QQuickItem *__visualItem READ visualItem WRITE setVisualItem) + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + Q_SIGNALS: void visibleChanged(); @@ -180,6 +182,9 @@ class QQuickMenuItem1 : public QQuickMenuText1 Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged) Q_PROPERTY(QQuickAction1 *action READ boundAction WRITE setBoundAction NOTIFY actionChanged) + Q_MOC_INCLUDE("qquickexclusivegroup_p.h") + Q_MOC_INCLUDE("qquickaction_p.h") + public Q_SLOTS: void trigger(); diff --git a/src/dialogs/qquickcolordialog_p.h b/src/dialogs/qquickcolordialog_p.h index 619b7b10..2e252b39 100644 --- a/src/dialogs/qquickcolordialog_p.h +++ b/src/dialogs/qquickcolordialog_p.h @@ -61,6 +61,8 @@ class QQuickColorDialog : public QQuickAbstractColorDialog Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractColorDialog in QML can have only one child + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickColorDialog(QObject *parent = 0); ~QQuickColorDialog(); diff --git a/src/dialogs/qquickdialog_p.h b/src/dialogs/qquickdialog_p.h index fec4ec9a..53a8707b 100644 --- a/src/dialogs/qquickdialog_p.h +++ b/src/dialogs/qquickdialog_p.h @@ -69,6 +69,8 @@ class QQuickDialog1 : public QQuickAbstractDialog Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "contentItem") // Dialog in QML can have only one child + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickDialog1(QObject *parent = 0); ~QQuickDialog1(); diff --git a/src/dialogs/qquickfiledialog_p.h b/src/dialogs/qquickfiledialog_p.h index ae608d75..0bf45592 100644 --- a/src/dialogs/qquickfiledialog_p.h +++ b/src/dialogs/qquickfiledialog_p.h @@ -61,6 +61,8 @@ class QQuickFileDialog : public QQuickAbstractFileDialog Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractFileDialog in QML can have only one child + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickFileDialog(QObject *parent = 0); ~QQuickFileDialog(); diff --git a/src/dialogs/qquickfontdialog_p.h b/src/dialogs/qquickfontdialog_p.h index bd04f536..3c2089d6 100644 --- a/src/dialogs/qquickfontdialog_p.h +++ b/src/dialogs/qquickfontdialog_p.h @@ -61,6 +61,8 @@ class QQuickFontDialog : public QQuickAbstractFontDialog Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "contentItem") + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickFontDialog(QObject *parent = 0); ~QQuickFontDialog(); diff --git a/src/dialogs/qquickmessagedialog_p.h b/src/dialogs/qquickmessagedialog_p.h index 3b79f967..c4af85be 100644 --- a/src/dialogs/qquickmessagedialog_p.h +++ b/src/dialogs/qquickmessagedialog_p.h @@ -61,6 +61,8 @@ class QQuickMessageDialog : public QQuickAbstractMessageDialog Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractMessageDialog in QML can have only one child + Q_MOC_INCLUDE(<QtQuick/qquickitem.h>) + public: explicit QQuickMessageDialog(QObject *parent = 0); ~QQuickMessageDialog(); diff --git a/src/extras/Styles/Flat/qquicktexthandle.cpp b/src/extras/Styles/Flat/qquicktexthandle.cpp index 48a73b18..41854292 100644 --- a/src/extras/Styles/Flat/qquicktexthandle.cpp +++ b/src/extras/Styles/Flat/qquicktexthandle.cpp @@ -42,6 +42,8 @@ #include <QPainterPath> +#include <QtGui/qpainterpath.h> + QQuickTextHandle::QQuickTextHandle(QQuickItem *parent) : QQuickPaintedItem(parent) { diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index bccac8d2..01ebbf79 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -155,12 +155,12 @@ TestCase { } function test_validator() { - var comboBox = Qt.createQmlObject('import QtQuick 2.2; \ + var comboBox = Qt.createQmlObject('import QtQuick 2.14; \ import QtQuick.Controls 1.2; \ ComboBox { \ editable: true; \ - validator: RegExpValidator { \ - regExp: /(red|blue|green)?/ \ + validator: RegularExpressionValidator { \ + regularExpression: /(red|blue|green)?/ \ }}', testCase, '') comboBox.editText = "blu" diff --git a/tests/auto/controls/data/tst_textfield.qml b/tests/auto/controls/data/tst_textfield.qml index 64b3fad0..111d01b4 100644 --- a/tests/auto/controls/data/tst_textfield.qml +++ b/tests/auto/controls/data/tst_textfield.qml @@ -141,7 +141,7 @@ TestCase { } function test_validator() { - var textfield = Qt.createQmlObject('import QtQuick 2.2; import QtQuick.Controls 1.2; TextField {validator: RegExpValidator { regExp: /(red|blue|green)?/; }}', testCase, '') + var textfield = Qt.createQmlObject('import QtQuick 2.14; import QtQuick.Controls 1.2; TextField {validator: RegularExpressionValidator { regularExpression: /(red|blue|green)?/; }}', testCase, '') textfield.text = "blu" compare(textfield.acceptableInput, false) |