CMakePM: Display current value in CMake settings as tooltip

If you change the value of a CMake parameter in CMake settings the
new value was not displayed in the tooltip, the old value was.

Change-Id: Ie182ef42f8bf48651d170da8054d7f60f9080088
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2022-01-28 15:41:32 +01:00
parent a77f5d41b4
commit a7d3f9fdba

View File

@@ -526,10 +526,9 @@ QString ConfigModelTreeItem::toolTip() const
tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Kit: <b>%1</b></p>") tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Kit: <b>%1</b></p>")
.arg(dataItem->kitValue); .arg(dataItem->kitValue);
if (dataItem->value != dataItem->newValue) tooltip << QCoreApplication::translate("CMakeProjectManager",
tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Initial Configuration: <b>%1</b></p>")
"<p>Initial Configuration: <b>%1</b></p>") .arg(dataItem->currentValue());
.arg(dataItem->value);
} else { } else {
if (!dataItem->initialValue.isEmpty()) if (!dataItem->initialValue.isEmpty())
tooltip << QCoreApplication::translate("CMakeProjectManager", tooltip << QCoreApplication::translate("CMakeProjectManager",
@@ -537,10 +536,9 @@ QString ConfigModelTreeItem::toolTip() const
.arg(dataItem->initialValue); .arg(dataItem->initialValue);
if (dataItem->inCMakeCache) { if (dataItem->inCMakeCache) {
if (dataItem->value != dataItem->newValue) tooltip << QCoreApplication::translate("CMakeProjectManager",
tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Current Configuration: <b>%1</b></p>")
"<p>Current Configuration: <b>%1</b></p>") .arg(dataItem->currentValue());
.arg(dataItem->value);
} else { } else {
tooltip << QCoreApplication::translate("CMakeProjectManager", tooltip << QCoreApplication::translate("CMakeProjectManager",
"<p>Not in CMakeCache.txt</p>"); "<p>Not in CMakeCache.txt</p>");