Changeset View
Changeset View
Standalone View
Standalone View
plugins/classbrowser/classwidget.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 48 | { | |||
---|---|---|---|---|---|
61 | // We need notification in the model for the collapse/expansion of nodes. | 61 | // We need notification in the model for the collapse/expansion of nodes. | ||
62 | connect(m_tree, &ClassTree::collapsed, | 62 | connect(m_tree, &ClassTree::collapsed, | ||
63 | m_model, &ClassModel::collapsed); | 63 | m_model, &ClassModel::collapsed); | ||
64 | connect(m_tree, &ClassTree::expanded, | 64 | connect(m_tree, &ClassTree::expanded, | ||
65 | m_model, &ClassModel::expanded); | 65 | m_model, &ClassModel::expanded); | ||
66 | 66 | | |||
67 | // Init filter timer | 67 | // Init filter timer | ||
68 | m_filterTimer->setSingleShot(true); | 68 | m_filterTimer->setSingleShot(true); | ||
69 | connect(m_filterTimer, &QTimer::timeout, [this]() { | 69 | connect(m_filterTimer, &QTimer::timeout, this, [this]() { | ||
70 | m_model->updateFilterString(m_filterText); | 70 | m_model->updateFilterString(m_filterText); | ||
71 | 71 | | |||
72 | if (m_filterText.isEmpty()) | 72 | if (m_filterText.isEmpty()) | ||
73 | m_tree->collapseAll(); | 73 | m_tree->collapseAll(); | ||
74 | else | 74 | else | ||
75 | m_tree->expandToDepth(0); | 75 | m_tree->expandToDepth(0); | ||
76 | }); | 76 | }); | ||
77 | 77 | | |||
78 | // Init search box | 78 | // Init search box | ||
79 | m_searchLine->setClearButtonEnabled( true ); | 79 | m_searchLine->setClearButtonEnabled( true ); | ||
80 | connect(m_searchLine, &QLineEdit::textChanged, [this](const QString& newFilter) { | 80 | connect(m_searchLine, &QLineEdit::textChanged, this, [this](const QString& newFilter) { | ||
81 | m_filterText = newFilter; | 81 | m_filterText = newFilter; | ||
82 | m_filterTimer->start(500); | 82 | m_filterTimer->start(500); | ||
83 | }); | 83 | }); | ||
84 | 84 | | |||
85 | QLabel *searchLabel = new QLabel( i18n("S&earch:"), this ); | 85 | QLabel *searchLabel = new QLabel( i18n("S&earch:"), this ); | ||
86 | searchLabel->setBuddy( m_searchLine ); | 86 | searchLabel->setBuddy( m_searchLine ); | ||
87 | 87 | | |||
88 | QHBoxLayout* layout = new QHBoxLayout(); | 88 | QHBoxLayout* layout = new QHBoxLayout(); | ||
Show All 23 Lines |