Prepare for potential QVariant::QVariant(const char *) deprecation

Change-Id: I772f7b454e8f015c9e5bfc8e165e64deb2e3089a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2019-01-24 11:26:57 +01:00
parent f5c3007058
commit db32dfe7a4
3 changed files with 9 additions and 6 deletions

View File

@@ -97,10 +97,11 @@ QVariant SCAttributeItemModel::data(const QModelIndex &index, int role) const
if (bEditable) {
return m_tag->attributeName(index.row());
} else {
if (m_tag->info()->attributes[index.row()].required)
return QString::fromLatin1("*%1").arg(QLatin1String(m_tag->info()->attributes[index.row()].name));
scxmltag_attribute_t attr = m_tag->info()->attributes[index.row()];
if (attr.required)
return QString::fromLatin1("*%1").arg(QLatin1String(attr.name));
else
return m_tag->info()->attributes[index.row()].name;
return QString::fromLatin1(attr.name);
}
} else {
if (bEditable) {
@@ -128,7 +129,7 @@ QVariant SCAttributeItemModel::data(const QModelIndex &index, int role) const
}
case DataRole: {
if (m_tag->info()->n_attributes > 0)
return m_tag->info()->attributes[index.row()].value;
return QString::fromLatin1(m_tag->info()->attributes[index.row()].value);
else
return QVariant();
}