TextEditor: Snippetssettings QTableView to QTreeView

QTreeView is a better list view with columns than QTableView.
One special reason for this change is that QTreeView
finds a proper default row height regardless of the system
DPI.

Change-Id: I80c7fe0d15be620162cefa53b5b231b62931c614
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Alessandro Portale
2014-06-03 17:11:47 +02:00
parent b8df1a9b55
commit c778d7a336
2 changed files with 90 additions and 97 deletions

View File

@@ -38,6 +38,7 @@
#include <coreplugin/icore.h>
#include <texteditor/texteditorsettings.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/headerviewstretcher.h>
#include <QAbstractTableModel>
#include <QList>
@@ -341,12 +342,8 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w)
connect(snippetEditor, SIGNAL(snippetContentChanged()), this, SLOT(setSnippetContent()));
}
m_ui.snippetsTable->setSelectionBehavior(QAbstractItemView::SelectRows);
m_ui.snippetsTable->setSelectionMode(QAbstractItemView::SingleSelection);
m_ui.snippetsTable->horizontalHeader()->setStretchLastSection(true);
m_ui.snippetsTable->horizontalHeader()->setHighlightSections(false);
m_ui.snippetsTable->verticalHeader()->setVisible(false);
m_ui.snippetsTable->setModel(m_model);
new Utils::HeaderViewStretcher(m_ui.snippetsTable->header(), 1);
m_ui.revertButton->setEnabled(false);