Clear QCPItemText in QCustomPlot -
i can't clear items in qcustomplot. method qcustomplot::itemcount() returns 0.
qcustomplot *plot = new qcustomplot(this); qdebug() << plot->itemcount(); // returns 0 qcpitemtext *textlabel = new qcpitemtext(plot); qdebug() << plot->itemcount(); // returns 0 maybe qcpitemtext not considered item, how clear qcpitemtext then? or reset qcustomplot?
use after allocate textlabel :
plot->additem(textlabel); from documentation :
bool qcustomplot::additem ( qcpabstractitem * item)
adds specified item plot. qcustomplot takes ownership of item.
returns true on success, i.e. when item wasn't in plot , parent plot of item qcustomplot.
Comments
Post a Comment