CMake: Report extra information of cmake in tooltip

Report version information as well as support for fileapi and
server-mode in a tooltip you get by hovering a cmake version in
Tools->Options->Kits->CMake.

Change-Id: I2c4070b0b26eb4a056925ac5e10774e93ad62c46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tobias Hunger
2019-07-25 13:15:38 +02:00
parent 6790238d91
commit b06f235989

View File

@@ -99,7 +99,12 @@ public:
m_autoCreateBuildDirectory(item->autoCreateBuildDirectory()), m_autoCreateBuildDirectory(item->autoCreateBuildDirectory()),
m_autodetected(item->isAutoDetected()), m_autodetected(item->isAutoDetected()),
m_changed(changed) m_changed(changed)
{} {
m_tooltip = tr("Version: %1<br>Supports fileApi: %2<br>Supports server-mode: %3")
.arg(QString::fromUtf8(item->version().fullVersion))
.arg(item->hasFileApi() ? tr("yes") : tr("no"))
.arg(item->hasServerMode() ? tr("yes") : tr("no"));
}
CMakeToolTreeItem(const QString &name, const Utils::FilePath &executable, CMakeToolTreeItem(const QString &name, const Utils::FilePath &executable,
bool autoRun, bool autoCreate, bool autodetected) : bool autoRun, bool autoCreate, bool autodetected) :
@@ -137,12 +142,16 @@ public:
font.setItalic(model()->defaultItemId() == m_id); font.setItalic(model()->defaultItemId() == m_id);
return font; return font;
} }
case Qt::ToolTipRole: {
return m_tooltip;
}
} }
return QVariant(); return QVariant();
} }
Core::Id m_id; Core::Id m_id;
QString m_name; QString m_name;
QString m_tooltip;
FilePath m_executable; FilePath m_executable;
bool m_isAutoRun = true; bool m_isAutoRun = true;
bool m_autoCreateBuildDirectory = false; bool m_autoCreateBuildDirectory = false;