c++ - custom painting over QGraphicsView -


i want put text information scene on qgraphicsview.

so i've inherited qgraphicsview i've overrided paintevent , drawings there.

it seemd fine i've realized drawings being updated when there item moving near them. comes mind there clipping, cannot find set , how can obey it.

my painting routine:

void objectsview::paintevent(qpaintevent* event) {     qgraphicsview::paintevent(event);      const int fps = m_controller->fps();     const qstring info = qstring(tr("information simulation: fps: %1"))                          .arg(fps);      qpainter painter(viewport());     const qrect inforect = painter.boundingrect(qrect(), 0, info);      painter.setpen(qt::black);     painter.drawtext(inforect.bottomleft(), info);     painter.drawline(qpoint(), viewport()->rect().bottomright()); } 


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)