aboutsummaryrefslogtreecommitdiffstats
path: root/src/labs
diff options
context:
space:
mode:
Diffstat (limited to 'src/labs')
-rw-r--r--src/labs/animation/CMakeLists.txt4
-rw-r--r--src/labs/animation/qqmlanimationglobal_p.h2
-rw-r--r--src/labs/animation/qquickboundaryrule.cpp30
-rw-r--r--src/labs/animation/qquickboundaryrule_p.h26
-rw-r--r--src/labs/folderlistmodel/CMakeLists.txt4
-rw-r--r--src/labs/folderlistmodel/fileinfothread.cpp2
-rw-r--r--src/labs/folderlistmodel/fileproperty_p.h8
-rw-r--r--src/labs/folderlistmodel/qquickfolderlistmodel.cpp75
-rw-r--r--src/labs/folderlistmodel/qquickfolderlistmodel_p.h34
-rw-r--r--src/labs/folderlistmodel/qquickfolderlistmodelglobal_p.h2
-rw-r--r--src/labs/models/CMakeLists.txt4
-rw-r--r--src/labs/models/doc/src/qmllabsmodels.qdoc4
-rw-r--r--src/labs/models/qqmldelegatecomponent.cpp26
-rw-r--r--src/labs/models/qqmldelegatecomponent_p.h23
-rw-r--r--src/labs/models/qqmlmodelsglobal_p.h2
-rw-r--r--src/labs/models/qqmltablemodel.cpp2
-rw-r--r--src/labs/models/qqmltablemodel_p.h11
-rw-r--r--src/labs/models/qqmltablemodelcolumn.cpp82
-rw-r--r--src/labs/models/qqmltablemodelcolumn_p.h6
-rw-r--r--src/labs/platform/CMakeLists.txt106
-rw-r--r--src/labs/platform/doc/qtlabsplatform.qdocconf2
-rw-r--r--src/labs/platform/doc/snippets/qtlabsplatform-menu-instantiator.qml2
-rw-r--r--src/labs/platform/qquicklabsplatformcolordialog_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformdialog_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformfiledialog_p.h4
-rw-r--r--src/labs/platform/qquicklabsplatformfolderdialog_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformfontdialog_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformicon_p.h6
-rw-r--r--src/labs/platform/qquicklabsplatformiconloader_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformmenu.cpp4
-rw-r--r--src/labs/platform/qquicklabsplatformmenu_p.h12
-rw-r--r--src/labs/platform/qquicklabsplatformmenubar.cpp2
-rw-r--r--src/labs/platform/qquicklabsplatformmenubar_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformmenuitem.cpp6
-rw-r--r--src/labs/platform/qquicklabsplatformmenuitem_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformmenuitemgroup_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformmenuseparator_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformmessagedialog_p.h2
-rw-r--r--src/labs/platform/qquicklabsplatformstandardpaths_p.h4
-rw-r--r--src/labs/platform/qquicklabsplatformsystemtrayicon.cpp9
-rw-r--r--src/labs/platform/qquicklabsplatformsystemtrayicon_p.h4
-rw-r--r--src/labs/platform/widgets/qwidgetplatformfiledialog.cpp6
-rw-r--r--src/labs/platform/widgets/qwidgetplatformmessagedialog.cpp2
-rw-r--r--src/labs/platform/widgets/qwidgetplatformsystemtrayicon.cpp2
-rw-r--r--src/labs/settings/CMakeLists.txt4
-rw-r--r--src/labs/settings/qqmlsettings.cpp6
-rw-r--r--src/labs/settings/qqmlsettings_p.h4
-rw-r--r--src/labs/settings/qqmlsettingsglobal_p.h2
-rw-r--r--src/labs/sharedimage/CMakeLists.txt4
-rw-r--r--src/labs/sharedimage/qsharedimageloader.cpp2
-rw-r--r--src/labs/sharedimage/qsharedimageloader_p.h2
-rw-r--r--src/labs/sharedimage/qsharedimageprovider.cpp2
-rw-r--r--src/labs/sharedimage/qsharedimageprovider_p.h4
-rw-r--r--src/labs/sharedimage/qtlabssharedimageglobal_p.h4
-rw-r--r--src/labs/wavefrontmesh/CMakeLists.txt4
-rw-r--r--src/labs/wavefrontmesh/qqmlwavefrontmeshglobal_p.h2
-rw-r--r--src/labs/wavefrontmesh/qwavefrontmesh_p.h10
57 files changed, 304 insertions, 284 deletions
diff --git a/src/labs/animation/CMakeLists.txt b/src/labs/animation/CMakeLists.txt
index b54a4bf5e7..bf8e41b7e2 100644
--- a/src/labs/animation/CMakeLists.txt
+++ b/src/labs/animation/CMakeLists.txt
@@ -16,6 +16,4 @@ qt_internal_add_qml_module(LabsAnimation
PUBLIC_LIBRARIES
Qt::QmlPrivate
Qt::QuickPrivate
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
diff --git a/src/labs/animation/qqmlanimationglobal_p.h b/src/labs/animation/qqmlanimationglobal_p.h
index 3054c825b9..8f24f3bf7a 100644
--- a/src/labs/animation/qqmlanimationglobal_p.h
+++ b/src/labs/animation/qqmlanimationglobal_p.h
@@ -17,6 +17,6 @@
// We mean it.
//
-#include <QtLabsAnimation/private/qtlabsanimationexports_p.h>
+#include <QtLabsAnimation/qtlabsanimationexports.h>
#endif // QTLABSANIMATIONGLOBAL_P_H
diff --git a/src/labs/animation/qquickboundaryrule.cpp b/src/labs/animation/qquickboundaryrule.cpp
index 21b34f11ff..51bf5b5a8f 100644
--- a/src/labs/animation/qquickboundaryrule.cpp
+++ b/src/labs/animation/qquickboundaryrule.cpp
@@ -13,7 +13,7 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcBR, "qt.quick.boundaryrule")
+Q_STATIC_LOGGING_CATEGORY(lcBR, "qt.quick.boundaryrule")
class QQuickBoundaryReturnJob;
class QQuickBoundaryRulePrivate : public QObjectPrivate
@@ -111,7 +111,7 @@ void QQuickBoundaryReturnJob::updateState(QAbstractAnimationJob::State newState,
Note that a property cannot have more than one assigned BoundaryRule.
\sa {Animation and Transitions in Qt Quick}, {Qt Quick Examples - Animation#Behaviors}{Behavior
-example}, {Qt QML}
+example}, {Qt Qml}, {Qt Quick Examples - Pointer Handlers}
*/
QQuickBoundaryRule::QQuickBoundaryRule(QObject *parent)
@@ -129,7 +129,7 @@ QQuickBoundaryRule::~QQuickBoundaryRule()
}
/*!
- \qmlproperty bool QtQuick::BoundaryRule::enabled
+ \qmlproperty bool Qt.labs.animation::BoundaryRule::enabled
This property holds whether the rule will be enforced when the tracked
property changes value.
@@ -152,7 +152,7 @@ void QQuickBoundaryRule::setEnabled(bool enabled)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::minimum
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::minimum
This property holds the smallest unconstrained value that the property is
allowed to have. If the property is set to a smaller value, it will be
@@ -176,7 +176,7 @@ void QQuickBoundaryRule::setMinimum(qreal minimum)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::minimumOvershoot
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::minimumOvershoot
This property holds the amount that the property is allowed to be
less than \l minimum. Whenever the value is less than \l minimum
@@ -202,7 +202,7 @@ void QQuickBoundaryRule::setMinimumOvershoot(qreal minimumOvershoot)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::maximum
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::maximum
This property holds the largest unconstrained value that the property is
allowed to have. If the property is set to a larger value, it will be
@@ -226,7 +226,7 @@ void QQuickBoundaryRule::setMaximum(qreal maximum)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::maximumOvershoot
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::maximumOvershoot
This property holds the amount that the property is allowed to be
more than \l maximum. Whenever the value is greater than \l maximum
@@ -252,7 +252,7 @@ void QQuickBoundaryRule::setMaximumOvershoot(qreal maximumOvershoot)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::overshootScale
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::overshootScale
This property holds the amount by which the \l easing is scaled during the
overshoot condition. For example if an Item is restricted from moving more
@@ -284,7 +284,7 @@ void QQuickBoundaryRule::setOvershootScale(qreal overshootScale)
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::currentOvershoot
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::currentOvershoot
This property holds the amount by which the most recently set value of the
intercepted property exceeds \l maximum or is less than \l minimum.
@@ -300,7 +300,7 @@ qreal QQuickBoundaryRule::currentOvershoot() const
}
/*!
- \qmlproperty qreal QtQuick::BoundaryRule::peakOvershoot
+ \qmlproperty qreal Qt.labs.animation::BoundaryRule::peakOvershoot
This property holds the most-positive or most-negative value of
\l currentOvershoot that has been seen, until \l returnToBounds() is called.
@@ -318,7 +318,7 @@ qreal QQuickBoundaryRule::peakOvershoot() const
}
/*!
- \qmlproperty enumeration QtQuick::BoundaryRule::overshootFilter
+ \qmlproperty enumeration Qt.labs.animation::BoundaryRule::overshootFilter
This property specifies the aggregation function that will be applied to
the intercepted property value.
@@ -344,7 +344,7 @@ void QQuickBoundaryRule::setOvershootFilter(OvershootFilter overshootFilter)
}
/*!
- \qmlmethod bool QtQuick::BoundaryRule::returnToBounds
+ \qmlmethod bool Qt.labs.animation::BoundaryRule::returnToBounds
Returns the intercepted property to a value between \l minimum and
\l maximum, such that \l currentOvershoot and \l peakOvershoot are both
@@ -388,7 +388,7 @@ bool QQuickBoundaryRule::returnToBounds()
}
/*!
- \qmlsignal QtQuick::BoundaryRule::returnedToBounds()
+ \qmlsignal Qt.labs.animation::BoundaryRule::returnedToBounds()
This signal is emitted when \l currentOvershoot returns to \c 0 again,
after the \l maximum or \l minimum constraint has been violated.
@@ -399,7 +399,7 @@ bool QQuickBoundaryRule::returnToBounds()
*/
/*!
- \qmlproperty enumeration QtQuick::BoundaryRule::easing
+ \qmlproperty enumeration Qt.labs.animation::BoundaryRule::easing
This property holds the easing curve to be applied in overshoot mode
(whenever the \l minimum or \l maximum constraint is violated, while
@@ -423,7 +423,7 @@ void QQuickBoundaryRule::setEasing(const QEasingCurve &easing)
}
/*!
- \qmlproperty int QtQuick::BoundaryRule::returnDuration
+ \qmlproperty int Qt.labs.animation::BoundaryRule::returnDuration
This property holds the amount of time in milliseconds that
\l returnToBounds() will take to return the target property to the nearest bound.
diff --git a/src/labs/animation/qquickboundaryrule_p.h b/src/labs/animation/qquickboundaryrule_p.h
index a3d7e61343..c0f8f9a905 100644
--- a/src/labs/animation/qquickboundaryrule_p.h
+++ b/src/labs/animation/qquickboundaryrule_p.h
@@ -26,24 +26,24 @@ QT_BEGIN_NAMESPACE
class QQuickAbstractAnimation;
class QQuickBoundaryRulePrivate;
-class Q_LABSANIMATION_PRIVATE_EXPORT QQuickBoundaryRule : public QObject, public QQmlPropertyValueInterceptor, public QQmlParserStatus
+class Q_LABSANIMATION_EXPORT QQuickBoundaryRule : public QObject, public QQmlPropertyValueInterceptor, public QQmlParserStatus
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_DECLARE_PRIVATE(QQuickBoundaryRule)
Q_INTERFACES(QQmlPropertyValueInterceptor)
- Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
- Q_PROPERTY(qreal minimum READ minimum WRITE setMinimum NOTIFY minimumChanged)
- Q_PROPERTY(qreal minimumOvershoot READ minimumOvershoot WRITE setMinimumOvershoot NOTIFY minimumOvershootChanged)
- Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum NOTIFY maximumChanged)
- Q_PROPERTY(qreal maximumOvershoot READ maximumOvershoot WRITE setMaximumOvershoot NOTIFY maximumOvershootChanged)
- Q_PROPERTY(qreal overshootScale READ overshootScale WRITE setOvershootScale NOTIFY overshootScaleChanged)
- Q_PROPERTY(qreal currentOvershoot READ currentOvershoot NOTIFY currentOvershootChanged)
- Q_PROPERTY(qreal peakOvershoot READ peakOvershoot NOTIFY peakOvershootChanged)
- Q_PROPERTY(OvershootFilter overshootFilter READ overshootFilter WRITE setOvershootFilter NOTIFY overshootFilterChanged)
- Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
- Q_PROPERTY(int returnDuration READ returnDuration WRITE setReturnDuration NOTIFY returnDurationChanged)
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
+ Q_PROPERTY(qreal minimum READ minimum WRITE setMinimum NOTIFY minimumChanged FINAL)
+ Q_PROPERTY(qreal minimumOvershoot READ minimumOvershoot WRITE setMinimumOvershoot NOTIFY minimumOvershootChanged FINAL)
+ Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum NOTIFY maximumChanged FINAL)
+ Q_PROPERTY(qreal maximumOvershoot READ maximumOvershoot WRITE setMaximumOvershoot NOTIFY maximumOvershootChanged FINAL)
+ Q_PROPERTY(qreal overshootScale READ overshootScale WRITE setOvershootScale NOTIFY overshootScaleChanged FINAL)
+ Q_PROPERTY(qreal currentOvershoot READ currentOvershoot NOTIFY currentOvershootChanged FINAL)
+ Q_PROPERTY(qreal peakOvershoot READ peakOvershoot NOTIFY peakOvershootChanged FINAL)
+ Q_PROPERTY(OvershootFilter overshootFilter READ overshootFilter WRITE setOvershootFilter NOTIFY overshootFilterChanged FINAL)
+ Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged FINAL)
+ Q_PROPERTY(int returnDuration READ returnDuration WRITE setReturnDuration NOTIFY returnDurationChanged FINAL)
QML_NAMED_ELEMENT(BoundaryRule)
QML_ADDED_IN_VERSION(1, 0)
@@ -111,6 +111,4 @@ Q_SIGNALS:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickBoundaryRule)
-
#endif // QQUICKBOUNDARYRULE_H
diff --git a/src/labs/folderlistmodel/CMakeLists.txt b/src/labs/folderlistmodel/CMakeLists.txt
index b403097045..e0851ee203 100644
--- a/src/labs/folderlistmodel/CMakeLists.txt
+++ b/src/labs/folderlistmodel/CMakeLists.txt
@@ -19,6 +19,4 @@ qt_internal_add_qml_module(LabsFolderListModel
Qt::CorePrivate
Qt::QmlPrivate
Qt::QmlModelsPrivate
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
diff --git a/src/labs/folderlistmodel/fileinfothread.cpp b/src/labs/folderlistmodel/fileinfothread.cpp
index 7b0bea721d..aa670338de 100644
--- a/src/labs/folderlistmodel/fileinfothread.cpp
+++ b/src/labs/folderlistmodel/fileinfothread.cpp
@@ -11,7 +11,7 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcFileInfoThread, "qt.labs.folderlistmodel.fileinfothread")
+Q_STATIC_LOGGING_CATEGORY(lcFileInfoThread, "qt.labs.folderlistmodel.fileinfothread")
FileInfoThread::FileInfoThread(QObject *parent)
: QThread(parent),
diff --git a/src/labs/folderlistmodel/fileproperty_p.h b/src/labs/folderlistmodel/fileproperty_p.h
index 18b5f0918e..801d421ada 100644
--- a/src/labs/folderlistmodel/fileproperty_p.h
+++ b/src/labs/folderlistmodel/fileproperty_p.h
@@ -15,14 +15,18 @@
// We mean it.
//
-#include <QFileInfo>
-#include <QDateTime>
+#include <QtQmlIntegration/qqmlintegration.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qdatetime.h>
+
#include <private/qglobal_p.h>
QT_BEGIN_NAMESPACE
class FileProperty
{
+ Q_GADGET
+ QML_ANONYMOUS
public:
FileProperty(const QFileInfo &info) :
mFileName(info.fileName()),
diff --git a/src/labs/folderlistmodel/qquickfolderlistmodel.cpp b/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
index 64a5be796e..6b1767d7a6 100644
--- a/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
@@ -11,7 +11,7 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcFolderListModel, "qt.labs.folderlistmodel")
+Q_STATIC_LOGGING_CATEGORY(lcFolderListModel, "qt.labs.folderlistmodel")
class QQuickFolderListModelPrivate
{
@@ -232,16 +232,16 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
Components access names and paths via the following roles:
\list
- \li \c fileName
- \li \c filePath
- \li \c fileURL (since Qt 5.2; deprecated since Qt 5.15)
- \li \c fileUrl (since Qt 5.15)
- \li \c fileBaseName
- \li \c fileSuffix
- \li \c fileSize
- \li \c fileModified
- \li \c fileAccessed
- \li \c fileIsDir
+ \li \c fileName (\c string)
+ \li \c filePath (\c string)
+ \li \c fileURL (\c url) (since Qt 5.2; deprecated since Qt 5.15)
+ \li \c fileUrl (\c url) (since Qt 5.15)
+ \li \c fileBaseName (\c string)
+ \li \c fileSuffix (\c string)
+ \li \c fileSize (\c qlonglong)
+ \li \c fileModified (\c date)
+ \li \c fileAccessed (\c date)
+ \li \c fileIsDir (\c bool)
\endlist
Additionally a file entry can be differentiated from a folder entry via the
@@ -284,6 +284,7 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
Component {
id: fileDelegate
+ required property string fileName
Text { text: fileName }
}
@@ -375,6 +376,7 @@ QHash<int, QByteArray> QQuickFolderListModel::roleNames() const
/*!
\qmlproperty int FolderListModel::count
+ \readonly
Returns the number of items in the current folder that match the
filter criteria.
@@ -399,7 +401,8 @@ QModelIndex QQuickFolderListModel::index(int row, int , const QModelIndex &) con
The value must be a \c file: or \c qrc: URL, or a relative URL.
- The default value is an invalid URL.
+ The default value is the application's working directory at the time
+ when the FolderListModel is first initialized.
*/
QUrl QQuickFolderListModel::folder() const
{
@@ -474,6 +477,7 @@ void QQuickFolderListModel::setRootFolder(const QUrl &path)
/*!
\qmlproperty url FolderListModel::parentFolder
+ \readonly
Returns the URL of the parent of the current \l folder.
*/
@@ -544,15 +548,14 @@ void QQuickFolderListModel::componentComplete()
/*!
\qmlproperty enumeration FolderListModel::sortField
- The \a sortField property contains field to use for sorting. sortField
- may be one of:
- \list
- \li Unsorted - no sorting is applied.
- \li Name - sort by filename
- \li Time - sort by time modified
- \li Size - sort by file size
- \li Type - sort by file type (extension)
- \endlist
+ The \a sortField property contains the field to use for sorting.
+ \c sortField may be one of:
+
+ \value FolderListModel.Unsorted no sorting is applied
+ \value FolderListModel.Name sort by filename (default)
+ \value FolderListModel.Time sort by time modified
+ \value FolderListModel.Size sort by file size
+ \value FolderListModel.Type sort by file type/extension
\sa sortReversed
*/
@@ -800,13 +803,13 @@ void QQuickFolderListModel::setCaseSensitive(bool on)
/*!
\qmlproperty enumeration FolderListModel::status
\since 5.11
+ \readonly
This property holds the status of folder reading. It can be one of:
- \list
- \li FolderListModel.Null - no \a folder has been set
- \li FolderListModel.Ready - the folder has been loaded
- \li FolderListModel.Loading - the folder is currently being loaded
- \endlist
+
+ \value FolderListModel.Null no \a folder has been set
+ \value FolderListModel.Ready the folder has been loaded
+ \value FolderListModel.Loading the folder is currently being loaded
Use this status to provide an update or respond to the status change in some way.
For example, you could:
@@ -867,16 +870,16 @@ void QQuickFolderListModel::setSortCaseSensitive(bool on)
are available:
\list
- \li \c fileName
- \li \c filePath
- \li \c fileURL (since Qt 5.2; deprecated since Qt 5.15)
- \li \c fileUrl (since Qt 5.15)
- \li \c fileBaseName
- \li \c fileSuffix
- \li \c fileSize
- \li \c fileModified
- \li \c fileAccessed
- \li \c fileIsDir
+ \li \c fileName (\c string)
+ \li \c filePath (\c string)
+ \li \c fileURL (\c url) (since Qt 5.2; deprecated since Qt 5.15)
+ \li \c fileUrl (\c url) (since Qt 5.15)
+ \li \c fileBaseName (\c string)
+ \li \c fileSuffix (\c string)
+ \li \c fileSize (\c qlonglong)
+ \li \c fileModified (\c date)
+ \li \c fileAccessed (\c date)
+ \li \c fileIsDir (\c bool)
\endlist
*/
QVariant QQuickFolderListModel::get(int idx, const QString &property) const
diff --git a/src/labs/folderlistmodel/qquickfolderlistmodel_p.h b/src/labs/folderlistmodel/qquickfolderlistmodel_p.h
index 69a3558b43..be3dd2d2b7 100644
--- a/src/labs/folderlistmodel/qquickfolderlistmodel_p.h
+++ b/src/labs/folderlistmodel/qquickfolderlistmodel_p.h
@@ -31,29 +31,29 @@ class QModelIndex;
class QQuickFolderListModelPrivate;
//![class begin]
-class Q_LABSFOLDERLISTMODEL_PRIVATE_EXPORT QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus
+class Q_LABSFOLDERLISTMODEL_EXPORT QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
//![class begin]
//![class props]
- Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged)
- Q_PROPERTY(QUrl rootFolder READ rootFolder WRITE setRootFolder)
- Q_PROPERTY(QUrl parentFolder READ parentFolder NOTIFY folderChanged)
- Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters)
- Q_PROPERTY(SortField sortField READ sortField WRITE setSortField)
- Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed)
- Q_PROPERTY(bool showFiles READ showFiles WRITE setShowFiles REVISION(2, 1))
- Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs)
- Q_PROPERTY(bool showDirsFirst READ showDirsFirst WRITE setShowDirsFirst)
- Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot)
- Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden REVISION(2, 1))
- Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable)
- Q_PROPERTY(bool caseSensitive READ caseSensitive WRITE setCaseSensitive REVISION(2, 2))
- Q_PROPERTY(int count READ count NOTIFY countChanged)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged REVISION(2, 11))
- Q_PROPERTY(bool sortCaseSensitive READ sortCaseSensitive WRITE setSortCaseSensitive REVISION(2, 12))
+ Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
+ Q_PROPERTY(QUrl rootFolder READ rootFolder WRITE setRootFolder FINAL)
+ Q_PROPERTY(QUrl parentFolder READ parentFolder NOTIFY folderChanged FINAL)
+ Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters FINAL)
+ Q_PROPERTY(SortField sortField READ sortField WRITE setSortField FINAL)
+ Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed FINAL)
+ Q_PROPERTY(bool showFiles READ showFiles WRITE setShowFiles REVISION(2, 1) FINAL)
+ Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs FINAL)
+ Q_PROPERTY(bool showDirsFirst READ showDirsFirst WRITE setShowDirsFirst FINAL)
+ Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot FINAL)
+ Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden REVISION(2, 1) FINAL)
+ Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable FINAL)
+ Q_PROPERTY(bool caseSensitive READ caseSensitive WRITE setCaseSensitive REVISION(2, 2) FINAL)
+ Q_PROPERTY(int count READ count NOTIFY countChanged FINAL)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged REVISION(2, 11) FINAL)
+ Q_PROPERTY(bool sortCaseSensitive READ sortCaseSensitive WRITE setSortCaseSensitive REVISION(2, 12) FINAL)
//![class props]
QML_NAMED_ELEMENT(FolderListModel)
diff --git a/src/labs/folderlistmodel/qquickfolderlistmodelglobal_p.h b/src/labs/folderlistmodel/qquickfolderlistmodelglobal_p.h
index a7c4ba1879..481ffee36a 100644
--- a/src/labs/folderlistmodel/qquickfolderlistmodelglobal_p.h
+++ b/src/labs/folderlistmodel/qquickfolderlistmodelglobal_p.h
@@ -17,6 +17,6 @@
// We mean it.
//
-#include <QtLabsFolderListModel/private/qtlabsfolderlistmodelexports_p.h>
+#include <QtLabsFolderListModel/qtlabsfolderlistmodelexports.h>
#endif // QTLABSFOLDERLISTMODELGLOBAL_P_H
diff --git a/src/labs/models/CMakeLists.txt b/src/labs/models/CMakeLists.txt
index 3ff03fb0cd..0ae2d7d16e 100644
--- a/src/labs/models/CMakeLists.txt
+++ b/src/labs/models/CMakeLists.txt
@@ -15,9 +15,7 @@ qt_internal_add_qml_module(LabsQmlModels
Qt::QmlPrivate
DEPENDENCIES
QtQml.Models/auto
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
qt_internal_extend_target(LabsQmlModels CONDITION QT_FEATURE_qml_table_model
SOURCES
diff --git a/src/labs/models/doc/src/qmllabsmodels.qdoc b/src/labs/models/doc/src/qmllabsmodels.qdoc
index f5e18792ab..8c4fbb17b7 100644
--- a/src/labs/models/doc/src/qmllabsmodels.qdoc
+++ b/src/labs/models/doc/src/qmllabsmodels.qdoc
@@ -12,7 +12,7 @@
To use the types in this module, import the module with the following line:
- \code
+ \qml
import Qt.labs.qmlmodels
- \endcode
+ \endqml
*/
diff --git a/src/labs/models/qqmldelegatecomponent.cpp b/src/labs/models/qqmldelegatecomponent.cpp
index 3a9bb647c6..01dbe7e81f 100644
--- a/src/labs/models/qqmldelegatecomponent.cpp
+++ b/src/labs/models/qqmldelegatecomponent.cpp
@@ -21,7 +21,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty variant QtQml.Models::DelegateChoice::roleValue
+ \qmlproperty variant Qt.labs.qmlmodels::DelegateChoice::roleValue
This property holds the value used to match the role data for the role provided by \l DelegateChooser::role.
*/
QVariant QQmlDelegateChoice::roleValue() const
@@ -39,7 +39,7 @@ void QQmlDelegateChoice::setRoleValue(const QVariant &value)
}
/*!
- \qmlproperty int QtQml.Models::DelegateChoice::row
+ \qmlproperty int Qt.labs.qmlmodels::DelegateChoice::row
This property holds the value used to match the row value of model elements.
With models that have only the index property (and thus only one column), this property
should be intended as an index, and set to the desired index value.
@@ -51,7 +51,7 @@ void QQmlDelegateChoice::setRoleValue(const QVariant &value)
*/
/*!
- \qmlproperty int QtQml.Models::DelegateChoice::index
+ \qmlproperty int Qt.labs.qmlmodels::DelegateChoice::index
This property holds the value used to match the index value of model elements.
This is effectively an alias for \l row.
@@ -73,7 +73,7 @@ void QQmlDelegateChoice::setRow(int r)
}
/*!
- \qmlproperty int QtQml.Models::DelegateChoice::column
+ \qmlproperty int Qt.labs.qmlmodels::DelegateChoice::column
This property holds the value used to match the column value of model elements.
*/
int QQmlDelegateChoice::column() const
@@ -96,7 +96,7 @@ QQmlComponent *QQmlDelegateChoice::delegate() const
}
/*!
- \qmlproperty Component QtQml.Models::DelegateChoice::delegate
+ \qmlproperty Component Qt.labs.qmlmodels::DelegateChoice::delegate
This property holds the delegate to use if this choice matches the model item.
*/
void QQmlDelegateChoice::setDelegate(QQmlComponent *delegate)
@@ -190,9 +190,13 @@ bool QQmlDelegateChoice::match(int row, int column, const QVariant &value) const
*/
/*!
- \qmlproperty string QtQml.Models::DelegateChooser::role
+ \qmlproperty string Qt.labs.qmlmodels::DelegateChooser::role
This property holds the role or the property name used to determine the delegate for a given model item.
+ \note For \l{QAbstractItemModel} based models, including \l{ListModel}, the DelegateChooser will
+ reevaluate the choice when the model signals that the role has changed. For any other type of model,
+ this choice will only be done once when the item for a given model index is created.
+
\sa DelegateChoice
*/
void QQmlDelegateChooser::setRole(const QString &role)
@@ -204,7 +208,7 @@ void QQmlDelegateChooser::setRole(const QString &role)
}
/*!
- \qmlproperty list<DelegateChoice> QtQml.Models::DelegateChooser::choices
+ \qmlproperty list<DelegateChoice> Qt.labs.qmlmodels::DelegateChooser::choices
\qmldefault
The list of DelegateChoices for the chooser.
@@ -233,7 +237,7 @@ void QQmlDelegateChooser::choices_append(QQmlListProperty<QQmlDelegateChoice> *p
QQmlDelegateChooser *q = static_cast<QQmlDelegateChooser *>(prop->object);
q->m_choices.append(choice);
connect(choice, &QQmlDelegateChoice::changed, q, &QQmlAbstractDelegateComponent::delegateChanged);
- q->delegateChanged();
+ emit q->delegateChanged();
}
qsizetype QQmlDelegateChooser::choices_count(QQmlListProperty<QQmlDelegateChoice> *prop)
@@ -254,7 +258,7 @@ void QQmlDelegateChooser::choices_clear(QQmlListProperty<QQmlDelegateChoice> *pr
for (QQmlDelegateChoice *choice : q->m_choices)
disconnect(choice, &QQmlDelegateChoice::changed, q, &QQmlAbstractDelegateComponent::delegateChanged);
q->m_choices.clear();
- q->delegateChanged();
+ emit q->delegateChanged();
}
void QQmlDelegateChooser::choices_replace(QQmlListProperty<QQmlDelegateChoice> *prop,
@@ -266,7 +270,7 @@ void QQmlDelegateChooser::choices_replace(QQmlListProperty<QQmlDelegateChoice> *
q->m_choices[index] = choice;
connect(choice, &QQmlDelegateChoice::changed, q,
&QQmlAbstractDelegateComponent::delegateChanged);
- q->delegateChanged();
+ emit q->delegateChanged();
}
void QQmlDelegateChooser::choices_removeLast(QQmlListProperty<QQmlDelegateChoice> *prop)
@@ -274,7 +278,7 @@ void QQmlDelegateChooser::choices_removeLast(QQmlListProperty<QQmlDelegateChoice
QQmlDelegateChooser *q = static_cast<QQmlDelegateChooser *>(prop->object);
disconnect(q->m_choices.takeLast(), &QQmlDelegateChoice::changed,
q, &QQmlAbstractDelegateComponent::delegateChanged);
- q->delegateChanged();
+ emit q->delegateChanged();
}
QQmlComponent *QQmlDelegateChooser::delegate(QQmlAdaptorModel *adaptorModel, int row, int column) const
diff --git a/src/labs/models/qqmldelegatecomponent_p.h b/src/labs/models/qqmldelegatecomponent_p.h
index 254f9d0b7e..2929094fd6 100644
--- a/src/labs/models/qqmldelegatecomponent_p.h
+++ b/src/labs/models/qqmldelegatecomponent_p.h
@@ -25,14 +25,14 @@ QT_REQUIRE_CONFIG(qml_delegate_model);
QT_BEGIN_NAMESPACE
-class Q_LABSQMLMODELS_PRIVATE_EXPORT QQmlDelegateChoice : public QObject
+class Q_LABSQMLMODELS_EXPORT QQmlDelegateChoice : public QObject
{
Q_OBJECT
- Q_PROPERTY(QVariant roleValue READ roleValue WRITE setRoleValue NOTIFY roleValueChanged)
- Q_PROPERTY(int row READ row WRITE setRow NOTIFY rowChanged)
- Q_PROPERTY(int index READ row WRITE setRow NOTIFY indexChanged)
- Q_PROPERTY(int column READ column WRITE setColumn NOTIFY columnChanged)
- Q_PROPERTY(QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_PROPERTY(QVariant roleValue READ roleValue WRITE setRoleValue NOTIFY roleValueChanged FINAL)
+ Q_PROPERTY(int row READ row WRITE setRow NOTIFY rowChanged FINAL)
+ Q_PROPERTY(int index READ row WRITE setRow NOTIFY indexChanged FINAL)
+ Q_PROPERTY(int column READ column WRITE setColumn NOTIFY columnChanged FINAL)
+ Q_PROPERTY(QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
Q_CLASSINFO("DefaultProperty", "delegate")
QML_NAMED_ELEMENT(DelegateChoice)
QML_ADDED_IN_VERSION(1, 0)
@@ -67,17 +67,17 @@ private:
QQmlComponent *m_delegate = nullptr;
};
-class Q_LABSQMLMODELS_PRIVATE_EXPORT QQmlDelegateChooser : public QQmlAbstractDelegateComponent
+class Q_LABSQMLMODELS_EXPORT QQmlDelegateChooser : public QQmlAbstractDelegateComponent
{
Q_OBJECT
- Q_PROPERTY(QString role READ role WRITE setRole NOTIFY roleChanged)
- Q_PROPERTY(QQmlListProperty<QQmlDelegateChoice> choices READ choices CONSTANT)
+ Q_PROPERTY(QString role READ role WRITE setRole NOTIFY roleChanged FINAL)
+ Q_PROPERTY(QQmlListProperty<QQmlDelegateChoice> choices READ choices CONSTANT FINAL)
Q_CLASSINFO("DefaultProperty", "choices")
QML_NAMED_ELEMENT(DelegateChooser)
QML_ADDED_IN_VERSION(1, 0)
public:
- QString role() const { return m_role; }
+ QString role() const final { return m_role; }
void setRole(const QString &role);
virtual QQmlListProperty<QQmlDelegateChoice> choices();
@@ -101,7 +101,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQmlDelegateChoice)
-QML_DECLARE_TYPE(QQmlDelegateChooser)
-
#endif // QQMLDELEGATECOMPONENT_P_H
diff --git a/src/labs/models/qqmlmodelsglobal_p.h b/src/labs/models/qqmlmodelsglobal_p.h
index 9f1e325e6e..72efdfa4b5 100644
--- a/src/labs/models/qqmlmodelsglobal_p.h
+++ b/src/labs/models/qqmlmodelsglobal_p.h
@@ -17,6 +17,6 @@
// We mean it.
//
-#include <QtLabsQmlModels/private/qtlabsqmlmodelsexports_p.h>
+#include <QtLabsQmlModels/qtlabsqmlmodelsexports.h>
#endif // QTLABSQMLMODELSGLOBAL_P_H
diff --git a/src/labs/models/qqmltablemodel.cpp b/src/labs/models/qqmltablemodel.cpp
index 6b14eeaaef..adf187f225 100644
--- a/src/labs/models/qqmltablemodel.cpp
+++ b/src/labs/models/qqmltablemodel.cpp
@@ -9,7 +9,7 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcTableModel, "qt.qml.tablemodel")
+Q_STATIC_LOGGING_CATEGORY(lcTableModel, "qt.qml.tablemodel")
/*!
\qmltype TableModel
diff --git a/src/labs/models/qqmltablemodel_p.h b/src/labs/models/qqmltablemodel_p.h
index 2df813dfcd..9157c989d3 100644
--- a/src/labs/models/qqmltablemodel_p.h
+++ b/src/labs/models/qqmltablemodel_p.h
@@ -30,7 +30,7 @@ QT_REQUIRE_CONFIG(qml_table_model);
QT_BEGIN_NAMESPACE
-class Q_LABSQMLMODELS_PRIVATE_EXPORT QQmlTableModel : public QAbstractTableModel, public QQmlParserStatus
+class Q_LABSQMLMODELS_EXPORT QQmlTableModel : public QAbstractTableModel, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY(int columnCount READ columnCount NOTIFY columnCountChanged FINAL)
@@ -81,6 +81,10 @@ Q_SIGNALS:
void rowCountChanged();
void rowsChanged();
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
private:
class ColumnRoleMetadata
{
@@ -122,9 +126,6 @@ private:
void doInsert(int rowIndex, const QVariant &row);
- void classBegin() override;
- void componentComplete() override;
-
bool componentCompleted = false;
QVariantList mRows;
QList<QQmlTableModelColumn *> mColumns;
@@ -139,6 +140,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQmlTableModel)
-
#endif // QQMLTABLEMODEL_P_H
diff --git a/src/labs/models/qqmltablemodelcolumn.cpp b/src/labs/models/qqmltablemodelcolumn.cpp
index f2e6d65f87..356cad476f 100644
--- a/src/labs/models/qqmltablemodelcolumn.cpp
+++ b/src/labs/models/qqmltablemodelcolumn.cpp
@@ -18,27 +18,50 @@ QT_BEGIN_NAMESPACE
TableModelColumn supports all of \l {Qt::ItemDataRole}{Qt's roles},
with the exception of \c Qt::InitialSortOrderRole.
+ Roles can be accessed by as listed below, e.g.
+ \code
+ text: display
+
+ required property string display
+ \endcode
+
+ \table
+ \row \li Qt::DisplayRole \li display
+ \row \li Qt::DecorationRole \li decoration
+ \row \li Qt::EditRole \li edit
+ \row \li Qt::ToolTipRole \li toolTip
+ \row \li Qt::StatusTipRole \li statusTip
+ \row \li Qt::WhatsThisRole \li whatsThis
+ \row \li Qt::FontRole \li font
+ \row \li Qt::TextAlignmentRole \li textAlignment
+ \row \li Qt::BackgroundRole \li background
+ \row \li Qt::ForegroundRole \li foreground
+ \row \li Qt::CheckStateRole \li checkState
+ \row \li Qt::AccessibleTextRole \li accessibleText
+ \row \li Qt::AccessibleDescriptionRole \li accessibleDescription
+ \row \li Qt::SizeHintRole \li sizeHintRoleNam
+ \endtable
\sa TableModel, TableView
*/
-static const QString displayRoleName = QStringLiteral("display");
-static const QString decorationRoleName = QStringLiteral("decoration");
-static const QString editRoleName = QStringLiteral("edit");
-static const QString toolTipRoleName = QStringLiteral("toolTip");
-static const QString statusTipRoleName = QStringLiteral("statusTip");
-static const QString whatsThisRoleName = QStringLiteral("whatsThis");
+static constexpr QLatin1StringView displayRoleName("display");
+static constexpr QLatin1StringView decorationRoleName("decoration");
+static constexpr QLatin1StringView editRoleName("edit");
+static constexpr QLatin1StringView toolTipRoleName("toolTip");
+static constexpr QLatin1StringView statusTipRoleName("statusTip");
+static constexpr QLatin1StringView whatsThisRoleName("whatsThis");
-static const QString fontRoleName = QStringLiteral("font");
-static const QString textAlignmentRoleName = QStringLiteral("textAlignment");
-static const QString backgroundRoleName = QStringLiteral("background");
-static const QString foregroundRoleName = QStringLiteral("foreground");
-static const QString checkStateRoleName = QStringLiteral("checkState");
+static constexpr QLatin1StringView fontRoleName("font");
+static constexpr QLatin1StringView textAlignmentRoleName("textAlignment");
+static constexpr QLatin1StringView backgroundRoleName("background");
+static constexpr QLatin1StringView foregroundRoleName("foreground");
+static constexpr QLatin1StringView checkStateRoleName("checkState");
-static const QString accessibleTextRoleName = QStringLiteral("accessibleText");
-static const QString accessibleDescriptionRoleName = QStringLiteral("accessibleDescription");
+static constexpr QLatin1StringView accessibleTextRoleName("accessibleText");
+static constexpr QLatin1StringView accessibleDescriptionRoleName("accessibleDescription");
-static const QString sizeHintRoleName = QStringLiteral("sizeHint");
+static constexpr QLatin1StringView sizeHintRoleName("sizeHint");
QQmlTableModelColumn::QQmlTableModelColumn(QObject *parent)
@@ -143,21 +166,22 @@ const QHash<QString, QJSValue> QQmlTableModelColumn::getters() const
const QHash<int, QString> QQmlTableModelColumn::supportedRoleNames()
{
- QHash<int, QString> names;
- names[Qt::DisplayRole] = QLatin1String("display");
- names[Qt::DecorationRole] = QLatin1String("decoration");
- names[Qt::EditRole] = QLatin1String("edit");
- names[Qt::ToolTipRole] = QLatin1String("toolTip");
- names[Qt::StatusTipRole] = QLatin1String("statusTip");
- names[Qt::WhatsThisRole] = QLatin1String("whatsThis");
- names[Qt::FontRole] = QLatin1String("font");
- names[Qt::TextAlignmentRole] = QLatin1String("textAlignment");
- names[Qt::BackgroundRole] = QLatin1String("background");
- names[Qt::ForegroundRole] = QLatin1String("foreground");
- names[Qt::CheckStateRole] = QLatin1String("checkState");
- names[Qt::AccessibleTextRole] = QLatin1String("accessibleText");
- names[Qt::AccessibleDescriptionRole] = QLatin1String("accessibleDescription");
- names[Qt::SizeHintRole] = QLatin1String("sizeHint");
+ static const QHash<int, QString> names {
+ {Qt::DisplayRole, displayRoleName},
+ {Qt::DecorationRole, decorationRoleName},
+ {Qt::EditRole, editRoleName},
+ {Qt::ToolTipRole, toolTipRoleName},
+ {Qt::StatusTipRole, statusTipRoleName},
+ {Qt::WhatsThisRole, whatsThisRoleName},
+ {Qt::FontRole, fontRoleName},
+ {Qt::TextAlignmentRole, textAlignmentRoleName},
+ {Qt::BackgroundRole, backgroundRoleName},
+ {Qt::ForegroundRole, foregroundRoleName},
+ {Qt::CheckStateRole, checkStateRoleName},
+ {Qt::AccessibleTextRole, accessibleTextRoleName},
+ {Qt::AccessibleDescriptionRole, accessibleDescriptionRoleName},
+ {Qt::SizeHintRole, sizeHintRoleName}
+ };
return names;
}
diff --git a/src/labs/models/qqmltablemodelcolumn_p.h b/src/labs/models/qqmltablemodelcolumn_p.h
index 04ced79d16..d095343fe6 100644
--- a/src/labs/models/qqmltablemodelcolumn_p.h
+++ b/src/labs/models/qqmltablemodelcolumn_p.h
@@ -27,11 +27,11 @@ QT_REQUIRE_CONFIG(qml_table_model);
QT_BEGIN_NAMESPACE
-class Q_LABSQMLMODELS_PRIVATE_EXPORT QQmlTableModelColumn : public QObject
+class Q_LABSQMLMODELS_EXPORT QQmlTableModelColumn : public QObject
{
Q_OBJECT
Q_PROPERTY(QJSValue display READ display WRITE setDisplay NOTIFY displayChanged FINAL)
- Q_PROPERTY(QJSValue setDisplay READ getSetDisplay WRITE setSetDisplay NOTIFY setDisplayChanged)
+ Q_PROPERTY(QJSValue setDisplay READ getSetDisplay WRITE setSetDisplay NOTIFY setDisplayChanged FINAL)
Q_PROPERTY(QJSValue decoration READ decoration WRITE setDecoration NOTIFY decorationChanged FINAL)
Q_PROPERTY(QJSValue setDecoration READ getSetDecoration WRITE setSetDecoration NOTIFY setDecorationChanged FINAL)
Q_PROPERTY(QJSValue edit READ edit WRITE setEdit NOTIFY editChanged FINAL)
@@ -188,6 +188,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQmlTableModelColumn)
-
#endif // QQMLTABLEMODELCOLUMN_P_H
diff --git a/src/labs/platform/CMakeLists.txt b/src/labs/platform/CMakeLists.txt
index ff98a386ae..adb36e2216 100644
--- a/src/labs/platform/CMakeLists.txt
+++ b/src/labs/platform/CMakeLists.txt
@@ -1,17 +1,13 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-#####################################################################
-## qtlabsplatformplugin Plugin:
-#####################################################################
-
-qt_internal_add_qml_module(qtlabsplatformplugin
+qt_internal_add_qml_module(LabsPlatform
URI "Qt.labs.platform"
VERSION "1.1"
CLASS_NAME QtLabsPlatformPlugin
DEPENDENCIES
QtQuick
- PLUGIN_TARGET qtlabsplatformplugin
+ QtQuick.Templates
SOURCES
qquicklabsplatformcolordialog.cpp qquicklabsplatformcolordialog_p.h
qquicklabsplatformdialog.cpp qquicklabsplatformdialog_p.h
@@ -38,54 +34,76 @@ qt_internal_add_qml_module(qtlabsplatformplugin
Qt::QuickTemplates2Private
)
-qt_internal_extend_target(qtlabsplatformplugin CONDITION TARGET Qt::Widgets
+qt_internal_extend_target(LabsPlatform
+ CONDITION
+ QT_FEATURE_systemtrayicon
SOURCES
- widgets/qwidgetplatform_p.h
- LIBRARIES
- Qt::Widgets
+ qquicklabsplatformsystemtrayicon.cpp qquicklabsplatformsystemtrayicon_p.h
)
-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
-)
+if(TARGET Qt::Widgets)
-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(LabsPlatform
+ SOURCES
+ widgets/qwidgetplatform_p.h
+ LIBRARIES
+ Qt::Widgets
+ )
-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(LabsPlatform
+ CONDITION
+ QT_FEATURE_systemtrayicon
+ SOURCES
+ widgets/qwidgetplatformsystemtrayicon.cpp widgets/qwidgetplatformsystemtrayicon_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(LabsPlatform
+ CONDITION
+ 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_fontdialog AND TARGET Qt::Widgets # special case
- SOURCES
- widgets/qwidgetplatformfontdialog.cpp widgets/qwidgetplatformfontdialog_p.h
-)
+ qt_internal_extend_target(LabsPlatform
+ CONDITION
+ QT_FEATURE_colordialog
+ SOURCES
+ widgets/qwidgetplatformcolordialog.cpp widgets/qwidgetplatformcolordialog_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(LabsPlatform
+ CONDITION
+ QT_FEATURE_filedialog
+ SOURCES
+ widgets/qwidgetplatformfiledialog.cpp widgets/qwidgetplatformfiledialog_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(LabsPlatform
+ CONDITION
+ QT_FEATURE_fontdialog
+ SOURCES
+ widgets/qwidgetplatformfontdialog.cpp widgets/qwidgetplatformfontdialog_p.h
+ )
-qt_internal_extend_target(qtlabsplatformplugin CONDITION QT_FEATURE_systemtrayicon
- SOURCES
- qquicklabsplatformsystemtrayicon.cpp qquicklabsplatformsystemtrayicon_p.h
-)
+ qt_internal_extend_target(LabsPlatform
+ CONDITION
+ QT_FEATURE_menu
+ SOURCES
+ widgets/qwidgetplatformmenu.cpp widgets/qwidgetplatformmenu_p.h
+ widgets/qwidgetplatformmenuitem.cpp widgets/qwidgetplatformmenuitem_p.h
+ )
+
+ qt_internal_extend_target(LabsPlatform
+ CONDITION
+ QT_FEATURE_messagebox
+ SOURCES
+ widgets/qwidgetplatformmessagedialog.cpp widgets/qwidgetplatformmessagedialog_p.h
+ )
+endif()
-qt_internal_add_docs(qtlabsplatformplugin
+qt_internal_add_docs(LabsPlatform
doc/qtlabsplatform.qdocconf
)
diff --git a/src/labs/platform/doc/qtlabsplatform.qdocconf b/src/labs/platform/doc/qtlabsplatform.qdocconf
index c6d70ad83b..0e22443cb8 100644
--- a/src/labs/platform/doc/qtlabsplatform.qdocconf
+++ b/src/labs/platform/doc/qtlabsplatform.qdocconf
@@ -37,5 +37,5 @@ tagfile = qtlabsplatform.tags
macro.labs = "\\note \\e{Types in Qt.labs modules are not guaranteed to remain compatible in future versions.}"
-# Fail the documentation build if there are more warnings than the limit
+# Enforce zero documentation warnings
warninglimit = 0
diff --git a/src/labs/platform/doc/snippets/qtlabsplatform-menu-instantiator.qml b/src/labs/platform/doc/snippets/qtlabsplatform-menu-instantiator.qml
index 683d5e3338..f89b28af2e 100644
--- a/src/labs/platform/doc/snippets/qtlabsplatform-menu-instantiator.qml
+++ b/src/labs/platform/doc/snippets/qtlabsplatform-menu-instantiator.qml
@@ -1,5 +1,5 @@
// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import Qt.labs.platform
diff --git a/src/labs/platform/qquicklabsplatformcolordialog_p.h b/src/labs/platform/qquicklabsplatformcolordialog_p.h
index cde2fd0a5d..b9f025731e 100644
--- a/src/labs/platform/qquicklabsplatformcolordialog_p.h
+++ b/src/labs/platform/qquicklabsplatformcolordialog_p.h
@@ -61,6 +61,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformColorDialog)
-
#endif // QQUICKLABSPLATFORMCOLORDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformdialog_p.h b/src/labs/platform/qquicklabsplatformdialog_p.h
index e04b097694..fc222b8ba4 100644
--- a/src/labs/platform/qquicklabsplatformdialog_p.h
+++ b/src/labs/platform/qquicklabsplatformdialog_p.h
@@ -126,6 +126,4 @@ class QPlatformDialogHelperQuickLabsForeign
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformDialog)
-
#endif // QQUICKLABSPLATFORMDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformfiledialog_p.h b/src/labs/platform/qquicklabsplatformfiledialog_p.h
index e526fda7d0..9bfd8906e7 100644
--- a/src/labs/platform/qquicklabsplatformfiledialog_p.h
+++ b/src/labs/platform/qquicklabsplatformfiledialog_p.h
@@ -36,7 +36,7 @@ class QQuickLabsPlatformFileDialog : public QQuickLabsPlatformDialog
Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters RESET resetNameFilters NOTIFY nameFiltersChanged FINAL)
- Q_PROPERTY(QQuickLabsPlatformFileNameFilter *selectedNameFilter READ selectedNameFilter CONSTANT)
+ Q_PROPERTY(QQuickLabsPlatformFileNameFilter *selectedNameFilter READ selectedNameFilter CONSTANT FINAL)
Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix RESET resetDefaultSuffix NOTIFY defaultSuffixChanged FINAL)
Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
@@ -161,6 +161,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformFileDialog)
-
#endif // QQUICKLABSPLATFORMFILEDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformfolderdialog_p.h b/src/labs/platform/qquicklabsplatformfolderdialog_p.h
index f05749a6e4..334b0f6479 100644
--- a/src/labs/platform/qquicklabsplatformfolderdialog_p.h
+++ b/src/labs/platform/qquicklabsplatformfolderdialog_p.h
@@ -73,6 +73,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformFolderDialog)
-
#endif // QQUICKLABSPLATFORMFOLDERDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformfontdialog_p.h b/src/labs/platform/qquicklabsplatformfontdialog_p.h
index 31aed5928f..8f7d07091d 100644
--- a/src/labs/platform/qquicklabsplatformfontdialog_p.h
+++ b/src/labs/platform/qquicklabsplatformfontdialog_p.h
@@ -61,6 +61,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformFontDialog)
-
#endif // QQUICKLABSPLATFORMFONTDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformicon_p.h b/src/labs/platform/qquicklabsplatformicon_p.h
index 5c83940eef..efd178a75b 100644
--- a/src/labs/platform/qquicklabsplatformicon_p.h
+++ b/src/labs/platform/qquicklabsplatformicon_p.h
@@ -29,9 +29,9 @@ class QQuickLabsPlatformIcon
{
Q_GADGET
QML_ANONYMOUS
- Q_PROPERTY(QUrl source READ source WRITE setSource)
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(bool mask READ isMask WRITE setMask)
+ Q_PROPERTY(QUrl source READ source WRITE setSource FINAL)
+ Q_PROPERTY(QString name READ name WRITE setName FINAL)
+ Q_PROPERTY(bool mask READ isMask WRITE setMask FINAL)
public:
QUrl source() const;
diff --git a/src/labs/platform/qquicklabsplatformiconloader_p.h b/src/labs/platform/qquicklabsplatformiconloader_p.h
index 20914afe85..0fb406df4f 100644
--- a/src/labs/platform/qquicklabsplatformiconloader_p.h
+++ b/src/labs/platform/qquicklabsplatformiconloader_p.h
@@ -18,7 +18,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qstring.h>
#include <QtGui/qicon.h>
-#include <QtQuick/private/qquickpixmapcache_p.h>
+#include <QtQuick/private/qquickpixmap_p.h>
#include "qquicklabsplatformicon_p.h"
diff --git a/src/labs/platform/qquicklabsplatformmenu.cpp b/src/labs/platform/qquicklabsplatformmenu.cpp
index 60a7843001..22dddd7040 100644
--- a/src/labs/platform/qquicklabsplatformmenu.cpp
+++ b/src/labs/platform/qquicklabsplatformmenu.cpp
@@ -321,6 +321,7 @@ void QQuickLabsPlatformMenu::setParentMenu(QQuickLabsPlatformMenu *menu)
emit parentMenuChanged();
}
+#if QT_CONFIG(systemtrayicon)
/*!
\readonly
\qmlproperty SystemTrayIcon Qt.labs.platform::Menu::systemTrayIcon
@@ -342,6 +343,7 @@ void QQuickLabsPlatformMenu::setSystemTrayIcon(QQuickLabsPlatformSystemTrayIcon
destroy();
emit systemTrayIconChanged();
}
+#endif
/*!
\readonly
@@ -648,7 +650,7 @@ void QQuickLabsPlatformMenu::clear()
Opens the menu at the specified \a target item, optionally aligned to a menu \a item.
*/
-void QQuickLabsPlatformMenu::open(QQmlV4Function *args)
+void QQuickLabsPlatformMenu::open(QQmlV4FunctionPtr args)
{
if (!m_handle)
return;
diff --git a/src/labs/platform/qquicklabsplatformmenu_p.h b/src/labs/platform/qquicklabsplatformmenu_p.h
index 14672713bd..130b3418d7 100644
--- a/src/labs/platform/qquicklabsplatformmenu_p.h
+++ b/src/labs/platform/qquicklabsplatformmenu_p.h
@@ -15,6 +15,7 @@
// We mean it.
//
+#include <QtCore/qloggingcategory.h>
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtGui/qfont.h>
@@ -27,11 +28,12 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformMenus)
+
class QIcon;
class QWindow;
class QQuickItem;
class QPlatformMenu;
-class QQmlV4Function;
class QQuickLabsPlatformMenuBar;
class QQuickLabsPlatformMenuItem;
class QQuickLabsPlatformIconLoader;
@@ -47,7 +49,9 @@ class QQuickLabsPlatformMenu : public QObject, public QQmlParserStatus
Q_PROPERTY(QQmlListProperty<QQuickLabsPlatformMenuItem> items READ items NOTIFY itemsChanged FINAL)
Q_PROPERTY(QQuickLabsPlatformMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL)
Q_PROPERTY(QQuickLabsPlatformMenu *parentMenu READ parentMenu NOTIFY parentMenuChanged FINAL)
+#if QT_CONFIG(systemtrayicon)
Q_PROPERTY(QQuickLabsPlatformSystemTrayIcon *systemTrayIcon READ systemTrayIcon NOTIFY systemTrayIconChanged FINAL)
+#endif
Q_PROPERTY(QQuickLabsPlatformMenuItem *menuItem READ menuItem CONSTANT FINAL)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
@@ -76,8 +80,10 @@ public:
QQuickLabsPlatformMenu *parentMenu() const;
void setParentMenu(QQuickLabsPlatformMenu *menu);
+#if QT_CONFIG(systemtrayicon)
QQuickLabsPlatformSystemTrayIcon *systemTrayIcon() const;
void setSystemTrayIcon(QQuickLabsPlatformSystemTrayIcon *icon);
+#endif
QQuickLabsPlatformMenuItem *menuItem() const;
@@ -113,7 +119,7 @@ public:
Q_INVOKABLE void clear();
public Q_SLOTS:
- void open(QQmlV4Function *args);
+ void open(QQmlV4FunctionPtr args);
void close();
Q_SIGNALS:
@@ -175,6 +181,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMenu)
-
#endif // QQUICKLABSPLATFORMMENU_P_H
diff --git a/src/labs/platform/qquicklabsplatformmenubar.cpp b/src/labs/platform/qquicklabsplatformmenubar.cpp
index 8c0b4fd042..54d3d76b45 100644
--- a/src/labs/platform/qquicklabsplatformmenubar.cpp
+++ b/src/labs/platform/qquicklabsplatformmenubar.cpp
@@ -71,8 +71,6 @@ QT_BEGIN_NAMESPACE
\sa Menu
*/
-Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformMenus)
-
QQuickLabsPlatformMenuBar::QQuickLabsPlatformMenuBar(QObject *parent)
: QObject(parent),
m_complete(false),
diff --git a/src/labs/platform/qquicklabsplatformmenubar_p.h b/src/labs/platform/qquicklabsplatformmenubar_p.h
index 28a3fe5652..2f08f4eb27 100644
--- a/src/labs/platform/qquicklabsplatformmenubar_p.h
+++ b/src/labs/platform/qquicklabsplatformmenubar_p.h
@@ -84,6 +84,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMenuBar)
-
#endif // QQUICKLABSPLATFORMMENUBAR_P_H
diff --git a/src/labs/platform/qquicklabsplatformmenuitem.cpp b/src/labs/platform/qquicklabsplatformmenuitem.cpp
index 31e91add36..ab45831b39 100644
--- a/src/labs/platform/qquicklabsplatformmenuitem.cpp
+++ b/src/labs/platform/qquicklabsplatformmenuitem.cpp
@@ -152,6 +152,8 @@ void QQuickLabsPlatformMenuItem::sync()
QKeySequence sequence;
if (m_shortcut.metaType().id() == QMetaType::Int)
sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(m_shortcut.toInt()));
+ else if (m_shortcut.metaType().id() == QMetaType::QKeySequence)
+ sequence = m_shortcut.value<QKeySequence>();
else
sequence = QKeySequence::fromString(m_shortcut.toString());
m_handle->setShortcut(sequence.toString());
@@ -586,6 +588,8 @@ void QQuickLabsPlatformMenuItem::addShortcut()
QKeySequence sequence;
if (m_shortcut.metaType().id() == QMetaType::Int)
sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(m_shortcut.toInt()));
+ else if (m_shortcut.metaType().id() == QMetaType::QKeySequence)
+ sequence = m_shortcut.value<QKeySequence>();
else
sequence = QKeySequence::fromString(m_shortcut.toString());
if (!sequence.isEmpty() && m_enabled) {
@@ -606,6 +610,8 @@ void QQuickLabsPlatformMenuItem::removeShortcut()
QKeySequence sequence;
if (m_shortcut.metaType().id() == QMetaType::Int)
sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(m_shortcut.toInt()));
+ else if (m_shortcut.metaType().id() == QMetaType::QKeySequence)
+ sequence = m_shortcut.value<QKeySequence>();
else
sequence = QKeySequence::fromString(m_shortcut.toString());
QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(m_shortcutId, this, sequence);
diff --git a/src/labs/platform/qquicklabsplatformmenuitem_p.h b/src/labs/platform/qquicklabsplatformmenuitem_p.h
index f02f2536fd..62c4c8a959 100644
--- a/src/labs/platform/qquicklabsplatformmenuitem_p.h
+++ b/src/labs/platform/qquicklabsplatformmenuitem_p.h
@@ -157,6 +157,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMenuItem)
-
#endif // QQUICKLABSPLATFORMMENUITEM_P_H
diff --git a/src/labs/platform/qquicklabsplatformmenuitemgroup_p.h b/src/labs/platform/qquicklabsplatformmenuitemgroup_p.h
index 531eecb5d3..f4f1cc6ae3 100644
--- a/src/labs/platform/qquicklabsplatformmenuitemgroup_p.h
+++ b/src/labs/platform/qquicklabsplatformmenuitemgroup_p.h
@@ -87,6 +87,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMenuItemGroup)
-
#endif // QQUICKLABSPLATFORMMENUITEMGROUP_P_H
diff --git a/src/labs/platform/qquicklabsplatformmenuseparator_p.h b/src/labs/platform/qquicklabsplatformmenuseparator_p.h
index cc8c518b0a..364c592c20 100644
--- a/src/labs/platform/qquicklabsplatformmenuseparator_p.h
+++ b/src/labs/platform/qquicklabsplatformmenuseparator_p.h
@@ -29,6 +29,4 @@ public:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMenuSeparator)
-
#endif // QQUICKLABSPLATFORMMENUSEPARATOR_P_H
diff --git a/src/labs/platform/qquicklabsplatformmessagedialog_p.h b/src/labs/platform/qquicklabsplatformmessagedialog_p.h
index 9426448a3e..8b42c78f34 100644
--- a/src/labs/platform/qquicklabsplatformmessagedialog_p.h
+++ b/src/labs/platform/qquicklabsplatformmessagedialog_p.h
@@ -84,6 +84,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformMessageDialog)
-
#endif // QQUICKLABSPLATFORMMESSAGEDIALOG_P_H
diff --git a/src/labs/platform/qquicklabsplatformstandardpaths_p.h b/src/labs/platform/qquicklabsplatformstandardpaths_p.h
index 9941c3081e..80f4995129 100644
--- a/src/labs/platform/qquicklabsplatformstandardpaths_p.h
+++ b/src/labs/platform/qquicklabsplatformstandardpaths_p.h
@@ -54,10 +54,6 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformStandardPaths)
-Q_DECLARE_METATYPE(QStandardPaths::StandardLocation)
-Q_DECLARE_METATYPE(QStandardPaths::LocateOptions)
-
#endif // QT_DEPRECATED_SINCE(6, 4)
#endif // QQUICKLABSPLATFORMSTANDARDPATHS_P_H
diff --git a/src/labs/platform/qquicklabsplatformsystemtrayicon.cpp b/src/labs/platform/qquicklabsplatformsystemtrayicon.cpp
index fa430a69e6..dee37a50f7 100644
--- a/src/labs/platform/qquicklabsplatformsystemtrayicon.cpp
+++ b/src/labs/platform/qquicklabsplatformsystemtrayicon.cpp
@@ -258,10 +258,15 @@ void QQuickLabsPlatformSystemTrayIcon::setMenu(QQuickLabsPlatformMenu *menu)
if (m_menu)
m_menu->setSystemTrayIcon(nullptr);
- if (menu) {
+
+ if (menu)
menu->setSystemTrayIcon(this);
- if (m_handle && m_complete && menu->create())
+
+ if (m_handle && m_complete) {
+ if (menu && menu->create())
m_handle->updateMenu(menu->handle());
+ else
+ m_handle->updateMenu(nullptr);
}
m_menu = menu;
diff --git a/src/labs/platform/qquicklabsplatformsystemtrayicon_p.h b/src/labs/platform/qquicklabsplatformsystemtrayicon_p.h
index 4adac1a8f7..f5c46aa53e 100644
--- a/src/labs/platform/qquicklabsplatformsystemtrayicon_p.h
+++ b/src/labs/platform/qquicklabsplatformsystemtrayicon_p.h
@@ -106,8 +106,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickLabsPlatformSystemTrayIcon)
-Q_DECLARE_METATYPE(QPlatformSystemTrayIcon::ActivationReason)
-Q_DECLARE_METATYPE(QPlatformSystemTrayIcon::MessageIcon)
-
#endif // QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
diff --git a/src/labs/platform/widgets/qwidgetplatformfiledialog.cpp b/src/labs/platform/widgets/qwidgetplatformfiledialog.cpp
index 738982b5c6..4a74440424 100644
--- a/src/labs/platform/widgets/qwidgetplatformfiledialog.cpp
+++ b/src/labs/platform/widgets/qwidgetplatformfiledialog.cpp
@@ -16,17 +16,17 @@ QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(QObject *parent)
connect(m_dialog.data(), &QDialog::accepted, this, &QPlatformDialogHelper::accept);
connect(m_dialog.data(), &QDialog::rejected, this, &QPlatformDialogHelper::reject);
- connect(m_dialog.data(), &QFileDialog::fileSelected, [this](const QString &file) {
+ connect(m_dialog.data(), &QFileDialog::fileSelected, this, [this](const QString &file) {
emit fileSelected(QUrl::fromLocalFile(file));
});
- connect(m_dialog.data(), &QFileDialog::filesSelected, [this](const QList<QString> &files) {
+ connect(m_dialog.data(), &QFileDialog::filesSelected, this, [this](const QList<QString> &files) {
QList<QUrl> urls;
urls.reserve(files.size());
for (const QString &file : files)
urls += QUrl::fromLocalFile(file);
emit filesSelected(urls);
});
- connect(m_dialog.data(), &QFileDialog::currentChanged, [this](const QString &path) {
+ connect(m_dialog.data(), &QFileDialog::currentChanged, this, [this](const QString &path) {
emit currentChanged(QUrl::fromLocalFile(path));
});
connect(m_dialog.data(), &QFileDialog::directoryEntered, this, &QWidgetPlatformFileDialog::directoryEntered);
diff --git a/src/labs/platform/widgets/qwidgetplatformmessagedialog.cpp b/src/labs/platform/widgets/qwidgetplatformmessagedialog.cpp
index a9cc0de58b..1bb0e219c8 100644
--- a/src/labs/platform/widgets/qwidgetplatformmessagedialog.cpp
+++ b/src/labs/platform/widgets/qwidgetplatformmessagedialog.cpp
@@ -16,7 +16,7 @@ QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(QObject *parent)
connect(m_dialog.data(), &QMessageBox::accepted, this, &QPlatformDialogHelper::accept);
connect(m_dialog.data(), &QMessageBox::rejected, this, &QPlatformDialogHelper::reject);
- connect(m_dialog.data(), &QMessageBox::buttonClicked, [this](QAbstractButton *button) {
+ connect(m_dialog.data(), &QMessageBox::buttonClicked, this, [this](QAbstractButton *button) {
QMessageBox::ButtonRole role = m_dialog->buttonRole(button);
QMessageBox::StandardButton standardButton = m_dialog->standardButton(button);
emit clicked(static_cast<StandardButton>(standardButton), static_cast<ButtonRole>(role));
diff --git a/src/labs/platform/widgets/qwidgetplatformsystemtrayicon.cpp b/src/labs/platform/widgets/qwidgetplatformsystemtrayicon.cpp
index 8ffe4945a0..bb61d58433 100644
--- a/src/labs/platform/widgets/qwidgetplatformsystemtrayicon.cpp
+++ b/src/labs/platform/widgets/qwidgetplatformsystemtrayicon.cpp
@@ -14,7 +14,7 @@ QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(QObject *parent)
setParent(parent);
connect(m_systray.data(), &QSystemTrayIcon::messageClicked, this, &QPlatformSystemTrayIcon::messageClicked);
- connect(m_systray.data(), &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason reason) {
+ connect(m_systray.data(), &QSystemTrayIcon::activated, this, [this](QSystemTrayIcon::ActivationReason reason) {
emit activated(static_cast<ActivationReason>(reason));
});
}
diff --git a/src/labs/settings/CMakeLists.txt b/src/labs/settings/CMakeLists.txt
index 3e703c9146..6b14e97443 100644
--- a/src/labs/settings/CMakeLists.txt
+++ b/src/labs/settings/CMakeLists.txt
@@ -14,6 +14,4 @@ qt_internal_add_qml_module(LabsSettings
PUBLIC_LIBRARIES
Qt::Core
Qt::Qml
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
diff --git a/src/labs/settings/qqmlsettings.cpp b/src/labs/settings/qqmlsettings.cpp
index fe0fa831d2..52220f6c8f 100644
--- a/src/labs/settings/qqmlsettings.cpp
+++ b/src/labs/settings/qqmlsettings.cpp
@@ -18,7 +18,7 @@ QT_BEGIN_NAMESPACE
\qmlmodule Qt.labs.settings 1.0
\title Qt Labs Settings QML Types
\ingroup qmlmodules
- \deprecated [6.5] Use \l {QtQmlCore::}{Settings} from Qt QML Core instead.
+ \deprecated [6.5] Use \l [QML] {QtCore::}{Settings} from Qt Qml Core instead.
\brief Provides persistent platform-independent application settings.
To use this module, import the module with the following line:
@@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE
//! \instantiates QQmlSettings
\inqmlmodule Qt.labs.settings
\ingroup settings
- \deprecated [6.5] Use \l {QtQmlCore::}{Settings} from Qt QML Core instead.
+ \deprecated [6.5] Use \l [QML] {QtCore::}{Settings} from Qt Qml Core instead.
\brief Provides persistent platform-independent application settings.
The Settings type provides persistent platform-independent application settings.
@@ -198,7 +198,7 @@ QT_BEGIN_NAMESPACE
standard, INI text files are used. See \l QSettings documentation for
more details.
- \sa {QtQmlCore::}{Settings}, QSettings
+ \sa {QtCore::}{Settings}, QSettings
*/
Q_LOGGING_CATEGORY(lcSettings, "qt.labs.settings")
diff --git a/src/labs/settings/qqmlsettings_p.h b/src/labs/settings/qqmlsettings_p.h
index 895df8c5e3..a9de5e3077 100644
--- a/src/labs/settings/qqmlsettings_p.h
+++ b/src/labs/settings/qqmlsettings_p.h
@@ -26,7 +26,7 @@ QT_BEGIN_NAMESPACE
class QQmlSettingsPrivate;
-class Q_LABSSETTINGS_PRIVATE_EXPORT QQmlSettings : public QObject, public QQmlParserStatus
+class Q_LABSSETTINGS_EXPORT QQmlSettings : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
@@ -64,6 +64,4 @@ private:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQmlSettings)
-
#endif // QQMLSETTINGS_P_H
diff --git a/src/labs/settings/qqmlsettingsglobal_p.h b/src/labs/settings/qqmlsettingsglobal_p.h
index f25d771218..856821f48b 100644
--- a/src/labs/settings/qqmlsettingsglobal_p.h
+++ b/src/labs/settings/qqmlsettingsglobal_p.h
@@ -17,6 +17,6 @@
// We mean it.
//
-#include <QtLabsSettings/private/qtlabssettingsexports_p.h>
+#include <QtLabsSettings/qtlabssettingsexports.h>
#endif // QTLABSSETTINGSGLOBAL_P_H
diff --git a/src/labs/sharedimage/CMakeLists.txt b/src/labs/sharedimage/CMakeLists.txt
index 65f31ac016..d551bdf5cb 100644
--- a/src/labs/sharedimage/CMakeLists.txt
+++ b/src/labs/sharedimage/CMakeLists.txt
@@ -19,9 +19,7 @@ qt_internal_add_qml_module(LabsSharedImage
Qt::CorePrivate
Qt::GuiPrivate
Qt::QuickPrivate
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
# We need to do additional initialization, so we have to provide our own
# plugin class rather than using the generated one
diff --git a/src/labs/sharedimage/qsharedimageloader.cpp b/src/labs/sharedimage/qsharedimageloader.cpp
index f1313b5c0e..f3c17f9ebb 100644
--- a/src/labs/sharedimage/qsharedimageloader.cpp
+++ b/src/labs/sharedimage/qsharedimageloader.cpp
@@ -4,6 +4,8 @@
#include "qsharedimageloader_p.h"
#include <private/qobject_p.h>
#include <private/qimage_p.h>
+
+#include <QtCore/qpointer.h>
#include <QSharedMemory>
#include <memory>
diff --git a/src/labs/sharedimage/qsharedimageloader_p.h b/src/labs/sharedimage/qsharedimageloader_p.h
index 09f96d2ee1..ca59d95585 100644
--- a/src/labs/sharedimage/qsharedimageloader_p.h
+++ b/src/labs/sharedimage/qsharedimageloader_p.h
@@ -28,7 +28,7 @@ Q_DECLARE_LOGGING_CATEGORY(lcSharedImage);
class QSharedImageLoaderPrivate;
-class Q_LABSSHAREDIMAGE_PRIVATE_EXPORT QSharedImageLoader : public QObject
+class Q_LABSSHAREDIMAGE_EXPORT QSharedImageLoader : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QSharedImageLoader)
diff --git a/src/labs/sharedimage/qsharedimageprovider.cpp b/src/labs/sharedimage/qsharedimageprovider.cpp
index 69f0013b06..33f72447e3 100644
--- a/src/labs/sharedimage/qsharedimageprovider.cpp
+++ b/src/labs/sharedimage/qsharedimageprovider.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <qsharedimageprovider_p.h>
-#include <private/qquickpixmapcache_p.h>
+#include <private/qquickpixmap_p.h>
#include <private/qimage_p.h>
#include <QImageReader>
#include <QFileInfo>
diff --git a/src/labs/sharedimage/qsharedimageprovider_p.h b/src/labs/sharedimage/qsharedimageprovider_p.h
index ee81866072..1888f726fd 100644
--- a/src/labs/sharedimage/qsharedimageprovider_p.h
+++ b/src/labs/sharedimage/qsharedimageprovider_p.h
@@ -18,7 +18,7 @@
#include "qtlabssharedimageglobal_p.h"
#include <QQuickImageProvider>
-#include <private/qquickpixmapcache_p.h>
+#include <private/qquickpixmap_p.h>
#include <QScopedPointer>
#include "qsharedimageloader_p.h"
@@ -46,7 +46,7 @@ protected:
QString key(const QString &path, ImageParameters *params) override;
};
-class Q_LABSSHAREDIMAGE_PRIVATE_EXPORT SharedImageProvider : public QQuickImageProviderWithOptions
+class Q_LABSSHAREDIMAGE_EXPORT SharedImageProvider : public QQuickImageProviderWithOptions
{
public:
SharedImageProvider();
diff --git a/src/labs/sharedimage/qtlabssharedimageglobal_p.h b/src/labs/sharedimage/qtlabssharedimageglobal_p.h
index 75b41771df..1045e9f729 100644
--- a/src/labs/sharedimage/qtlabssharedimageglobal_p.h
+++ b/src/labs/sharedimage/qtlabssharedimageglobal_p.h
@@ -17,11 +17,11 @@
// We mean it.
//
-#include <QtLabsSharedImage/private/qtlabssharedimageexports_p.h>
+#include <QtLabsSharedImage/qtlabssharedimageexports.h>
QT_BEGIN_NAMESPACE
-void Q_LABSSHAREDIMAGE_PRIVATE_EXPORT qml_register_types_Qt_labs_sharedimage();
+void Q_LABSSHAREDIMAGE_EXPORT qml_register_types_Qt_labs_sharedimage();
QT_END_NAMESPACE
diff --git a/src/labs/wavefrontmesh/CMakeLists.txt b/src/labs/wavefrontmesh/CMakeLists.txt
index 1c99d35cac..5b0bdde643 100644
--- a/src/labs/wavefrontmesh/CMakeLists.txt
+++ b/src/labs/wavefrontmesh/CMakeLists.txt
@@ -17,6 +17,4 @@ qt_internal_add_qml_module(LabsWavefrontMesh
Qt::CorePrivate
Qt::GuiPrivate
Qt::QuickPrivate
- GENERATE_CPP_EXPORTS
- GENERATE_PRIVATE_CPP_EXPORTS
-)
+ )
diff --git a/src/labs/wavefrontmesh/qqmlwavefrontmeshglobal_p.h b/src/labs/wavefrontmesh/qqmlwavefrontmeshglobal_p.h
index b90d1941d6..ccf5a681f1 100644
--- a/src/labs/wavefrontmesh/qqmlwavefrontmeshglobal_p.h
+++ b/src/labs/wavefrontmesh/qqmlwavefrontmeshglobal_p.h
@@ -17,6 +17,6 @@
// We mean it.
//
-#include <QtLabsWavefrontMesh/private/qtlabswavefrontmeshexports_p.h>
+#include <QtLabsWavefrontMesh/qtlabswavefrontmeshexports.h>
#endif // QTLABSWAVEFRONTMESHGLOBAL_P_H
diff --git a/src/labs/wavefrontmesh/qwavefrontmesh_p.h b/src/labs/wavefrontmesh/qwavefrontmesh_p.h
index 31ed4a64ff..b68f6578eb 100644
--- a/src/labs/wavefrontmesh/qwavefrontmesh_p.h
+++ b/src/labs/wavefrontmesh/qwavefrontmesh_p.h
@@ -25,13 +25,13 @@
QT_BEGIN_NAMESPACE
class QWavefrontMeshPrivate;
-class Q_LABSWAVEFRONTMESH_PRIVATE_EXPORT QWavefrontMesh : public QQuickShaderEffectMesh
+class Q_LABSWAVEFRONTMESH_EXPORT QWavefrontMesh : public QQuickShaderEffectMesh
{
Q_OBJECT
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(Error lastError READ lastError NOTIFY lastErrorChanged)
- Q_PROPERTY(QVector3D projectionPlaneV READ projectionPlaneV WRITE setProjectionPlaneV NOTIFY projectionPlaneVChanged)
- Q_PROPERTY(QVector3D projectionPlaneW READ projectionPlaneW WRITE setProjectionPlaneW NOTIFY projectionPlaneWChanged)
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged FINAL)
+ Q_PROPERTY(Error lastError READ lastError NOTIFY lastErrorChanged FINAL)
+ Q_PROPERTY(QVector3D projectionPlaneV READ projectionPlaneV WRITE setProjectionPlaneV NOTIFY projectionPlaneVChanged FINAL)
+ Q_PROPERTY(QVector3D projectionPlaneW READ projectionPlaneW WRITE setProjectionPlaneW NOTIFY projectionPlaneWChanged FINAL)
QML_NAMED_ELEMENT(WavefrontMesh)
QML_ADDED_IN_VERSION(1, 0)