diff options
Diffstat (limited to 'src')
2757 files changed, 0 insertions, 173733 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index deb79c7b..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from src.pro. - -add_subdirectory(quicktemplates2) -add_subdirectory(quickcontrols2impl) -add_subdirectory(quickcontrols2) -add_subdirectory(quickdialogs2) -add_subdirectory(quicknativestyle) -add_subdirectory(labs) diff --git a/src/labs/CMakeLists.txt b/src/labs/CMakeLists.txt deleted file mode 100644 index 72b278fe..00000000 --- a/src/labs/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(platform) - diff --git a/src/labs/platform/CMakeLists.txt b/src/labs/platform/CMakeLists.txt deleted file mode 100644 index 7fc542d3..00000000 --- a/src/labs/platform/CMakeLists.txt +++ /dev/null @@ -1,89 +0,0 @@ -##################################################################### -## qtlabsplatformplugin Plugin: -##################################################################### - -qt_internal_add_qml_module(qtlabsplatformplugin - URI "Qt.labs.platform" - VERSION "1.1" - CLASS_NAME QtLabsPlatformPlugin - PLUGIN_TARGET qtlabsplatformplugin - NO_PLUGIN_OPTIONAL - NO_GENERATE_PLUGIN_SOURCE - SOURCES - qquickplatformcolordialog.cpp qquickplatformcolordialog_p.h - qquickplatformdialog.cpp qquickplatformdialog_p.h - qquickplatformfiledialog.cpp qquickplatformfiledialog_p.h - qquickplatformfolderdialog.cpp qquickplatformfolderdialog_p.h - qquickplatformfontdialog.cpp qquickplatformfontdialog_p.h - qquickplatformicon.cpp qquickplatformicon_p.h - qquickplatformiconloader.cpp qquickplatformiconloader_p.h - qquickplatformmenu.cpp qquickplatformmenu_p.h - qquickplatformmenubar.cpp qquickplatformmenubar_p.h - qquickplatformmenuitem.cpp qquickplatformmenuitem_p.h - qquickplatformmenuitemgroup.cpp qquickplatformmenuitemgroup_p.h - qquickplatformmenuseparator.cpp qquickplatformmenuseparator_p.h - qquickplatformmessagedialog.cpp qquickplatformmessagedialog_p.h - qquickplatformstandardpaths.cpp qquickplatformstandardpaths_p.h - qtlabsplatformplugin.cpp - DEFINES - QT_NO_CAST_FROM_ASCII - QT_NO_CAST_TO_ASCII - LIBRARIES - Qt::CorePrivate - Qt::GuiPrivate - Qt::QmlPrivate - Qt::QuickPrivate - Qt::QuickTemplates2Private -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets - SOURCES - widgets/qwidgetplatform_p.h - LIBRARIES - Qt::Widgets -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_systemtrayicon AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformsystemtrayicon.cpp widgets/qwidgetplatformsystemtrayicon_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND (QT_FEATURE_colordialog OR QT_FEATURE_filedialog OR QT_FEATURE_fontdialog OR QT_FEATURE_messagebox) - SOURCES - widgets/qwidgetplatformdialog.cpp widgets/qwidgetplatformdialog_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_colordialog AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformcolordialog.cpp widgets/qwidgetplatformcolordialog_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_filedialog AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformfiledialog.cpp widgets/qwidgetplatformfiledialog_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_fontdialog AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformfontdialog.cpp widgets/qwidgetplatformfontdialog_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_menu AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformmenu.cpp widgets/qwidgetplatformmenu_p.h - widgets/qwidgetplatformmenuitem.cpp widgets/qwidgetplatformmenuitem_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets AND QT_FEATURE_messagebox AND TARGET Qt::Widgets # special case - SOURCES - widgets/qwidgetplatformmessagedialog.cpp widgets/qwidgetplatformmessagedialog_p.h -) - -qt_internal_extend_target(qtlabsplatformplugin CONDITION QT_FEATURE_systemtrayicon - SOURCES - qquickplatformsystemtrayicon.cpp qquickplatformsystemtrayicon_p.h -) - -qt_internal_add_docs(qtlabsplatformplugin - doc/qtlabsplatform.qdocconf -) diff --git a/src/labs/platform/doc/images/qtlabsplatform-colordialog-gtk.png b/src/labs/platform/doc/images/qtlabsplatform-colordialog-gtk.png Binary files differdeleted file mode 100644 index 12197f7f..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-colordialog-gtk.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-filedialog-gtk.png b/src/labs/platform/doc/images/qtlabsplatform-filedialog-gtk.png Binary files differdeleted file mode 100644 index 9360d747..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-filedialog-gtk.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-folderdialog-gtk.png b/src/labs/platform/doc/images/qtlabsplatform-folderdialog-gtk.png Binary files differdeleted file mode 100644 index 45f0585c..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-folderdialog-gtk.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-fontdialog-gtk.png b/src/labs/platform/doc/images/qtlabsplatform-fontdialog-gtk.png Binary files differdeleted file mode 100644 index 0c6217bd..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-fontdialog-gtk.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-menu.png b/src/labs/platform/doc/images/qtlabsplatform-menu.png Binary files differdeleted file mode 100644 index 7945b45f..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-menu.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-menubar.png b/src/labs/platform/doc/images/qtlabsplatform-menubar.png Binary files differdeleted file mode 100644 index 7faa8141..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-menubar.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-messagedialog-android.png b/src/labs/platform/doc/images/qtlabsplatform-messagedialog-android.png Binary files differdeleted file mode 100644 index 3986694f..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-messagedialog-android.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png b/src/labs/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png Binary files differdeleted file mode 100644 index b2d3cd37..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png b/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png Binary files differdeleted file mode 100644 index 670df8ed..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-message.png b/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-message.png Binary files differdeleted file mode 100644 index beaeed92..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon-message.png +++ /dev/null diff --git a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon.png b/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon.png Binary files differdeleted file mode 100644 index 2f7a851c..00000000 --- a/src/labs/platform/doc/images/qtlabsplatform-systemtrayicon.png +++ /dev/null diff --git a/src/labs/platform/doc/qtlabsplatform.qdocconf b/src/labs/platform/doc/qtlabsplatform.qdocconf deleted file mode 100644 index 54ed8204..00000000 --- a/src/labs/platform/doc/qtlabsplatform.qdocconf +++ /dev/null @@ -1,41 +0,0 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) -include($QT_INSTALL_DOCS/config/exampleurl-qtquickcontrols2.qdocconf) - -project = QtLabsPlatform -description = Qt Labs Platform Reference Documentation -version = $QT_VERSION - -qhp.projects = QtLabsPlatform - -qhp.QtLabsPlatform.file = qtlabsplatform.qhp -qhp.QtLabsPlatform.namespace = org.qt-project.qtlabsplatform.$QT_VERSION_TAG -qhp.QtLabsPlatform.virtualFolder = qtlabsplatform -qhp.QtLabsPlatform.indexTitle = Qt Labs Platform -qhp.QtLabsPlatform.indexRoot = - -qhp.QtLabsPlatform.filterAttributes = qtlabsplatform $QT_VERSION qtrefdoc -qhp.QtLabsPlatform.customFilters.Qt.name = QtLabsPlatform $QT_VERSION -qhp.QtLabsPlatform.customFilters.Qt.filterAttributes = qtlabsplatform $QT_VERSION - -qhp.QtLabsPlatform.subprojects = qmltypes -qhp.QtLabsPlatform.subprojects.qmltypes.title = QML Types -qhp.QtLabsPlatform.subprojects.qmltypes.indexTitle = Qt Labs Platform QML Types -qhp.QtLabsPlatform.subprojects.qmltypes.selectors = qmlclass -qhp.QtLabsPlatform.subprojects.qmltypes.sortPages = true - -depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickcontrols qtwidgets - -# This module has no documented C++ types, clear the module header -moduleheader = - -headerdirs += ../ -sourcedirs += ../ - -imagedirs += images - -navigation.landingpage = "Qt Labs Platform" -navigation.qmltypespage = "Qt Labs Platform QML Types" - -tagfile = qtlabsplatform.tags - -macro.labs = "\\note \\e{Types in Qt.labs modules are not guaranteed to remain compatible in future versions.}" diff --git a/src/labs/platform/doc/src/includes/widgets.qdocinc b/src/labs/platform/doc/src/includes/widgets.qdocinc deleted file mode 100644 index 44ebba6d..00000000 --- a/src/labs/platform/doc/src/includes/widgets.qdocinc +++ /dev/null @@ -1,28 +0,0 @@ -//! [1] -The Qt Labs Platform module uses Qt Widgets as a fallback on platforms that -do not have a native implementation available. Therefore, applications that -use types from the Qt Labs Platform module should link to QtWidgets and use -\l QApplication instead of \l QGuiApplication. - -To link against the QtWidgets library, add the following to your qmake project -file: - -\code -QT += widgets -\endcode - -Create an instance of \l QApplication in \c main(): - -\code -#include <QApplication> -#include <QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - return app.exec(); -} -\endcode -//! [1] diff --git a/src/labs/platform/doc/src/qt6-changes.qdoc b/src/labs/platform/doc/src/qt6-changes.qdoc deleted file mode 100644 index de1c7a29..00000000 --- a/src/labs/platform/doc/src/qt6-changes.qdoc +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtquicklabsplatform-changes-qt6.html - \title Changes to Qt Quick Labs Platform - \ingroup changes-qt-5-to-6 - \brief Migrate Qt Quick Labs Platform to Qt 6. - - Qt 6 is a result of the conscious effort to make the framework more - efficient and easy to use. - - We try to maintain compatibility for all the public APIs in each release. - Some changes were inevitable in an effort to make Qt a better framework. - - In this topic we summarize those changes in Qt Quick Labs Platform, and - provide guidance to handle them. - - \section1 The Menu type - - The deprecated \c iconName and \c iconSource properties were removed. Use - the \l {Menu::}{icon} property instead. - - \section1 The MenuItem type - - The deprecated \c iconName and \c iconSource properties were removed. Use - the \l {MenuItem::}{icon} property instead. - - \section1 The SystemTrayIcon type - - The deprecated \c iconName and \c iconSource properties were removed. Use - the \l {SystemTrayIcon::}{icon} property instead. -*/ diff --git a/src/labs/platform/doc/src/qtlabsplatform-index.qdoc b/src/labs/platform/doc/src/qtlabsplatform-index.qdoc deleted file mode 100644 index c6eff0ba..00000000 --- a/src/labs/platform/doc/src/qtlabsplatform-index.qdoc +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtlabsplatform-index.html - \title Qt Labs Platform - - \brief The experimental Qt Labs Platform module provides QML types for - native platform extensions. - - The experimental Qt Labs Platform module provides QML types for native - platform extensions. The module was introduced in Qt 5.8. - - \section1 QML Types - - \generatelist {qmltypesbymodule Qt.labs.platform} - - \labs - - \section1 Module Evolution - \l{Changes to Qt Quick Labs Platform} lists important changes in the - module API and functionality that were done for the Qt 6 series of Qt. - - \section1 Related Information - - \list - \li \l{Qt Quick} - \li \l{Qt Quick Controls} - \endlist -*/ diff --git a/src/labs/platform/doc/src/qtlabsplatform-qmltypes.qdoc b/src/labs/platform/doc/src/qtlabsplatform-qmltypes.qdoc deleted file mode 100644 index 51b7601a..00000000 --- a/src/labs/platform/doc/src/qtlabsplatform-qmltypes.qdoc +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 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 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: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \qmlmodule Qt.labs.platform 1.1 - \title Qt Labs Platform QML Types - \ingroup qmlmodules - \brief Provides QML types for native platform extensions. - - The experimental \l{Qt Labs Platform} module provides QML types for native - platform extensions. These QML types work in conjunction with \l{Qt Quick} - and \l{Qt Quick Controls}. - - The QML types can be imported into your application using the - following import statement in your .qml file: - - \qml - import Qt.labs.platform - \endqml - - \section1 QML Types - - \generatelist {qmltypesbymodule Qt.labs.platform} - - \labs - - \section1 Related Information - - \list - \li \l {Qt Quick Controls QML Types} - \endlist - - \noautolist -*/ diff --git a/src/labs/platform/platform.pri b/src/labs/platform/platform.pri deleted file mode 100644 index ec6e8616..00000000 --- a/src/labs/platform/platform.pri +++ /dev/null @@ -1,39 +0,0 @@ -HEADERS += \ - $$PWD/qquickplatformcolordialog_p.h \ - $$PWD/qquickplatformdialog_p.h \ - $$PWD/qquickplatformfiledialog_p.h \ - $$PWD/qquickplatformfolderdialog_p.h \ - $$PWD/qquickplatformfontdialog_p.h \ - $$PWD/qquickplatformicon_p.h \ - $$PWD/qquickplatformiconloader_p.h \ - $$PWD/qquickplatformmenu_p.h \ - $$PWD/qquickplatformmenubar_p.h \ - $$PWD/qquickplatformmenuitem_p.h \ - $$PWD/qquickplatformmenuitemgroup_p.h \ - $$PWD/qquickplatformmenuseparator_p.h \ - $$PWD/qquickplatformmessagedialog_p.h \ - $$PWD/qquickplatformstandardpaths_p.h - -SOURCES += \ - $$PWD/qquickplatformcolordialog.cpp \ - $$PWD/qquickplatformdialog.cpp \ - $$PWD/qquickplatformfiledialog.cpp \ - $$PWD/qquickplatformfolderdialog.cpp \ - $$PWD/qquickplatformfontdialog.cpp \ - $$PWD/qquickplatformicon.cpp \ - $$PWD/qquickplatformiconloader.cpp \ - $$PWD/qquickplatformmenu.cpp \ - $$PWD/qquickplatformmenubar.cpp \ - $$PWD/qquickplatformmenuitem.cpp \ - $$PWD/qquickplatformmenuitemgroup.cpp \ - $$PWD/qquickplatformmenuseparator.cpp \ - $$PWD/qquickplatformmessagedialog.cpp \ - $$PWD/qquickplatformstandardpaths.cpp - - -qtConfig(systemtrayicon) { - HEADERS += \ - $$PWD/qquickplatformsystemtrayicon_p.h - SOURCES += \ - $$PWD/qquickplatformsystemtrayicon.cpp -} diff --git a/src/labs/platform/qquickplatformcolordialog.cpp b/src/labs/platform/qquickplatformcolordialog.cpp deleted file mode 100644 index 04a5e079..00000000 --- a/src/labs/platform/qquickplatformcolordialog.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Labs Platform module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickplatformcolordialog_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ColorDialog - \inherits Dialog -//! \instantiates QQuickPlatformColorDialog - \inqmlmodule Qt.labs.platform - \since 5.8 - \brief A native color dialog. - - The ColorDialog type provides a QML API for native platform color dialogs. - - \image qtlabsplatform-colordialog-gtk.png - - To show a color dialog, construct an instance of ColorDialog, set the - desired properties, and call \l {Dialog::}{open()}. The \l currentColor - property can be used to determine the currently selected color in the - dialog. The \l color property is updated only after the final selection - has been made by accepting the dialog. - - \code - MenuItem { - text: "Color" - onTriggered: colorDialog.open() - } - - ColorDialog { - id: colorDialog - currentColor: document.color - } - - MyDocument { - id: document - color: colorDialog.color - } - \endcode - - \section2 Availability - - A native platform color dialog is currently available on the following platforms: - - \list - \li macOS - \li Linux (when running with the GTK+ platform theme) - \endlist - - \input includes/widgets.qdocinc 1 - - \labs -*/ - -QQuickPlatformColorDialog::QQuickPlatformColorDialog(QObject *parent) - : QQuickPlatformDialog(QPlatformTheme::ColorDialog, parent), - m_options(QColorDialogOptions::create()) -{ -} - -/*! - \qmlproperty color Qt.labs.platform::ColorDialog::color - - This property holds the final accepted color. - - Unlike the \l currentColor property, the \c color property is not updated - while the user is selecting colors in the dialog, but only after the final - selection has been made. That is, when the user has clicked \uicontrol OK - to accept a color. Alternatively, the \l {Dialog::}{accepted()} signal - can be handled to get the final selection. - - \sa currentColor, {Dialog::}{accepted()} -*/ -QColor QQuickPlatformColorDialog::color() const -{ - return m_color; -} - -void QQuickPlatformColorDialog::setColor(const QColor &color) -{ - if (m_color == color) - return; - - m_color = color; - setCurrentColor(color); - emit colorChanged(); -} - -/*! - \qmlproperty color Qt.labs.platform::ColorDialog::currentColor - - This property holds the currently selected color in the dialog. - - Unlike the \l color property, the \c currentColor property is updated - while the user is selecting colors in the dialog, even before the final - selection has been made. - - \sa color -*/ -QColor QQuickPlatformColorDialog::currentColor() const -{ - if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(handle())) - return colorDialog->currentColor(); - return m_currentColor; -} - -void QQuickPlatformColorDialog::setCurrentColor(const QColor &color) -{ - if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(handle())) - colorDialog->setCurrentColor(color); - m_currentColor = color; -} - -/*! - \qmlproperty flags Qt.labs.platform::ColorDialog::options - - This property holds the various options that affect the look and feel of the dialog. - - By default, all options are disabled. - - Options should be set before showing the dialog. Setting them while the dialog is - visible is not guaranteed to have an immediate effect on the dialog (depending on - the option and on the platform). - - Available options: - \value ColorDialog.ShowAlphaChannel Allow the user to select the alpha component of a color. - \value ColorDialog.NoButtons Don't display \uicontrol OK and \uicontrol Cancel buttons (useful for "live dialogs"). -*/ -QColorDialogOptions::ColorDialogOptions QQuickPlatformColorDialog::options() const -{ - return m_options->options(); -} - -void QQuickPlatformColorDialog::setOptions(QColorDialogOptions::ColorDialogOptions options) -{ - if (options == m_options->options()) - return; - - m_options->setOptions(options); - emit optionsChanged(); -} - -bool QQuickPlatformColorDialog::useNativeDialog() const -{ - return QQuickPlatformDialog::useNativeDialog() - && !m_options->testOption(QColorDialogOptions::DontUseNativeDialog); -} - -void QQuickPlatformColorDialog::onCreate(QPlatformDialogHelper *dialog) -{ - if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(dialog)) { - connect(colorDialog, &QPlatformColorDialogHelper::currentColorChanged, this, &QQuickPlatformColorDialog::currentColorChanged); - colorDialog->setOptions(m_options); - colorDialog->setCurrentColor(m_currentColor); - } -} - -void QQuickPlatformColorDialog::onShow(QPlatformDialogHelper *dialog) -{ - m_options->setWindowTitle(title()); - if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(dialog)) - colorDialog->setOptions(m_options); -} - -void QQuickPlatformColorDialog::accept() -{ - setColor(currentColor()); - QQuickPlatformDialog::accept(); -} - -QT_END_NAMESPACE diff --git a/src/labs/platform/qquickplatformcolordialog_p.h b/src/labs/platform/qquickplatformcolordialog_p.h deleted file mode 100644 index 1df047d9..00000000 --- a/src/labs/platform/qquickplatformcolordialog_p.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Labs Platform module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKPLATFORMCOLORDIALOG_P_H -#define QQUICKPLATFORMCOLORDIALOG_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickplatformdialog_p.h" -#include <QtGui/qcolor.h> -#include <QtQml/qqml.h> - -QT_BEGIN_NAMESPACE - -class QQuickPlatformColorDialog : public QQuickPlatformDialog -{ - Q_OBJECT - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL) - Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged FINAL) - Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL) - Q_FLAGS(QColorDialogOptions::ColorDialogOptions) - -public: - explicit QQuickPlatformColorDialog(QObject *parent = nullptr); - - QColor color() const; - void setColor(const QColor &color); - - QColor currentColor() const; - void setCurrentColor(const QColor &color); - - QColorDialogOptions::ColorDialogOptions options() const; - void setOptions(QColorDialogOptions::ColorDialogOptions options); - -Q_SIGNALS: - void colorChanged(); - void currentColorChanged(); - void optionsChanged(); - -protected: - bool useNativeDialog() const override; - void onCreate(QPlatformDialogHelper *dialog) override; - void onShow(QPlatformDialogHelper *dialog) override; - void accept() override; - -private: - QColor m_color; - QColor m_currentColor; // TODO: QColorDialogOptions::initialColor - QSharedPointer<QColorDialogOptions> m_options; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QQuickPlatformColorDialog) - -#endif // QQUICKPLATFORMCOLORDIALOG_P_H diff --git a/src/labs/platform/qquickplatformdialog.cpp b/src/labs/platform/qquickplatformdialog.cpp deleted file mode 100644 index 06a26237..00000000 --- a/src/labs/platform/qquickplatformdialog.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Labs Platform module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickplatformdialog_p.h" - -#include <QtCore/qloggingcategory.h> -#include <QtGui/private/qguiapplication_p.h> -#include <QtQuick/qquickitem.h> -#include <QtQuick/qquickwindow.h> - -#include "widgets/qwidgetplatform_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype Dialog - \inherits QtObject -//! \instantiates QQuickPlatformDialog - \inqmlmodule Qt.labs.platform - \since 5.8 - \brief The base class of native dialogs. - - The Dialog type provides common QML API for native platform dialogs. - - To show a native dialog, construct an instance of one of the concrete - Dialog implementations, set the desired properties, and call \l open(). - Dialog emits \l accepted() or \l rejected() when the user is done with - the dialog. - - \labs -*/ - -/*! - \qmlsignal void Qt.labs.platform::Dialog::accepted() - - This signal is emitted when the dialog has been accepted either - interactively or by calling \l accept(). - - \note This signal is \e not emitted when closing the dialog with \l close(). - - \sa rejected() -*/ - -/*! - \qmlsignal void Qt.labs.platform::Dialog::rejected() - - This signal is emitted when the dialog has been rejected either - interactively or by calling \l reject(). - - \note This signal is \e not emitted when closing the dialog with \l close(). - - \sa accepted() -*/ - -Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformDialogs) - -QQuickPlatformDialog::QQuickPlatformDialog(QPlatformTheme::DialogType type, QObject *parent) - : QObject(parent), - m_visible(false), - m_complete(false), - m_result(0), - m_parentWindow(nullptr), - m_flags(Qt::Dialog), - m_modality(Qt::WindowModal), - m_type(type), - m_handle(nullptr) -{ -} - -QQuickPlatformDialog::~QQuickPlatformDialog() -{ - destroy(); -} - -QPlatformDialogHelper *QQuickPlatformDialog::handle() const -{ - return m_handle; -} - -/*! - \qmldefault - \qmlproperty list<Object> Qt.labs.platform::Dialog::data - - This default property holds the list of all objects declared as children of - the dialog. -*/ -QQmlListProperty<QObject> QQuickPlatformDialog::data() -{ - return QQmlListProperty<QObject>(this, &m_data); -} - -/*! - \qmlproperty Window Qt.labs.platform::Dialog::parentWindow - - This property holds the parent window of the dialog. - - Unless explicitly set, the window is automatically resolved by iterating - the QML parent objects until a \l Window or an \l Item that has a window - is found. -*/ -QWindow *QQuickPlatformDialog::parentWindow() const -{ - return m_parentWindow; -} - -void QQuickPlatformDialog::setParentWindow(QWindow *window) -{ - if (m_parentWindow == window) - return; - - m_parentWindow = window; - emit parentWindowChanged(); -} - -/*! - \qmlproperty string Qt.labs.platform::Dialog::title - - This property holds the title of the dialog. -*/ -QString QQuickPlatformDialog::title() const -{ - return m_title; -} - -void QQuickPlatformDialog::setTitle(const QString &title) -{ - if (m_title == title) - return; - - m_title = title; - emit titleChanged(); -} - -/*! - \qmlproperty Qt::WindowFlags Qt.labs.platform::Dialog::flags - - This property holds the window flags of the dialog. The default value is \c Qt.Dialog. -*/ -Qt::WindowFlags QQuickPlatformDialog::flags() const -{ - return m_flags; -} - -void QQuickPlatformDialog::setFlags(Qt::WindowFlags flags) -{ - if (m_flags == flags) - return; - - m_flags = flags; - emit flagsChanged(); -} - -/*! - \qmlproperty Qt::WindowModality Qt.labs.platform::Dialog::modality - - This property holds the modality of the dialog. The default value is \c Qt.WindowModal. - - Available values: - \value Qt.NonModal The dialog is not modal and does not block input to other windows. - \value Qt.WindowModal The dialog is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows. - \value Qt.ApplicationModal The dialog is modal to the application and blocks input to all windows. -*/ -Qt::WindowModality QQuickPlatformDialog::modality() const -{ - return m_modality; -} - -void QQuickPlatformDialog::setModality(Qt::WindowModality modality) -{ - if (m_modality == modality) - return; - - m_modality = modality; - emit modalityChanged(); -} - -/*! - \qmlproperty bool Qt.labs.platform::Dialog::visible - - This property holds the visibility of the dialog. The default value is \c false. - - \sa open(), close() -*/ -bool QQuickPlatformDialog::isVisible() const -{ - return m_handle && m_visible; -} - -void QQuickPlatformDialog::setVisible(bool visible) -{ - if (visible) - open(); - else - close(); -} - -/*! - \qmlproperty int Qt.labs.platform::Dialog::result - - This property holds the result code. - - Standard result codes: - \value Dialog.Accepted - \value Dialog.Rejected - - \note MessageDialog sets the result to the value of the clicked standard - button instead of using the standard result codes. -*/ -int QQuickPlatformDialog::result() const -{ - return m_result; -} - -void QQuickPlatformDialog::setResult(int result) -{ - if (m_result == result) - return; - - m_result = result; - emit resultChanged(); -} - -/*! - \qmlmethod void Qt.labs.platform::Dialog::open() - - Opens the dialog. - - \sa visible, close() -*/ -void QQuickPlatformDialog::open() -{ - if (m_visible || !create()) - return; - - onShow(m_handle); - m_visible = m_handle->show(m_flags, m_modality, m_parentWindow); - if (m_visible) - emit visibleChanged(); -} - -/*! - \qmlmethod void Qt.labs.platform::Dialog::close() - - Closes the dialog. - - \sa visible, open() -*/ -void QQuickPlatformDialog::close() -{ - if (!m_handle || !m_visible) - return; - - onHide(m_handle); - m_handle->hide(); - m_visible = false; - emit visibleChanged(); -} - -/*! - \qmlmethod void Qt.labs.platform::Dialog::accept() - - Closes the dialog and emits the \l accepted() signal. - - \sa reject() -*/ -void QQuickPlatformDialog::accept() -{ - done(Accepted); -} - -/*! - \qmlmethod void Qt.labs.platform::Dialog::reject() - - Closes the dialog and emits the \l rejected() signal. - - \sa accept() -*/ -void QQuickPlatformDialog::reject() -{ - done(Rejected); -} - -/*! - \qmlmethod void Qt.labs.platform::Dialog::done(int result) - - Closes the dialog and sets the \a result. - - \sa accept(), reject(), result -*/ -void QQuickPlatformDialog::done(int result) -{ - close(); - setResult(result); - - if (result == Accepted) - emit accepted(); - else if (result == Rejected) - emit rejected(); -} - -void QQuickPlatformDialog::classBegin() -{ -} - -void QQuickPlatformDialog::componentComplete() -{ - m_complete = true; - if (!m_parentWindow) - setParentWindow(findParentWindow()); -} - -static const char *qmlTypeName(const QObject *object) -{ - return object->metaObject()->className() + qstrlen("QQuickPlatform"); -} - -bool QQuickPlatformDialog::create() -{ - if (!m_handle) { - if (useNativeDialog()) - m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformDialogHelper(m_type); - if (!m_handle) - m_handle = QWidgetPlatform::createDialog(m_type, this); - qCDebug(qtLabsPlatformDialogs) << qmlTypeName(this) << "->" << m_handle; - if (m_handle) { - onCreate(m_handle); - connect(m_handle, &QPlatformDialogHelper::accept, this, &QQuickPlatformDialog::accept); - connect(m_handle, &QPlatformDialogHelper::reject, this, &QQuickPlatformDialog::reject); - } - } - return m_handle; -} - -void QQuickPlatformDialog::destroy() -{ - delete m_handle; - m_handle = nullptr; -} - |