CMakePM: Use HeaderViewStretcher for Tools QTreeView

This way one can change the size of the items in the view by
moving the delimiter left and right.

Without this patch the size would stay fixed and looks weird on
Windows with CMake being detected from Visual Studio.

Change-Id: Iaaf1cfb6e854a26e4a2e6535dfd47c19d77125bb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2022-07-08 14:32:24 +02:00
parent 9894c6eaf0
commit f49ffa0ab4

View File

@@ -34,6 +34,7 @@
#include <utils/detailswidget.h> #include <utils/detailswidget.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/headerviewstretcher.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/stringutils.h> #include <utils/stringutils.h>
@@ -569,6 +570,7 @@ public:
header->setStretchLastSection(false); header->setStretchLastSection(false);
header->setSectionResizeMode(0, QHeaderView::ResizeToContents); header->setSectionResizeMode(0, QHeaderView::ResizeToContents);
header->setSectionResizeMode(1, QHeaderView::Stretch); header->setSectionResizeMode(1, QHeaderView::Stretch);
(void) new HeaderViewStretcher(header, 0);
auto buttonLayout = new QVBoxLayout(); auto buttonLayout = new QVBoxLayout();
buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->setContentsMargins(0, 0, 0, 0);