Changeset View
Changeset View
Standalone View
Standalone View
src/ui/views/typeview.cpp
Show All 15 Lines | |||||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "typeview.h" | 18 | #include "typeview.h" | ||
19 | #include "ui_typeview.h" | 19 | #include "ui_typeview.h" | ||
20 | 20 | | |||
21 | #include <typemodel/typemodel.h> | 21 | #include <typemodel/typemodel.h> | ||
22 | #include <navigator/codenavigator.h> | 22 | #include <navigator/codenavigator.h> | ||
23 | 23 | | |||
24 | #include <KRecursiveFilterProxyModel> | | |||
25 | | ||||
26 | #include <QItemSelectionModel> | 24 | #include <QItemSelectionModel> | ||
27 | #include <QMessageBox> | 25 | #include <QMessageBox> | ||
26 | #include <QSortFilterProxyModel> | ||||
28 | 27 | | |||
29 | TypeView::TypeView(QWidget* parent): | 28 | TypeView::TypeView(QWidget* parent): | ||
30 | QWidget(parent), | 29 | QWidget(parent), | ||
31 | ui(new Ui::TypeView), | 30 | ui(new Ui::TypeView), | ||
32 | m_model(new TypeModel(this)) | 31 | m_model(new TypeModel(this)) | ||
33 | { | 32 | { | ||
34 | ui->setupUi(this); | 33 | ui->setupUi(this); | ||
35 | 34 | | |||
36 | auto proxy = new KRecursiveFilterProxyModel(this); | 35 | auto proxy = new QSortFilterProxyModel(this); | ||
36 | proxy->setRecursiveFilteringEnabled(true); | ||||
37 | proxy->setSourceModel(m_model); | 37 | proxy->setSourceModel(m_model); | ||
38 | ui->typeTreeView->setModel(proxy); | 38 | ui->typeTreeView->setModel(proxy); | ||
39 | ui->typeTreeView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); | 39 | ui->typeTreeView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); | ||
40 | 40 | | |||
41 | connect(ui->typeTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, | 41 | connect(ui->typeTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, | ||
42 | this, &TypeView::selectionChanged); | 42 | this, &TypeView::selectionChanged); | ||
43 | connect(ui->searchLineEdit, &QLineEdit::textChanged, this, [proxy](const QString &text) { | 43 | connect(ui->searchLineEdit, &QLineEdit::textChanged, this, [proxy](const QString &text) { | ||
44 | proxy->setFilterFixedString(text); | 44 | proxy->setFilterFixedString(text); | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |