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

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -