MCPcopy Create free account
hub / github.com/ZhuYanzhen1/miniFOC / addElement

Method addElement

tools/qcustomplot.cpp:4159–4173  ·  view source on GitHub ↗

! \overload Adds the \a element to cell with \a row and \a column. If \a element is already in a layout, it is first removed from there. If \a row or \a column don't exist yet, the layout is expanded accordingly. Returns true if the element was added successfully, i.e. if the cell at \a row and \a column didn't already have an element. Use the overload of this method without explici

Source from the content-addressed store, hash-verified

4157 \see element, hasElement, take, remove
4158*/
4159bool QCPLayoutGrid::addElement(int row, int column, QCPLayoutElement *element)
4160{
4161 if (!hasElement(row, column))
4162 {
4163 if (element && element->layout()) // remove from old layout first
4164 element->layout()->take(element);
4165 expandTo(row+1, column+1);
4166 mElements[row][column] = element;
4167 if (element)
4168 adoptElement(element);
4169 return true;
4170 } else
4171 qDebug() << Q_FUNC_INFO << "There is already an element in the specified row/column:" << row << column;
4172 return false;
4173}
4174
4175/*! \overload
4176

Callers 1

QCustomPlotMethod · 0.80

Calls 2

takeMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected