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

Method setColumns

src/frontend/spreadsheet/FlattenColumnsDialog.cpp:83–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void FlattenColumnsDialog::setColumns(const QVector<Column*>& columns) {
84 m_columns = columns;
85
86 // names of reference columns - columns that are not in the current selection in the spreadsheet
87 const auto& allColumns = m_spreadsheet->children<Column>();
88 for (auto* column : allColumns) {
89 if (m_columns.indexOf(column) == -1)
90 m_referenceColumnNames << column->name();
91 }
92
93 if (!m_referenceColumnNames.isEmpty()) {
94 // add all other columns in the spreadsheet that were not selected as reference columns
95 for (int i = 0; i < m_referenceColumnNames.count(); ++i)
96 addReferenceColumn();
97 } else
98 m_buttonNew->setEnabled(false);
99
100 // resize the dialog to have the minimum height
101 layout()->activate();
102 resize(QSize(this->width(), 0).expandedTo(minimumSize()));
103}
104
105void FlattenColumnsDialog::addReferenceColumn() {
106 const int index = m_columnComboBoxes.size();

Callers

nothing calls this directly

Calls 7

activateMethod · 0.80
indexOfMethod · 0.45
nameMethod · 0.45
isEmptyMethod · 0.45
countMethod · 0.45
setEnabledMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected