From a6cc4b557b4574280c446812870f2d47a33faa92 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Wed, 10 Aug 2022 16:24:14 +0300 Subject: [PATCH] debug console: Sort windows tree model Now you can see properties like 'minimizable' and 'minimized' literally next to each other, not on the other end of a view. --- src/debug_console.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/debug_console.cpp b/src/debug_console.cpp index e03ebd9225..7eaa284f3e 100644 --- a/src/debug_console.cpp +++ b/src/debug_console.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -592,8 +593,15 @@ DebugConsole::DebugConsole() { setAttribute(Qt::WA_ShowWithoutActivating); m_ui->setupUi(this); + + auto windowsModel = new DebugConsoleModel(this); + QSortFilterProxyModel *proxyWindowsModel = new QSortFilterProxyModel(this); + proxyWindowsModel->setSourceModel(windowsModel); + m_ui->windowsView->setModel(proxyWindowsModel); + m_ui->windowsView->sortByColumn(0, Qt::AscendingOrder); + m_ui->windowsView->header()->setSortIndicatorShown(true); m_ui->windowsView->setItemDelegate(new DebugConsoleDelegate(this)); - m_ui->windowsView->setModel(new DebugConsoleModel(this)); + m_ui->surfacesView->setModel(new SurfaceTreeModel(this)); m_ui->clipboardContent->setModel(new DataSourceModel(this)); m_ui->primaryContent->setModel(new DataSourceModel(this));