forked from qt-creator/qt-creator
Prepare for potential QVariant::QVariant(const char *) deprecation
Change-Id: I772f7b454e8f015c9e5bfc8e165e64deb2e3089a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user