aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2019-12-03 20:24:38 +0100
committerOlivier Goffart <ogoffart@woboq.com>2020-01-17 11:31:35 +0100
commitc6899f16389458766904d8d913054f09076e06dd (patch)
treee24f942a01720775391ae04557e24a35839f7361 /src/quick
parent9e674be4fb8c369873a009f58e3152a12d2c4cce (diff)
Replace QVariant::type with QVariant::userType
as type is going to be deprecated. This change was done automatically with the help of clazy. In addition, ColumnRoleMetadata was changed to take an int instead of a QVariant::Type Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/designer/qqmldesignermetaobject.cpp2
-rw-r--r--src/quick/designer/qquickdesignercustomobjectdata.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp2
-rw-r--r--src/quick/items/qquickopenglshadereffectnode.cpp2
-rw-r--r--src/quick/scenegraph/qsgrhishadereffectnode.cpp4
-rw-r--r--src/quick/util/qquickanimation.cpp18
-rw-r--r--src/quick/util/qquickglobal.cpp2
-rw-r--r--src/quick/util/qquickpath.cpp6
-rw-r--r--src/quick/util/qquickshortcut.cpp2
9 files changed, 20 insertions, 20 deletions
diff --git a/src/quick/designer/qqmldesignermetaobject.cpp b/src/quick/designer/qqmldesignermetaobject.cpp
index de7da7f9be..0aa5dc2613 100644
--- a/src/quick/designer/qqmldesignermetaobject.cpp
+++ b/src/quick/designer/qqmldesignermetaobject.cpp
@@ -240,7 +240,7 @@ int QQmlDesignerMetaObject::metaCall(QObject *o, QMetaObject::Call call, int id,
if (call == QMetaObject::WriteProperty
&& propertyById.userType() == QMetaType::QVariant
- && reinterpret_cast<QVariant *>(a[0])->type() == QVariant::Double
+ && reinterpret_cast<QVariant *>(a[0])->userType() == QMetaType::Double
&& qt_is_nan(reinterpret_cast<QVariant *>(a[0])->toDouble())) {
return -1;
}
diff --git a/src/quick/designer/qquickdesignercustomobjectdata.cpp b/src/quick/designer/qquickdesignercustomobjectdata.cpp
index 6b39f5157b..66a86bffd5 100644
--- a/src/quick/designer/qquickdesignercustomobjectdata.cpp
+++ b/src/quick/designer/qquickdesignercustomobjectdata.cpp
@@ -278,7 +278,7 @@ void QQuickDesignerCustomObjectData::setPropertyBinding(QQmlContext *context,
//Refcounting is taking take care of deletion
binding->update();
if (binding->hasError()) {
- if (property.property().userType() == QVariant::String)
+ if (property.property().userType() == QMetaType::QString)
property.write(QVariant(QLatin1Char('#') + expression + QLatin1Char('#')));
}
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 8454010ee9..b5932c6f80 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1478,7 +1478,7 @@ QVariant QQuickKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) const
if (i && i->isVisible() && (i->flags() & QQuickItem::ItemAcceptsInputMethod) && i == d->imeItem) {
//### how robust is i == d->imeItem check?
QVariant v = i->inputMethodQuery(query);
- if (v.userType() == QVariant::RectF)
+ if (v.userType() == QMetaType::QRectF)
v = d->item->mapRectFromItem(i, v.toRectF()); //### cost?
return v;
}
diff --git a/src/quick/items/qquickopenglshadereffectnode.cpp b/src/quick/items/qquickopenglshadereffectnode.cpp
index 26ef59c20e..5721f116e8 100644
--- a/src/quick/items/qquickopenglshadereffectnode.cpp
+++ b/src/quick/items/qquickopenglshadereffectnode.cpp
@@ -178,7 +178,7 @@ void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMateri
if (state.isMatrixDirty())
program()->setUniformValue(loc, state.combinedMatrix());
} else if (d.specialType == UniformData::None) {
- switch (int(d.value.type())) {
+ switch (int(d.value.userType())) {
case QMetaType::QColor:
program()->setUniformValue(loc, qt_premultiply_color(qvariant_cast<QColor>(d.value)));
break;
diff --git a/src/quick/scenegraph/qsgrhishadereffectnode.cpp b/src/quick/scenegraph/qsgrhishadereffectnode.cpp
index 6f6544548c..e86dae7c09 100644
--- a/src/quick/scenegraph/qsgrhishadereffectnode.cpp
+++ b/src/quick/scenegraph/qsgrhishadereffectnode.cpp
@@ -136,7 +136,7 @@ void QSGRhiShaderLinker::linkTextureSubRects()
// texture binding point.
for (Constant &c : m_constants) {
if (c.specialType == QSGShaderEffectNode::VariableData::SubRect) {
- if (c.value.type() == QVariant::ByteArray) {
+ if (c.value.userType() == QMetaType::QByteArray) {
const QByteArray name = c.value.toByteArray();
if (!m_samplerNameMap.contains(name))
qWarning("ShaderEffect: qt_SubRect_%s refers to unknown source texture", name.constData());
@@ -270,7 +270,7 @@ bool QSGRhiShaderEffectMaterialShader::updateUniformData(RenderState &state, QSG
memcpy(dst, f, sizeof(f));
} else if (c.specialType == QSGShaderEffectNode::VariableData::None) {
changed = true;
- switch (int(c.value.type())) {
+ switch (int(c.value.userType())) {
case QMetaType::QColor: {
const QColor v = qsg_premultiply_color(qvariant_cast<QColor>(c.value));
const float f[4] = { float(v.redF()), float(v.greenF()), float(v.blueF()), float(v.alphaF()) };
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index d6d6f1d8d4..763b0aa171 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1966,20 +1966,20 @@ QAbstractAnimationJob* QQuickParallelAnimation::transition(QQuickStateActions &a
//convert a variant from string type to another animatable type
void QQuickPropertyAnimationPrivate::convertVariant(QVariant &variant, int type)
{
- if (variant.userType() != QVariant::String) {
+ if (variant.userType() != QMetaType::QString) {
variant.convert(type);
return;
}
switch (type) {
- case QVariant::Rect:
- case QVariant::RectF:
- case QVariant::Point:
- case QVariant::PointF:
- case QVariant::Size:
- case QVariant::SizeF:
- case QVariant::Color:
- case QVariant::Vector3D:
+ case QMetaType::QRect:
+ case QMetaType::QRectF:
+ case QMetaType::QPoint:
+ case QMetaType::QPointF:
+ case QMetaType::QSize:
+ case QMetaType::QSizeF:
+ case QMetaType::QColor:
+ case QMetaType::QVector3D:
{
bool ok = false;
variant = QQmlStringConverters::variantFromString(variant.toString(), type, &ok);
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 527274e6be..bc5b8c4f3e 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -719,7 +719,7 @@ public:
bool typedRead(const QVariant& src, int dstType, void *dst)
{
T *dstT = reinterpret_cast<T *>(dst);
- if (src.type() == static_cast<uint>(dstType)) {
+ if (src.userType() == dstType) {
*dstT = src.value<T>();
} else {
*dstT = T();
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index 24b22f00c1..c855acc185 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -2415,7 +2415,7 @@ QVariant QQuickPathPolyline::path() const
void QQuickPathPolyline::setPath(const QVariant &path)
{
- if (path.type() == QVariant::PolygonF) {
+ if (path.userType() == QMetaType::QPolygonF) {
setPath(path.value<QPolygonF>());
} else if (path.canConvert<QVector<QPointF>>()) {
setPath(path.value<QVector<QPointF>>());
@@ -2431,7 +2431,7 @@ void QQuickPathPolyline::setPath(const QVariant &path)
pathList.append(v.toPointF());
setPath(pathList);
} else {
- qWarning() << "PathPolyline: path of type" << path.type() << "not supported";
+ qWarning() << "PathPolyline: path of type" << path.userType() << "not supported";
}
}
@@ -2583,7 +2583,7 @@ void QQuickPathMultiline::setPaths(const QVariant &paths)
}
setPaths(pathsList);
} else {
- qWarning() << "PathMultiline: paths of type" << paths.type() << "not supported";
+ qWarning() << "PathMultiline: paths of type" << paths.userType() << "not supported";
setPaths(QVector<QVector<QPointF>>());
}
}
diff --git a/src/quick/util/qquickshortcut.cpp b/src/quick/util/qquickshortcut.cpp
index 5d227b4613..8ef204d179 100644
--- a/src/quick/util/qquickshortcut.cpp
+++ b/src/quick/util/qquickshortcut.cpp
@@ -130,7 +130,7 @@ QT_BEGIN_NAMESPACE
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());
}