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

Method enableImportToMatrix

src/frontend/datasources/ImportFileDialog.cpp:355–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void ImportFileDialog::enableImportToMatrix(const bool enable) {
356 if (cbAddTo) {
357 QDEBUG("cbAddTo->currentModelIndex() = " << cbAddTo->currentModelIndex());
358 AbstractAspect* aspect = static_cast<AbstractAspect*>(cbAddTo->currentModelIndex().internalPointer());
359 if (!aspect) {
360 DEBUG("ERROR: no aspect available.");
361 return;
362 }
363
364 if (aspect->inherits(AspectType::Matrix)) {
365 okButton->setEnabled(enable);
366 if (enable)
367 okButton->setToolTip(i18n("Close the dialog and import the data."));
368 else
369 okButton->setToolTip(i18n("Cannot import into a matrix since the data contains non-numerical data."));
370 }
371 }
372}
373
374void ImportFileDialog::checkOkButton() {
375 DEBUG(Q_FUNC_INFO);

Callers

nothing calls this directly

Calls 4

currentModelIndexMethod · 0.80
inheritsMethod · 0.80
setToolTipMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected