diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-24 20:01:44 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-24 20:14:23 +0200 |
commit | 60319de8e8023d75411fde05ff11d176874cf5b9 (patch) | |
tree | a551cb5ed4e473ec9b6db9f11927315067898e2c /src | |
parent | 34fbd06f1b678375817badf33e87a43705c8d8f7 (diff) | |
parent | 94c78ddf7ddea751a8e816d26f341d54184056c6 (diff) | |
download | qtquickcontrols-60319de8e8023d75411fde05ff11d176874cf5b9.tar.gz |
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I2ee8bf8c1b79386c88134c985e5ef5751f38c054
Diffstat (limited to 'src')
34 files changed, 105 insertions, 220 deletions
diff --git a/src/controls/Label.qml b/src/controls/Label.qml index 47db7389..f9bc8cdd 100644 --- a/src/controls/Label.qml +++ b/src/controls/Label.qml @@ -84,13 +84,9 @@ Text { */ id: label - color: pal.windowText + color: SystemPaletteSingleton.windowText(enabled) activeFocusOnTab: false renderType: Settings.isMobile ? Text.QtRendering : Text.NativeRendering - SystemPalette { - id: pal - colorGroup: enabled ? SystemPalette.Active : SystemPalette.Disabled - } Accessible.name: text Accessible.role: Accessible.StaticText } diff --git a/src/controls/Private/EditMenu.qml b/src/controls/Private/EditMenu.qml index e32293d8..843ccb00 100644 --- a/src/controls/Private/EditMenu.qml +++ b/src/controls/Private/EditMenu.qml @@ -79,7 +79,7 @@ Loader { sourceComponent = style.__editMenu; else { // todo: get ios/android/base menus from style as well - source = (Qt.resolvedUrl(Qt.platform.os === "ios" ? "EditMenu_ios.qml" + source = (Qt.resolvedUrl(Qt.platform.os === "ios" ? "" : Qt.platform.os === "android" ? "" : "EditMenu_base.qml")); } } diff --git a/src/controls/Private/EditMenu_ios.qml b/src/controls/Private/EditMenu_ios.qml deleted file mode 100644 index bf347640..00000000 --- a/src/controls/Private/EditMenu_ios.qml +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** 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 The Qt Company. For licensing terms -** 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. -** -** 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. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Controls.Private 1.0 - -Item { - anchors.fill: parent - property bool __showMenuFromTouch: false - - property Component defaultMenu: Menu { - /* iOS plugin will automatically populate edit menus with standard edit actions */ - } - - Connections { - target: mouseArea - - onClicked: { - var pos = input.positionAt(mouse.x, mouse.y); - var posMoved = (pos !== input.cursorPosition); - var popupVisible = (control.menu && getMenuInstance().__popupVisible); - - if (!input.activeFocus) - input.activate(); - else if (!popupVisible && !posMoved) - __showMenuFromTouch = true; - - input.moveHandles(pos, pos) - menuTimer.start(); - } - - onPressAndHold: { - __showMenuFromTouch = true; - menuTimer.start(); - } - - } - - Connections { - target: cursorHandle ? cursorHandle : null - ignoreUnknownSignals: true - onPressedChanged: menuTimer.start() - } - - Connections { - target: selectionHandle ? selectionHandle : null - ignoreUnknownSignals: true - onPressedChanged: menuTimer.start() - } - - Connections { - target: flickable - ignoreUnknownSignals: true - onMovingChanged: menuTimer.start() - } - - Connections { - id: selectionConnections - target: input - ignoreUnknownSignals: true - onSelectionStartChanged: menuTimer.start() - onSelectionEndChanged: menuTimer.start() - onActiveFocusChanged: menuTimer.start() - } - - Timer { - // We use a timer so that we end up with one update when multiple connections fire at the same time. - // Basically we wan't the menu to be open if the user does a press and hold, or if we have a selection. - // The exceptions are if the user is moving selection handles or otherwise touching the screen (e.g flicking). - // What is currently missing are showing a magnifyer to place the cursor, and to reshow the edit menu when - // flicking stops. - id: menuTimer - interval: 1 - onTriggered: { - if (!control.menu) - return; - - if ((__showMenuFromTouch || selectionStart !== selectionEnd) - && control.activeFocus - && (!cursorHandle.pressed && !selectionHandle.pressed) - && (!flickable || !flickable.moving) - && (cursorHandle.delegate)) { - var p1 = input.positionToRectangle(input.selectionStart); - var p2 = input.positionToRectangle(input.selectionEnd); - var topLeft = input.mapToItem(null, p1.x, p1.y); - var size = Qt.size(p2.x - p1.x + p1.width, p2.y - p1.y + p1.height) - var targetRect = Qt.rect(topLeft.x, topLeft.y, size.width, size.height); - getMenuInstance().__dismissMenu(); - getMenuInstance().__popup(targetRect, -1, MenuPrivate.EditMenu); - __showMenuFromTouch = false; - } else { - getMenuInstance().__dismissMenu(); - } - } - } -} diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index 24d1fc53..74913fb8 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -63,7 +63,6 @@ PRIVATE_QML_FILES += \ $$PWD/TextInputWithHandles.qml \ $$PWD/EditMenu.qml \ $$PWD/EditMenu_base.qml \ - $$PWD/EditMenu_ios.qml \ $$PWD/ToolMenuButton.qml \ $$PWD/BasicTableView.qml \ $$PWD/TableViewItemDelegateLoader.qml \ diff --git a/src/controls/Private/qmldir b/src/controls/Private/qmldir index 34e3c0f0..9fe84203 100644 --- a/src/controls/Private/qmldir +++ b/src/controls/Private/qmldir @@ -31,7 +31,6 @@ TextHandle 1.0 TextHandle.qml TextInputWithHandles 1.0 TextInputWithHandles.qml EditMenu 1.0 EditMenu.qml EditMenu_base 1.0 EditMenu_base.qml -EditMenu_ios 1.0 EditMenu_ios.qml ToolMenuButton 1.0 ToolMenuButton.qml BasicTableView 1.0 BasicTableView.qml TableViewItemDelegateLoader 1.0 TableViewItemDelegateLoader.qml diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index 32efd332..dfab577e 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -47,7 +47,7 @@ #include <QTouchDevice> #include <QGuiApplication> #include <QStyleHints> -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) +#if defined(Q_OS_ANDROID) #include <private/qjnihelpers_p.h> #endif @@ -59,7 +59,7 @@ static QString defaultStyleName() #if defined(QT_WIDGETS_LIB) && !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) && !defined(Q_OS_QNX) && !defined(Q_OS_WINRT) if (QCoreApplication::instance()->inherits("QApplication")) return QLatin1String("Desktop"); -#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) +#elif defined(Q_OS_ANDROID) if (QtAndroidPrivate::androidSdkVersion() >= 11) return QLatin1String("Android"); #elif defined(Q_OS_IOS) @@ -70,9 +70,17 @@ static QString defaultStyleName() return QLatin1String("Base"); } +static QString styleEnvironmentVariable() +{ + QString style = qgetenv("QT_QUICK_CONTROLS_1_STYLE"); + if (style.isEmpty()) + style = qgetenv("QT_QUICK_CONTROLS_STYLE"); + return style; +} + static QString styleImportName() { - QString name = qgetenv("QT_QUICK_CONTROLS_STYLE"); + QString name = styleEnvironmentVariable(); if (name.isEmpty()) name = defaultStyleName(); return QFileInfo(name).fileName(); @@ -85,16 +93,11 @@ static bool fromResource(const QString &path) bool QQuickControlSettings1::hasTouchScreen() const { -// QTBUG-36007 -#if defined(Q_OS_ANDROID) - return true; -#else const auto devices = QTouchDevice::devices(); for (const QTouchDevice *dev : devices) if (dev->type() == QTouchDevice::TouchScreen) return true; return false; -#endif } bool QQuickControlSettings1::isMobile() const @@ -174,7 +177,7 @@ static QString relativeStyleImportPath(QQmlEngine *engine, const QString &styleN static QString styleImportPath(QQmlEngine *engine, const QString &styleName) { - QString path = qgetenv("QT_QUICK_CONTROLS_STYLE"); + QString path = styleEnvironmentVariable(); QFileInfo info(path); if (fromResource(path)) { path = info.path(); @@ -209,7 +212,7 @@ QQuickControlSettings1::QQuickControlSettings1(QQmlEngine *engine) m_name = styleImportName(); // If the style name is a path.. - const QString styleNameFromEnvVar = qgetenv("QT_QUICK_CONTROLS_STYLE"); + const QString styleNameFromEnvVar = styleEnvironmentVariable(); if (QFile::exists(styleNameFromEnvVar)) { StyleData styleData; styleData.m_styleDirPath = styleNameFromEnvVar; diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp index 79fba8be..4f6aec08 100644 --- a/src/controls/Private/qquickstyleitem.cpp +++ b/src/controls/Private/qquickstyleitem.cpp @@ -277,13 +277,44 @@ QQuickStyleItem1::QQuickStyleItem1(QQuickItem *parent) QQuickStyleItem1::~QQuickStyleItem1() { - delete m_styleoption; + if (const QStyleOptionButton *aux = qstyleoption_cast<const QStyleOptionButton*>(m_styleoption)) + delete aux; + else if (const QStyleOptionViewItem *aux = qstyleoption_cast<const QStyleOptionViewItem*>(m_styleoption)) + delete aux; + else if (const QStyleOptionHeader *aux = qstyleoption_cast<const QStyleOptionHeader*>(m_styleoption)) + delete aux; + else if (const QStyleOptionToolButton *aux = qstyleoption_cast<const QStyleOptionToolButton*>(m_styleoption)) + delete aux; + else if (const QStyleOptionToolBar *aux = qstyleoption_cast<const QStyleOptionToolBar*>(m_styleoption)) + delete aux; + else if (const QStyleOptionTab *aux = qstyleoption_cast<const QStyleOptionTab*>(m_styleoption)) + delete aux; + else if (const QStyleOptionFrame *aux = qstyleoption_cast<const QStyleOptionFrame*>(m_styleoption)) + delete aux; + else if (const QStyleOptionFocusRect *aux = qstyleoption_cast<const QStyleOptionFocusRect*>(m_styleoption)) + delete aux; + else if (const QStyleOptionTabWidgetFrame *aux = qstyleoption_cast<const QStyleOptionTabWidgetFrame*>(m_styleoption)) + delete aux; + else if (const QStyleOptionMenuItem *aux = qstyleoption_cast<const QStyleOptionMenuItem*>(m_styleoption)) + delete aux; + else if (const QStyleOptionComboBox *aux = qstyleoption_cast<const QStyleOptionComboBox*>(m_styleoption)) + delete aux; + else if (const QStyleOptionSpinBox *aux = qstyleoption_cast<const QStyleOptionSpinBox*>(m_styleoption)) + delete aux; + else if (const QStyleOptionSlider *aux = qstyleoption_cast<const QStyleOptionSlider*>(m_styleoption)) + delete aux; + else if (const QStyleOptionProgressBar *aux = qstyleoption_cast<const QStyleOptionProgressBar*>(m_styleoption)) + delete aux; + else if (const QStyleOptionGroupBox *aux = qstyleoption_cast<const QStyleOptionGroupBox*>(m_styleoption)) + delete aux; + else + delete m_styleoption; + m_styleoption = 0; } void QQuickStyleItem1::initStyleOption() { - QString type = elementType(); if (m_styleoption) m_styleoption->state = 0; diff --git a/src/controls/Styles/Android/plugin.cpp b/src/controls/Styles/Android/plugin.cpp index 5656b83d..646fff36 100644 --- a/src/controls/Styles/Android/plugin.cpp +++ b/src/controls/Styles/Android/plugin.cpp @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE class QtQuickControls1AndroidStylePlugin: public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuickControls1AndroidStylePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } diff --git a/src/controls/Styles/Base/DialStyle.qml b/src/controls/Styles/Base/DialStyle.qml index 68409938..95172455 100644 --- a/src/controls/Styles/Base/DialStyle.qml +++ b/src/controls/Styles/Base/DialStyle.qml @@ -154,10 +154,6 @@ Style { the style's components. For example, it can be used to calculate the angles at which to draw an arc around the dial indicating the safe range of values. - - For example, if minimumValueAngle is set to \c 270 and - maximumValueAngle is set to \c 90, this function will return \c 270 - when passed minimumValue and \c 90 when passed maximumValue. */ function valueToAngle(value) { return control.__panel.circularTickmarkLabel.valueToAngle(value); diff --git a/src/controls/Styles/iOS/CursorDelegate.qml b/src/controls/Styles/iOS/CursorDelegate.qml index cf35e35d..5312398c 100644 --- a/src/controls/Styles/iOS/CursorDelegate.qml +++ b/src/controls/Styles/iOS/CursorDelegate.qml @@ -61,10 +61,14 @@ Rectangle { Timer { id: timer - running: cursor.visible + running: cursor.visible && Qt.styleHints.cursorFlashTime >= 2 repeat: true - interval: 500 + interval: Qt.styleHints.cursorFlashTime / 2 onTriggered: cursor.state = cursor.state == "on" ? "off" : "on" + onRunningChanged: { + if (!running) + cursor.state = "on" + } } states: [ diff --git a/src/controls/Styles/iOS/TextAreaStyle.qml b/src/controls/Styles/iOS/TextAreaStyle.qml index 8e2efb2b..5a52ff80 100644 --- a/src/controls/Styles/iOS/TextAreaStyle.qml +++ b/src/controls/Styles/iOS/TextAreaStyle.qml @@ -51,7 +51,5 @@ ScrollViewStyle { property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" property int renderType: Text.QtRendering - property Component __selectionHandle: SelectionHandleStyle{} - property Component __cursorHandle: CursorHandleStyle{} property Component __cursorDelegate: CursorDelegate{} } diff --git a/src/controls/Styles/iOS/TextFieldStyle.qml b/src/controls/Styles/iOS/TextFieldStyle.qml index 2ed0e004..34a227c0 100644 --- a/src/controls/Styles/iOS/TextFieldStyle.qml +++ b/src/controls/Styles/iOS/TextFieldStyle.qml @@ -42,7 +42,5 @@ import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.3 TextFieldStyle { - __selectionHandle: SelectionHandleStyle{} - __cursorHandle: CursorHandleStyle{} __cursorDelegate: CursorDelegate{} } diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 239b933c..89877314 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -780,7 +780,7 @@ ScrollView { wrapMode: TextEdit.WordWrap textMargin: __style && __style.textMargin !== undefined ? __style.textMargin : 4 - selectByMouse: area.selectByMouse && (!Settings.isMobile || !cursorHandle.delegate || !selectionHandle.delegate) + selectByMouse: area.selectByMouse && Qt.platform.os != "ios" && (!Settings.isMobile || !cursorHandle.delegate || !selectionHandle.delegate) readOnly: false Keys.forwardTo: area diff --git a/src/controls/doc/qtquickcontrols.qdocconf b/src/controls/doc/qtquickcontrols.qdocconf index 6ea7e741..9aada9f6 100644 --- a/src/controls/doc/qtquickcontrols.qdocconf +++ b/src/controls/doc/qtquickcontrols.qdocconf @@ -39,9 +39,9 @@ depends = qtcore qtdoc qtgui qtwidgets qtqml qtquick qtquicklayouts qtquickdialo # Specify the install path under QT_INSTALL_EXAMPLES # Examples will be installed under quick/controls - 'controls' subdirectory # is given as part of \example commands -exampledirs += ../../../examples/quick/controls \ +exampledirs += ../../../examples/quickcontrols/controls \ snippets -examplesinstallpath = qtquickcontrols/quick/controls +examplesinstallpath = quickcontrols/controls headerdirs += .. @@ -56,7 +56,7 @@ sources += ../Private/AbstractCheckable.qml \ ../Private/Control.qml \ ../Private/qquickstyleitem.cpp \ ../Private/Style.qml \ - ../Private/qquickabstractstyle.h \ + ../Private/qquickabstractstyle_p.h \ ../Private/qquickabstractstyle.cpp excludefiles += ../TableView.qml \ diff --git a/src/controls/doc/src/qtquickcontrols-examples.qdoc b/src/controls/doc/src/qtquickcontrols-examples.qdoc index e88cd93b..749efc32 100644 --- a/src/controls/doc/src/qtquickcontrols-examples.qdoc +++ b/src/controls/doc/src/qtquickcontrols-examples.qdoc @@ -125,20 +125,6 @@ */ /*! - \example basiclayouts - \title Qt Quick Controls - Basic Layouts Example - \ingroup qtquickcontrols_examples - \brief Demonstrates how to use layout types to arrange a UI - \image qtquickcontrols-example-basiclayouts.png - - This example shows how to easily arrange UI components into - \l{Qt Quick Layouts}{layouts} with \l{GridLayout}, \l{RowLayout}, and - \l{ColumnLayout}. - - \include examples-run.qdocinc -*/ - -/*! \example tableview \title Qt Quick Controls - Table View Example \ingroup qtquickcontrols_examples diff --git a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc index 956096d1..8a1c2ab0 100644 --- a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc +++ b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc @@ -92,17 +92,17 @@ \section2 Selecting Styles You can apply a different style to the controls by setting the - \e QT_QUICK_CONTROLS_STYLE environment variable to the name of the style. + \e QT_QUICK_CONTROLS_1_STYLE environment variable to the name of the style. For example, to use the Flat style, you can do the following: \code - QT_QUICK_CONTROLS_STYLE=Flat ./app + QT_QUICK_CONTROLS_1_STYLE=Flat ./app \endcode This can also be done in C++, using qputenv(): \code - qputenv("QT_QUICK_CONTROLS_STYLE", "Flat"); + qputenv("QT_QUICK_CONTROLS_1_STYLE", "Flat"); \endcode \section1 Styling Views diff --git a/src/controls/plugin.h b/src/controls/plugin.h index 089d752f..04fd0685 100644 --- a/src/controls/plugin.h +++ b/src/controls/plugin.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QtQuickControls1Plugin: public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuickControls1Plugin(QObject *parent = 0); void registerTypes(const char *uri); diff --git a/src/controls/qmldir b/src/controls/qmldir index 9f35da29..75f5e24c 100644 --- a/src/controls/qmldir +++ b/src/controls/qmldir @@ -4,3 +4,4 @@ classname QtQuickControls1Plugin typeinfo plugins.qmltypes designersupported depends QtQuick.Window 2.2 +depends QtQuick.Layouts 1.0 diff --git a/src/dialogs/DefaultDialogWrapper.qml b/src/dialogs/DefaultDialogWrapper.qml index 6c2cae06..b446c316 100644 --- a/src/dialogs/DefaultDialogWrapper.qml +++ b/src/dialogs/DefaultDialogWrapper.qml @@ -53,13 +53,14 @@ AbstractDialog { id: content property real spacing: 6 property real outerSpacing: 12 - property real buttonsRowImplicitWidth: minimumWidth + property real buttonsRowImplicitHeight: 0 + property real buttonsRowImplicitWidth: Screen.pixelDensity * 50 property bool buttonsInSingleRow: defaultContentItem.width >= buttonsRowImplicitWidth property real minimumHeight: implicitHeight - property real minimumWidth: Screen.pixelDensity * 50 - implicitHeight: defaultContentItem.implicitHeight + spacing + outerSpacing * 2 + buttonsRight.implicitHeight + property real minimumWidth: implicitWidth + implicitHeight: defaultContentItem.implicitHeight + spacing + outerSpacing * 2 + Math.max(buttonsRight.implicitHeight, buttonsRowImplicitHeight) implicitWidth: Math.min(root.__maximumDimension, Math.max( - defaultContentItem.implicitWidth, buttonsRowImplicitWidth, Screen.pixelDensity * 50) + outerSpacing * 2); + defaultContentItem.implicitWidth, buttonsRowImplicitWidth, Screen.pixelDensity * 50) + outerSpacing * 2) color: palette.window Keys.onPressed: { event.accepted = true @@ -85,9 +86,14 @@ AbstractDialog { left: parent.left right: parent.right top: parent.top + bottom: buttonsLeft.implicitHeight ? buttonsLeft.top : buttonsRight.top margins: content.outerSpacing + bottomMargin: buttonsLeft.implicitHeight + buttonsRight.implicitHeight > 0 ? content.spacing : 0 } - implicitHeight: childrenRect.height + implicitHeight: children.length === 1 ? children[0].implicitHeight + : (children.length ? childrenRect.height : 0) + implicitWidth: children.length === 1 ? children[0].implicitWidth + : (children.length ? childrenRect.width : 0) } Flow { @@ -138,7 +144,9 @@ AbstractDialog { function setupButtons() { buttonsLeftRepeater.model = root.__standardButtonsLeftModel() buttonsRightRepeater.model = root.__standardButtonsRightModel() - if (buttonsLeftRepeater.count + buttonsRightRepeater.count < 2) + if (buttonsRightRepeater.model && buttonsRightRepeater.model.length > 0) + content.buttonsRowImplicitHeight = buttonsRight.visibleChildren[0].implicitHeight + if (buttonsLeftRepeater.count + buttonsRightRepeater.count < 1) return; var calcWidth = 0; @@ -153,7 +161,7 @@ AbstractDialog { for (var i = 0; i < buttonsRight.visibleChildren.length; ++i) calculateForButton(i, buttonsRight.visibleChildren[i]) - content.minimumWidth = calcWidth + content.outerSpacing * 2 + content.minimumWidth = Math.max(calcWidth + content.outerSpacing * 2, content.implicitWidth) for (i = 0; i < buttonsLeft.visibleChildren.length; ++i) calculateForButton(i, buttonsLeft.visibleChildren[i]) content.buttonsRowImplicitWidth = calcWidth + content.spacing diff --git a/src/dialogs/Private/dialogsprivateplugin.cpp b/src/dialogs/Private/dialogsprivateplugin.cpp index e9b39e05..ba8aabe3 100644 --- a/src/dialogs/Private/dialogsprivateplugin.cpp +++ b/src/dialogs/Private/dialogsprivateplugin.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QtQuick2DialogsPrivatePlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2DialogsPrivatePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } diff --git a/src/dialogs/doc/qtquickdialogs.qdocconf b/src/dialogs/doc/qtquickdialogs.qdocconf index 30f3635a..ccb555a7 100644 --- a/src/dialogs/doc/qtquickdialogs.qdocconf +++ b/src/dialogs/doc/qtquickdialogs.qdocconf @@ -24,9 +24,9 @@ qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.sortPages = true depends = qtqml qtquick qtgui qtwidgets qtdoc qtcore -exampledirs += ../../../examples/quick/dialogs +exampledirs += ../../../examples/quickcontrols/dialogs -examplesinstallpath = qtquickcontrols/quick/dialogs +examplesinstallpath = quickcontrols/dialogs headerdirs += .. diff --git a/src/dialogs/doc/src/qtquickdialogs-index.qdoc b/src/dialogs/doc/src/qtquickdialogs-index.qdoc index a094a27a..0adf28af 100644 --- a/src/dialogs/doc/src/qtquickdialogs-index.qdoc +++ b/src/dialogs/doc/src/qtquickdialogs-index.qdoc @@ -26,12 +26,6 @@ ****************************************************************************/ /*! - \group dialogs - \brief Dialog components - \title Dialogs -*/ - -/*! \page qtquickdialogs-index.html \title Qt Quick Dialogs @@ -41,7 +35,7 @@ \section1 Dialogs - \annotatedlist dialogs + \annotatedlist qtquickdialogs \section1 Related information diff --git a/src/dialogs/plugin.cpp b/src/dialogs/plugin.cpp index 1ab6b581..23eeac38 100644 --- a/src/dialogs/plugin.cpp +++ b/src/dialogs/plugin.cpp @@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE class QtQuick2DialogsPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2DialogsPlugin() : QQmlExtensionPlugin(), m_useResources(true) { initResources(); } diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp index afc27b77..65237652 100644 --- a/src/dialogs/qquickabstractdialog.cpp +++ b/src/dialogs/qquickabstractdialog.cpp @@ -138,7 +138,7 @@ void QQuickAbstractDialog::setVisible(bool v) m_dialogWindow->setMinimumSize(minSize); connect(win, SIGNAL(widthChanged(int)), this, SLOT(windowGeometryChanged())); connect(win, SIGNAL(heightChanged(int)), this, SLOT(windowGeometryChanged())); - qCDebug(lcWindow) << "created window" << win; + qCDebug(lcWindow) << "created window" << win << "with min size" << win->minimumSize() << "geometry" << win->geometry(); } if (!m_dialogWindow) { @@ -282,16 +282,21 @@ void QQuickAbstractDialog::windowGeometryChanged() void QQuickAbstractDialog::minimumWidthChanged() { qreal min = m_contentItem->property("minimumWidth").toReal(); + qreal implicitOrMin = qMax(m_contentItem->implicitWidth(), min); qCDebug(lcWindow) << "content implicitWidth" << m_contentItem->implicitWidth() << "minimumWidth" << min; - m_dialogWindow->setMinimumWidth(qMax(m_contentItem->implicitWidth(), min)); + if (m_dialogWindow->width() < implicitOrMin) + m_dialogWindow->setWidth(implicitOrMin); + m_dialogWindow->setMinimumWidth(implicitOrMin); } void QQuickAbstractDialog::minimumHeightChanged() { qreal min = m_contentItem->property("minimumHeight").toReal(); + qreal implicitOrMin = qMax(m_contentItem->implicitHeight(), min); qCDebug(lcWindow) << "content implicitHeight" << m_contentItem->implicitHeight() << "minimumHeight" << min; - m_dialogWindow->setMinimumHeight(qMax(m_contentItem->implicitHeight(), - m_contentItem->property("minimumHeight").toReal())); + if (m_dialogWindow->height() < implicitOrMin) + m_dialogWindow->setHeight(implicitOrMin); + m_dialogWindow->setMinimumHeight(implicitOrMin); } void QQuickAbstractDialog::implicitHeightChanged() diff --git a/src/dialogs/qquickdialog.cpp b/src/dialogs/qquickdialog.cpp index c6f50df0..33e3b02b 100644 --- a/src/dialogs/qquickdialog.cpp +++ b/src/dialogs/qquickdialog.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE \qmltype Dialog \instantiates QQuickDialog \inqmlmodule QtQuick.Dialogs - \ingroup dialogs + \ingroup qtquickdialogs \brief A generic QtQuick dialog wrapper with standard buttons. \since 5.3 diff --git a/src/dialogs/qquickplatformcolordialog.cpp b/src/dialogs/qquickplatformcolordialog.cpp index d10c444e..c002f322 100644 --- a/src/dialogs/qquickplatformcolordialog.cpp +++ b/src/dialogs/qquickplatformcolordialog.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE \qmltype ColorDialog \instantiates QQuickPlatformColorDialog \inqmlmodule QtQuick.Dialogs - \ingroup dialogs + \ingroup qtquickdialogs \brief Dialog component for choosing a color. \since 5.1 diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp index fe51cc48..d70c44d9 100644 --- a/src/dialogs/qquickplatformfiledialog.cpp +++ b/src/dialogs/qquickplatformfiledialog.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE \qmltype FileDialog \instantiates QQuickPlatformFileDialog \inqmlmodule QtQuick.Dialogs - \ingroup dialogs + \ingroup qtquickdialogs \brief Dialog component for choosing files from a local filesystem. \since 5.1 diff --git a/src/dialogs/qquickplatformfontdialog.cpp b/src/dialogs/qquickplatformfontdialog.cpp index eb29fd0b..247e869e 100644 --- a/src/dialogs/qquickplatformfontdialog.cpp +++ b/src/dialogs/qquickplatformfontdialog.cpp @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE \instantiates QQuickPlatformFontDialog \inqmlmodule QtQuick.Dialogs \ingroup qtquick-visual - \ingroup dialogs + \ingroup qtquickdialogs \brief Dialog component for choosing a font. \since 5.2 diff --git a/src/dialogs/qquickplatformmessagedialog.cpp b/src/dialogs/qquickplatformmessagedialog.cpp index fcf30b2d..2e3afa48 100644 --- a/src/dialogs/qquickplatformmessagedialog.cpp +++ b/src/dialogs/qquickplatformmessagedialog.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE \qmltype MessageDialog \instantiates QQuickPlatformMessageDialog \inqmlmodule QtQuick.Dialogs - \ingroup dialogs + \ingroup qtquickdialogs \brief Dialog component for displaying popup messages. \since 5.2 diff --git a/src/extras/Private/qquickmousethief_p.h b/src/extras/Private/qquickmousethief_p.h index 80f0d0ea..6f289ff6 100644 --- a/src/extras/Private/qquickmousethief_p.h +++ b/src/extras/Private/qquickmousethief_p.h @@ -41,6 +41,7 @@ #define MOUSETHIEF_H #include <QObject> +#include <QPointer> #include <QtQuick/QQuickItem> class QQuickMouseThief : public QObject @@ -81,7 +82,7 @@ private: void emitReleased(const QPointF &pos); void emitClicked(const QPointF &pos); - QQuickItem *mItem; + QPointer<QQuickItem> mItem; bool mReceivedPressEvent; bool mAcceptCurrentEvent; }; diff --git a/src/extras/Styles/Flat/flatstyleplugin.h b/src/extras/Styles/Flat/flatstyleplugin.h index 0e372439..80261e14 100644 --- a/src/extras/Styles/Flat/flatstyleplugin.h +++ b/src/extras/Styles/Flat/flatstyleplugin.h @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE class QtQuickExtrasStylesPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: explicit QtQuickExtrasStylesPlugin(QObject *parent = 0); diff --git a/src/extras/doc/qtquickextras.qdocconf b/src/extras/doc/qtquickextras.qdocconf index 747465fc..5c4dc472 100644 --- a/src/extras/doc/qtquickextras.qdocconf +++ b/src/extras/doc/qtquickextras.qdocconf @@ -29,8 +29,8 @@ qhp.QtQuickExtras.subprojects.qtquickextrasexamples.sortPages = true depends = qtqml qtquick qtdoc qtquickcontrols qtgui -exampledirs += ../../../examples/quick/extras -examplesinstallpath = qtquickcontrols/quick/extras +exampledirs += ../../../examples/quickcontrols/extras +examplesinstallpath = quickcontrols/extras headerdirs += ../ diff --git a/src/extras/plugin.h b/src/extras/plugin.h index 9f9e15d8..05855f49 100644 --- a/src/extras/plugin.h +++ b/src/extras/plugin.h @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE class QtQuickExtrasPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: explicit QtQuickExtrasPlugin(QObject *parent = 0); diff --git a/src/widgets/widgetsplugin.cpp b/src/widgets/widgetsplugin.cpp index cb4fe8f8..9ed0e6bc 100644 --- a/src/widgets/widgetsplugin.cpp +++ b/src/widgets/widgetsplugin.cpp @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE class QtQuick2PrivateWidgetsPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2PrivateWidgetsPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } |