aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:41:59 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 16:52:58 +0100
commitb684ba219493fb7b0108ae367d6d033aaa28053b (patch)
treef1fec8922da198e231416b50ef8f441ef6db065b /src/imports
parent97a5cf86345fd72cdff83c03664c19a8f5cdf79a (diff)
parent8354851b628ebae567a9125cbd0ba69268470c1b (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/imports.pro5
-rw-r--r--src/imports/labsmodels/qqmldelegatecomponent.cpp20
-rw-r--r--src/imports/labsmodels/qqmltablemodel.cpp16
-rw-r--r--src/imports/labsmodels/qqmltablemodel_p.h4
-rw-r--r--src/imports/layouts/qquicklayout_p.h2
-rw-r--r--src/imports/models/models.pro2
-rw-r--r--src/imports/particles/particles.pro2
-rw-r--r--src/imports/qtquick2/qtquick2.pro2
-rw-r--r--src/imports/settings/qqmlsettings.cpp2
-rw-r--r--src/imports/testlib/quicktestevent.cpp2
-rw-r--r--src/imports/window/window.pro2
-rw-r--r--src/imports/workerscript/workerscript.pro2
12 files changed, 34 insertions, 27 deletions
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 9973883024..e0f66838ec 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -20,8 +20,9 @@ qtHaveModule(quick) {
labsanimation \
layouts \
qtquick2 \
- window \
- wavefrontmesh
+ window
+
+ qtConfig(quick-shadereffect): SUBDIRS += wavefrontmesh
qtHaveModule(testlib): SUBDIRS += testlib
qtConfig(systemsemaphore): SUBDIRS += sharedimage
diff --git a/src/imports/labsmodels/qqmldelegatecomponent.cpp b/src/imports/labsmodels/qqmldelegatecomponent.cpp
index b3c9afbb97..aaf3fea5da 100644
--- a/src/imports/labsmodels/qqmldelegatecomponent.cpp
+++ b/src/imports/labsmodels/qqmldelegatecomponent.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string QtQml.Models::DelegateChoice::roleValue
+ \qmlproperty variant QtQml.Models::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
@@ -75,7 +75,7 @@ void QQmlDelegateChoice::setRoleValue(const QVariant &value)
}
/*!
- \qmlproperty index QtQml.Models::DelegateChoice::row
+ \qmlproperty int QtQml.Models::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.
@@ -87,7 +87,7 @@ void QQmlDelegateChoice::setRoleValue(const QVariant &value)
*/
/*!
- \qmlproperty index QtQml.Models::DelegateChoice::index
+ \qmlproperty int QtQml.Models::DelegateChoice::index
This property holds the value used to match the index value of model elements.
This is effectively an alias for \l row.
@@ -109,7 +109,7 @@ void QQmlDelegateChoice::setRow(int r)
}
/*!
- \qmlproperty index QtQml.Models::DelegateChoice::column
+ \qmlproperty int QtQml.Models::DelegateChoice::column
This property holds the value used to match the column value of model elements.
*/
int QQmlDelegateChoice::column() const
@@ -218,7 +218,7 @@ bool QQmlDelegateChoice::match(int row, int column, const QVariant &value) const
/*!
\qmlproperty string QtQml.Models::DelegateChooser::role
- This property holds the role used to determine the delegate for a given model item.
+ This property holds the role or the property name used to determine the delegate for a given model item.
\sa DelegateChoice
*/
@@ -289,9 +289,15 @@ QQmlComponent *QQmlDelegateChooser::delegate(QQmlAdaptorModel *adaptorModel, int
v = value(adaptorModel, row, column, m_role);
if (!v.isValid()) { // check if the row only has modelData, for example if the row is a QVariantMap
v = value(adaptorModel, row, column, QStringLiteral("modelData"));
- if (v.isValid())
- v = v.toMap().value(m_role);
+
+ if (v.isValid()) {
+ if (v.canConvert(QMetaType::QVariantMap))
+ v = v.toMap().value(m_role);
+ else if (v.canConvert(QMetaType::QObjectStar))
+ v = v.value<QObject*>()->property(m_role.toUtf8());
+ }
}
+
// loop through choices, finding first one that fits
for (int i = 0; i < m_choices.count(); ++i) {
const QQmlDelegateChoice *choice = m_choices.at(i);
diff --git a/src/imports/labsmodels/qqmltablemodel.cpp b/src/imports/labsmodels/qqmltablemodel.cpp
index f190ad86b1..b6468d760f 100644
--- a/src/imports/labsmodels/qqmltablemodel.cpp
+++ b/src/imports/labsmodels/qqmltablemodel.cpp
@@ -271,7 +271,7 @@ QQmlTableModel::ColumnRoleMetadata QQmlTableModel::fetchColumnRoleData(const QSt
if (columnRoleGetter.isString()) {
// The role is set as a string, so we assume the row is a simple object.
- if (firstRow.type() != QVariant::Map) {
+ if (firstRow.userType() != QMetaType::QVariantMap) {
qmlWarning(this).quote() << "expected row for role "
<< roleNameKey << " of TableModelColumn at index "
<< columnIndex << " to be a simple object, but it's "
@@ -284,7 +284,7 @@ QQmlTableModel::ColumnRoleMetadata QQmlTableModel::fetchColumnRoleData(const QSt
roleData.isStringRole = true;
roleData.name = rolePropertyName;
- roleData.type = roleProperty.type();
+ roleData.type = roleProperty.userType();
roleData.typeName = QString::fromLatin1(roleProperty.typeName());
} else if (columnRoleGetter.isCallable()) {
// The role is provided via a function, which means the row is complex and
@@ -296,7 +296,7 @@ QQmlTableModel::ColumnRoleMetadata QQmlTableModel::fetchColumnRoleData(const QSt
// We don't know the property name since it's provided through the function.
// roleData.name = ???
roleData.isStringRole = false;
- roleData.type = cellData.type();
+ roleData.type = cellData.userType();
roleData.typeName = QString::fromLatin1(cellData.typeName());
} else {
// Invalid role.
@@ -326,7 +326,7 @@ void QQmlTableModel::fetchColumnMetadata()
for (const int builtInRoleKey : builtInRoleKeys) {
const QString builtInRoleName = supportedRoleNames.value(builtInRoleKey);
ColumnRoleMetadata roleData = fetchColumnRoleData(builtInRoleName, column, columnIndex);
- if (roleData.type == QVariant::Invalid) {
+ if (roleData.type == QMetaType::UnknownType) {
// This built-in role was not specified in this column.
continue;
}
@@ -847,7 +847,7 @@ bool QQmlTableModel::setData(const QModelIndex &index, const QVariant &value, in
// If the value set is not of the expected type, we can try to convert it automatically.
const ColumnRoleMetadata roleData = columnMetadata.roles.value(roleName);
QVariant effectiveValue = value;
- if (value.type() != roleData.type) {
+ if (value.userType() != roleData.type) {
if (!value.canConvert(int(roleData.type))) {
qmlWarning(this).nospace() << "setData(): the value " << value
<< " set at row " << row << " column " << column << " with role " << roleName
@@ -933,7 +933,7 @@ QQmlTableModel::ColumnRoleMetadata::ColumnRoleMetadata()
}
QQmlTableModel::ColumnRoleMetadata::ColumnRoleMetadata(
- bool isStringRole, const QString &name, QVariant::Type type, const QString &typeName) :
+ bool isStringRole, const QString &name, int type, const QString &typeName) :
isStringRole(isStringRole),
name(name),
type(type),
@@ -995,7 +995,7 @@ bool QQmlTableModel::validateNewRow(const char *functionName, const QVariant &ro
const QVariant rowAsVariant = operation == SetRowsOperation
? row : row.value<QJSValue>().toVariant();
- if (rowAsVariant.type() != QVariant::Map) {
+ if (rowAsVariant.userType() != QMetaType::QVariantMap) {
qmlWarning(this) << functionName << ": row manipulation functions "
<< "do not support complex rows (row index: " << rowIndex << ")";
return false;
@@ -1028,7 +1028,7 @@ bool QQmlTableModel::validateNewRow(const char *functionName, const QVariant &ro
}
const QVariant rolePropertyValue = rowAsMap.value(roleData.name);
- if (rolePropertyValue.type() != roleData.type) {
+ if (rolePropertyValue.userType() != roleData.type) {
qmlWarning(this).quote() << functionName << ": expected the property named "
<< roleData.name << " to be of type " << roleData.typeName
<< ", but got " << QString::fromLatin1(rolePropertyValue.typeName()) << " instead";
diff --git a/src/imports/labsmodels/qqmltablemodel_p.h b/src/imports/labsmodels/qqmltablemodel_p.h
index 6bf3e6df19..d6e982d19a 100644
--- a/src/imports/labsmodels/qqmltablemodel_p.h
+++ b/src/imports/labsmodels/qqmltablemodel_p.h
@@ -116,14 +116,14 @@ private:
{
public:
ColumnRoleMetadata();
- ColumnRoleMetadata(bool isStringRole, const QString &name, QVariant::Type type, const QString &typeName);
+ ColumnRoleMetadata(bool isStringRole, const QString &name, int type, const QString &typeName);
bool isValid() const;
// If this is false, it's a function role.
bool isStringRole = false;
QString name;
- QVariant::Type type = QVariant::Invalid;
+ int type = QMetaType::UnknownType;
QString typeName;
};
diff --git a/src/imports/layouts/qquicklayout_p.h b/src/imports/layouts/qquicklayout_p.h
index c022a2fd47..cb46c41e6c 100644
--- a/src/imports/layouts/qquicklayout_p.h
+++ b/src/imports/layouts/qquicklayout_p.h
@@ -135,7 +135,7 @@ class QQuickLayoutPrivate : public QQuickItemPrivate
{
Q_DECLARE_PUBLIC(QQuickLayout)
public:
- QQuickLayoutPrivate() : m_isReady(false), m_disableRearrange(true) {}
+ QQuickLayoutPrivate() : m_isReady(false), m_disableRearrange(true), m_hasItemChangeListeners(false) {}
protected:
unsigned m_isReady : 1;
diff --git a/src/imports/models/models.pro b/src/imports/models/models.pro
index 0eb9958631..ab3f4e3e15 100644
--- a/src/imports/models/models.pro
+++ b/src/imports/models/models.pro
@@ -1,6 +1,6 @@
CXX_MODULE = qml
TARGET = modelsplugin
-TARGETPATH = QtQml/Models.2
+TARGETPATH = QtQml/Models
IMPORT_VERSION = 2.15
SOURCES += \
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
index d13babf30c..50e1837544 100644
--- a/src/imports/particles/particles.pro
+++ b/src/imports/particles/particles.pro
@@ -1,6 +1,6 @@
CXX_MODULE = qml
TARGET = particlesplugin
-TARGETPATH = QtQuick/Particles.2
+TARGETPATH = QtQuick/Particles
IMPORT_VERSION = 2.15
SOURCES += \
diff --git a/src/imports/qtquick2/qtquick2.pro b/src/imports/qtquick2/qtquick2.pro
index da1772d415..f89518c054 100644
--- a/src/imports/qtquick2/qtquick2.pro
+++ b/src/imports/qtquick2/qtquick2.pro
@@ -1,6 +1,6 @@
CXX_MODULE = qml
TARGET = qtquick2plugin
-TARGETPATH = QtQuick.2
+TARGETPATH = QtQuick
IMPORT_VERSION = 2.15
SOURCES += \
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index d43f9bafb7..de45f87638 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -335,7 +335,7 @@ void QQmlSettingsPrivate::load()
const QVariant currentValue = instance()->value(property.name(), previousValue);
if (!currentValue.isNull() && (!previousValue.isValid()
- || (currentValue.canConvert(previousValue.type()) && previousValue != currentValue))) {
+ || (currentValue.canConvert(previousValue.userType()) && previousValue != currentValue))) {
property.write(q, currentValue);
qCDebug(lcSettings) << "QQmlSettings: load" << property.name() << "setting:" << currentValue << "default:" << previousValue;
}
diff --git a/src/imports/testlib/quicktestevent.cpp b/src/imports/testlib/quicktestevent.cpp
index 56faff9f7e..f2d7f93d26 100644
--- a/src/imports/testlib/quicktestevent.cpp
+++ b/src/imports/testlib/quicktestevent.cpp
@@ -125,7 +125,7 @@ bool QuickTestEvent::keyClickChar(const QString &character, int modifiers, int d
// valueToKeySequence() is copied from qquickshortcut.cpp
static QKeySequence valueToKeySequence(const QVariant &value)
{
- if (value.type() == QVariant::Int)
+ if (value.userType() == QMetaType::Int)
return QKeySequence(static_cast<QKeySequence::StandardKey>(value.toInt()));
return QKeySequence::fromString(value.toString());
}
diff --git a/src/imports/window/window.pro b/src/imports/window/window.pro
index 9c14107267..70af305937 100644
--- a/src/imports/window/window.pro
+++ b/src/imports/window/window.pro
@@ -1,6 +1,6 @@
CXX_MODULE = qml
TARGET = windowplugin
-TARGETPATH = QtQuick/Window.2
+TARGETPATH = QtQuick/Window
IMPORT_VERSION = 2.15
SOURCES += \
diff --git a/src/imports/workerscript/workerscript.pro b/src/imports/workerscript/workerscript.pro
index aa68d193b4..101442c3f3 100644
--- a/src/imports/workerscript/workerscript.pro
+++ b/src/imports/workerscript/workerscript.pro
@@ -1,6 +1,6 @@
CXX_MODULE = qml
TARGET = workerscriptplugin
-TARGETPATH = QtQml/WorkerScript.2
+TARGETPATH = QtQml/WorkerScript
IMPORT_VERSION = 2.15
SOURCES += \