TreeModel: Introduce a StaticTreeItem

This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.

Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2016-06-10 10:37:49 +02:00
parent 0c1cdc3a4a
commit b281d6dad7
9 changed files with 65 additions and 44 deletions

View File

@@ -142,8 +142,8 @@ public:
CMakeToolItemModel::CMakeToolItemModel()
{
setHeader(QStringList() << tr("Name") << tr("Location"));
rootItem()->appendChild(new TreeItem(QStringList() << tr("Auto-detected") << QString() << QString()));
rootItem()->appendChild(new TreeItem(QStringList() << tr("Manual") << QString() << QString()));
rootItem()->appendChild(new StaticTreeItem({ tr("Auto-detected") }));
rootItem()->appendChild(new StaticTreeItem({ tr("Manual") }));
foreach (const CMakeTool *item, CMakeToolManager::cmakeTools())
addCMakeTool(item, false);