MCPcopy Create free account
hub / github.com/LUX-Core/lux / addElement

Method addElement

src/qt/qcustomplot.cpp:4128–4142  ·  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

4126 \see element, hasElement, take, remove
4127*/
4128bool QCPLayoutGrid::addElement(int row, int column, QCPLayoutElement *element)
4129{
4130 if (!hasElement(row, column))
4131 {
4132 if (element && element->layout()) // remove from old layout first
4133 element->layout()->take(element);
4134 expandTo(row+1, column+1);
4135 mElements[row][column] = element;
4136 if (element)
4137 adoptElement(element);
4138 return true;
4139 } else
4140 qDebug() << Q_FUNC_INFO << "There is already an element in the specified row/column:" << row << column;
4141 return false;
4142}
4143
4144/*! \overload
4145

Callers 1

QCustomPlotMethod · 0.80

Calls 2

takeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected