MCPcopy Create free account
hub / github.com/KDE/labplot / activateIconViewItem

Method activateIconViewItem

src/frontend/examples/ExamplesWidget.cpp:182–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void ExamplesWidget::activateIconViewItem(const QString& name) {
183 auto* model = ui.lvExamples->model();
184 for (int i = 0; i < model->rowCount(); ++i) {
185 const auto& index = model->index(i, 0);
186 if (index.data(Qt::DisplayRole).toString() == name) {
187 ui.lvExamples->setCurrentIndex(index);
188 ui.lvExamples->scrollTo(index);
189 }
190 }
191}
192
193void ExamplesWidget::activateListViewItem(const QString& name) {
194 const auto& items = ui.lwExamples->findItems(name, Qt::MatchExactly);

Callers

nothing calls this directly

Calls 6

modelMethod · 0.45
rowCountMethod · 0.45
indexMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected