MCPcopy Create free account
hub / github.com/KDE/kdevelop / prepareShow

Method prepareShow

plugins/quickopen/quickopenwidget.cpp:192–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void QuickOpenWidget::prepareShow()
193{
194 ui.list->setModel(nullptr);
195 ui.list->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
196 m_model->setTreeView(ui.list);
197
198 // set up proxy filter
199 delete m_proxy;
200 m_proxy = nullptr;
201
202 if (sortingEnabled()) {
203 auto sortFilterProxyModel = new QSortFilterProxyModel(this);
204 sortFilterProxyModel->setDynamicSortFilter(true);
205 m_proxy = sortFilterProxyModel;
206 } else {
207 m_proxy = new QIdentityProxyModel(this);
208 }
209 m_proxy->setSourceModel(m_model);
210 if (sortingEnabled()) {
211 m_proxy->sort(1);
212 }
213 ui.list->setModel(m_proxy);
214
215 m_filterTimer.stop();
216 m_filter = QString();
217
218 if (!m_preselectedText.isEmpty()) {
219 ui.searchLine->setText(m_preselectedText);
220 ui.searchLine->selectAll();
221 }
222
223 m_model->restart(false);
224
225 connect(ui.list->selectionModel(), &QItemSelectionModel::currentRowChanged,
226 this, &QuickOpenWidget::callRowSelected);
227 connect(ui.list->selectionModel(), &QItemSelectionModel::selectionChanged,
228 this, &QuickOpenWidget::callRowSelected);
229}
230
231void QuickOpenWidgetDialog::run()
232{

Callers 2

focusInEventMethod · 0.80
runMethod · 0.80

Calls 10

setTreeViewMethod · 0.80
setSourceModelMethod · 0.80
stopMethod · 0.80
restartMethod · 0.80
QStringClass · 0.50
setModelMethod · 0.45
sortMethod · 0.45
isEmptyMethod · 0.45
setTextMethod · 0.45
selectAllMethod · 0.45

Tested by

no test coverage detected