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

Method registerItem

src/qt/qcustomplot.cpp:15491–15508  ·  view source on GitHub ↗

! \internal Registers the specified item with this QCustomPlot. QCustomPlot takes ownership of the item. Returns true on success, i.e. when \a item wasn't already in the plot and the parent plot of \a item is this QCustomPlot. This method is called automatically in the QCPAbstractItem base class constructor. */

Source from the content-addressed store, hash-verified

15489 This method is called automatically in the QCPAbstractItem base class constructor.
15490*/
15491bool QCustomPlot::registerItem(QCPAbstractItem *item)
15492{
15493 if (mItems.contains(item))
15494 {
15495 qDebug() << Q_FUNC_INFO << "item already added to this QCustomPlot:" << reinterpret_cast<quintptr>(item);
15496 return false;
15497 }
15498 if (item->parentPlot() != this)
15499 {
15500 qDebug() << Q_FUNC_INFO << "item not created with this QCustomPlot as parent:" << reinterpret_cast<quintptr>(item);
15501 return false;
15502 }
15503
15504 mItems.append(item);
15505 if (!item->layer()) // usually the layer is already set in the constructor of the item (via QCPLayerable constructor)
15506 item->setLayer(currentLayer());
15507 return true;
15508}
15509
15510/*! \internal
15511

Callers 1

QCPAbstractItemMethod · 0.80

Calls 4

layerMethod · 0.80
setLayerMethod · 0.80
containsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected