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

Method changePreviewSource

src/frontend/PlotTemplateDialog.cpp:266–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void PlotTemplateDialog::changePreviewSource(int row) {
267 if (mLoading)
268 return;
269
270 TemplateListModel* model = mTemplateListModelDefault;
271 if (row == 1)
272 model = mTemplateListModelCustom;
273
274 ui->cbLocation->setToolTip(model->searchPath());
275
276 ui->lCustomFolder->setVisible(row == 1);
277 ui->leCustomFolder->setVisible(row == 1);
278 ui->pbCustomFolder->setVisible(row == 1);
279 ui->lvInstalledTemplates->setModel(model);
280
281 // must be done every time the model changes
282 connect(ui->lvInstalledTemplates->selectionModel(), &QItemSelectionModel::currentChanged, this, &PlotTemplateDialog::listViewTemplateChanged);
283 ui->lvInstalledTemplates->setCurrentIndex(model->index(0, 0));
284
285 if (!model->index(0, 0).isValid())
286 showPreview();
287}
288
289// ##########################################################################################################
290// Listmodel

Callers

nothing calls this directly

Calls 8

setToolTipMethod · 0.80
searchPathMethod · 0.80
selectionModelMethod · 0.80
setVisibleMethod · 0.45
setModelMethod · 0.45
setCurrentIndexMethod · 0.45
indexMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected