aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index 18ac064737..3b991a5f62 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -41,7 +41,7 @@ static Q_LOGGING_CATEGORY(propertyEditorBenchmark, "qtc.propertyeditor.load", Qt
static QmlJS::SimpleReaderNode::Ptr s_templateConfiguration = QmlJS::SimpleReaderNode::Ptr();
-static inline QString propertyTemplatesPath()
+inline static QString propertyTemplatesPath()
{
return QmlDesigner::PropertyEditorQmlBackend::propertyEditorResourcesPath() + QStringLiteral("/PropertyTemplates/");
}
@@ -71,7 +71,7 @@ QStringList variantToStringList(const QVariant &variant) {
static QObject *variantToQObject(const QVariant &value)
{
- if (value.userType() == QMetaType::QObjectStar || value.userType() > QMetaType::User)
+ if (value.typeId() == QMetaType::QObjectStar || value.typeId() > QMetaType::User)
return *(QObject **)value.constData();
return nullptr;
@@ -323,7 +323,7 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
void PropertyEditorQmlBackend::setValue(const QmlObjectNode & , const PropertyName &name, const QVariant &value)
{
// Vector*D values need to be split into their subcomponents
- if (value.type() == QVariant::Vector2D) {
+ if (value.typeId() == QVariant::Vector2D) {
const char *suffix[2] = {"_x", "_y"};
auto vecValue = value.value<QVector2D>();
for (int i = 0; i < 2; ++i) {
@@ -334,7 +334,7 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & , const PropertyNa
if (propertyValue)
propertyValue->setValue(QVariant(vecValue[i]));
}
- } else if (value.type() == QVariant::Vector3D) {
+ } else if (value.typeId() == QVariant::Vector3D) {
const char *suffix[3] = {"_x", "_y", "_z"};
auto vecValue = value.value<QVector3D>();
for (int i = 0; i < 3; ++i) {
@@ -345,7 +345,7 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & , const PropertyNa
if (propertyValue)
propertyValue->setValue(QVariant(vecValue[i]));
}
- } else if (value.type() == QVariant::Vector4D) {
+ } else if (value.typeId() == QVariant::Vector4D) {
const char *suffix[4] = {"_x", "_y", "_z", "_w"};
auto vecValue = value.value<QVector4D>();
for (int i = 0; i < 4; ++i) {
@@ -495,7 +495,8 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q
if (!qmlObjectNode.isValid())
return;
- context()->setContextProperty(QLatin1String("propertyCount"), QVariant(qmlObjectNode.modelNode().properties().count()));
+ context()->setContextProperty(QLatin1String("propertyCount"),
+ QVariant(qmlObjectNode.modelNode().properties().size()));
QStringList stateNames = qmlObjectNode.allStateNames();
stateNames.prepend("base state");
@@ -862,7 +863,7 @@ NodeMetaInfo PropertyEditorQmlBackend::findCommonAncestor(const ModelNode &node)
AbstractView *view = node.view();
- if (view->selectedModelNodes().count() > 1) {
+ if (view->selectedModelNodes().size() > 1) {
NodeMetaInfo commonClass = node.metaInfo();
for (const ModelNode &currentNode : view->selectedModelNodes()) {
if (currentNode.metaInfo().isValid() && !currentNode.metaInfo().isBasedOn(commonClass))
@@ -977,7 +978,7 @@ QString PropertyEditorQmlBackend::locateQmlFile(const NodeMetaInfo &info, const
const QDir importDir(info.importDirectoryPath() + Constants::QML_DESIGNER_SUBFOLDER);
const QDir importDirVersion(info.importDirectoryPath() + QStringLiteral(".") + QString::number(info.majorVersion()) + Constants::QML_DESIGNER_SUBFOLDER);
- const QString relativePathWithoutEnding = relativePath.left(relativePath.count() - 4);
+ const QString relativePathWithoutEnding = relativePath.left(relativePath.size() - 4);
const QString relativePathWithVersion = QString("%1_%2_%3.qml").arg(relativePathWithoutEnding
).arg(info.majorVersion()).arg(info.minorVersion());