Commit 2ee9ee9b authored by hjk's avatar hjk

QtSupport: Make changed Qt version names bold in version dialog

Mimic what other Build&Run views do.

Change-Id: I6abb13816b5fe17f9aeeb38b0041c1f9b11a98ec
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent d5de4577
......@@ -102,6 +102,12 @@ public:
return m_version->qmakeCommand().toUserOutput();
}
if (role == Qt::FontRole && m_changed) {
QFont font;
font.setBold(true);
return font;
}
if (role == Qt::DecorationRole && column == 0)
return m_icon;
......@@ -134,11 +140,20 @@ public:
m_toolChainId = id;
}
void setChanged(bool changed)
{
if (changed == m_changed)
return;
m_changed = changed;
update();
}
private:
BaseQtVersion *m_version = 0;
QIcon m_icon;
QString m_buildLog;
QByteArray m_toolChainId;
bool m_changed = false;
};
///
......@@ -744,6 +759,7 @@ void QtOptionsPageWidget::updateCurrentQtName()
if (!item || !item->version())
return;
item->setChanged(true);
item->version()->setUnexpandedDisplayName(m_versionUi->nameEdit->text());
updateDescriptionLabel();
......@@ -755,21 +771,18 @@ void QtOptionsPageWidget::apply()
disconnect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
this, &QtOptionsPageWidget::updateQtVersions);
QtVersionManager::setNewQtVersions(versions());
QList<BaseQtVersion *> versions;
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
this, &QtOptionsPageWidget::updateQtVersions);
}
m_model->forSecondLevelItems([this, &versions](QtVersionItem *item) {
item->setChanged(false);
versions.append(item->version()->clone());
});
QList<BaseQtVersion *> QtOptionsPageWidget::versions() const
{
QList<BaseQtVersion *> result;
QtVersionManager::setNewQtVersions(versions);
m_model->forSecondLevelItems([this, &result](QtVersionItem *item) {
result.append(item->version()->clone());
});
return result;
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
this, &QtOptionsPageWidget::updateQtVersions);
}
} // namespace Internal
......
......@@ -62,7 +62,6 @@ class QtOptionsPageWidget : public QWidget
public:
QtOptionsPageWidget(QWidget *parent = 0);
~QtOptionsPageWidget();
QList<BaseQtVersion *> versions() const;
void apply();
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment