diff options
author | hjk <hjk@qt.io> | 2019-01-24 11:26:57 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-01-24 10:53:28 +0000 |
commit | db32dfe7a416dbda8ffcaaeec9400332ff1fa71e (patch) | |
tree | 4bb8b54a52beac2c8bccd7e74c343dd9e11d5138 /src/plugins/scxmleditor | |
parent | f5c3007058ae713e099152de8c8a71eab06b7d9f (diff) |
Prepare for potential QVariant::QVariant(const char *) deprecation
Change-Id: I772f7b454e8f015c9e5bfc8e165e64deb2e3089a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/scxmleditor')
-rw-r--r-- | src/plugins/scxmleditor/common/colorthemes.cpp | 3 | ||||
-rw-r--r-- | src/plugins/scxmleditor/outputpane/warningmodel.cpp | 3 | ||||
-rw-r--r-- | src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.cpp | 9 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/scxmleditor/common/colorthemes.cpp b/src/plugins/scxmleditor/common/colorthemes.cpp index fc06f03584b..06b503a569d 100644 --- a/src/plugins/scxmleditor/common/colorthemes.cpp +++ b/src/plugins/scxmleditor/common/colorthemes.cpp @@ -89,7 +89,8 @@ void ColorThemes::updateColorThemeMenu() m_menu->clear(); const QSettings *s = Core::ICore::settings(); - const QString currentTheme = s->value(Constants::C_SETTINGS_COLORSETTINGS_CURRENTCOLORTHEME, Constants::C_COLOR_SCHEME_DEFAULT).toString(); + const QString currentTheme = s->value(Constants::C_SETTINGS_COLORSETTINGS_CURRENTCOLORTHEME, + QString(Constants::C_COLOR_SCHEME_DEFAULT)).toString(); const QVariantMap data = s->value(Constants::C_SETTINGS_COLORSETTINGS_COLORTHEMES).toMap(); QStringList keys = data.keys(); keys.append(Constants::C_COLOR_SCHEME_SCXMLDOCUMENT); diff --git a/src/plugins/scxmleditor/outputpane/warningmodel.cpp b/src/plugins/scxmleditor/outputpane/warningmodel.cpp index 6b4bb0ea033..d0166bfff98 100644 --- a/src/plugins/scxmleditor/outputpane/warningmodel.cpp +++ b/src/plugins/scxmleditor/outputpane/warningmodel.cpp @@ -158,7 +158,8 @@ QVariant WarningModel::data(const QModelIndex &index, int role) const switch (role) { case WarningModel::FilterRole: - return it->isActive() ? Constants::C_WARNINGMODEL_FILTER_ACTIVE : Constants::C_WARNINGMODEL_FILTER_NOT; + return QString::fromLatin1(it->isActive() ? Constants::C_WARNINGMODEL_FILTER_ACTIVE + : Constants::C_WARNINGMODEL_FILTER_NOT); case Qt::DecorationRole: { if (col == 0) return severityIcon(it->severity()); diff --git a/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.cpp b/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.cpp index 4df2a211cc5..0a8996eb3d3 100644 --- a/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.cpp +++ b/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.cpp @@ -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(); } |