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

Method setData

src/backend/matrix/Matrix.cpp:657–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657void Matrix::setData(void* data) {
658 bool isEmpty = false;
659 Q_D(Matrix);
660 switch (d->mode) {
661 case AbstractColumn::ColumnMode::Double:
662 if (static_cast<QVector<QVector<double>>*>(data)->isEmpty())
663 isEmpty = true;
664 break;
665 case AbstractColumn::ColumnMode::Text:
666 if (static_cast<QVector<QVector<QString>>*>(data)->isEmpty())
667 isEmpty = true;
668 break;
669 case AbstractColumn::ColumnMode::Integer:
670 if (static_cast<QVector<QVector<int>>*>(data)->isEmpty())
671 isEmpty = true;
672 break;
673 case AbstractColumn::ColumnMode::BigInt:
674 if (static_cast<QVector<QVector<qint64>>*>(data)->isEmpty())
675 isEmpty = true;
676 break;
677 case AbstractColumn::ColumnMode::Day:
678 case AbstractColumn::ColumnMode::Month:
679 case AbstractColumn::ColumnMode::DateTime:
680 if (static_cast<QVector<QVector<QDateTime>>*>(data)->isEmpty())
681 isEmpty = true;
682 break;
683 }
684
685 if (!isEmpty)
686 exec(new MatrixReplaceValuesCmd(d, data));
687}
688
689QVector<AspectType> Matrix::dropableOn() const {
690 auto vec = AbstractPart::dropableOn();

Callers 15

loadFromXmlDataMethod · 0.45
loadFromXmlDataMethod · 0.45
onTabsMenuAboutToShowMethod · 0.45
initActionsMethod · 0.45
updateNotebookActionsMethod · 0.45
eventFilterMethod · 0.45
eventFilterMethod · 0.45
loadMenuMethod · 0.45
saveMenuMethod · 0.45
initActionsMethod · 0.45
initMenusMethod · 0.45
fillTreeFunction · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by 7

moveElementBeforeMethod · 0.36
moveElementAfterMethod · 0.36
prepareDrawingMenuMethod · 0.36