浏览代码

LocationList: make header sections resizable

Le Tan 4 年之前
父节点
当前提交
516aaa95ca
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/widgets/locationlist.cpp

+ 2 - 0
src/widgets/locationlist.cpp

@@ -3,6 +3,7 @@
 #include <QVBoxLayout>
 #include <QVBoxLayout>
 #include <QToolButton>
 #include <QToolButton>
 #include <QLabel>
 #include <QLabel>
+#include <QHeaderView>
 
 
 #include "treewidget.h"
 #include "treewidget.h"
 #include "widgetsfactory.h"
 #include "widgetsfactory.h"
@@ -53,6 +54,7 @@ void LocationList::setupUI()
     // When updated, pay attention to the Columns enum.
     // When updated, pay attention to the Columns enum.
     m_tree->setHeaderLabels(QStringList() << tr("Path") << tr("Line") << tr("Text"));
     m_tree->setHeaderLabels(QStringList() << tr("Path") << tr("Line") << tr("Text"));
     TreeWidget::showHorizontalScrollbar(m_tree);
     TreeWidget::showHorizontalScrollbar(m_tree);
+    m_tree->header()->setSectionResizeMode(QHeaderView::Interactive);
     connect(m_tree, &QTreeWidget::itemActivated,
     connect(m_tree, &QTreeWidget::itemActivated,
             this, [this](QTreeWidgetItem *p_item, int p_col) {
             this, [this](QTreeWidgetItem *p_item, int p_col) {
                 Q_UNUSED(p_col);
                 Q_UNUSED(p_col);