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:
@@ -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);
|
||||
|
@@ -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());
|
||||
|
@@ -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