View Full Version : Graphic glitch: Ellipse item predeceding positions aren't deleted

20th August 2015, 17:03
I noticed a strange bug is happening. I have a pixmap and I draw an Ellipse on it, whose position I change.

I noticed today that its predeceding positions aren't correctly cleared. An image is worth a milion words:


If I undock the dock, the replicas disappear and the bug is not reproduceable. If I launch the Microsoft Windows snipping tool (to take a screenshot) they disappear as well. I suspect it has to be something related to the graphics card or something...

I'll backtrack the code changes because it wasn't happening before, but I am afraid it might be unrelated to qt... Does somebody have a clue of what could be happening?

I am not creating new items, I just use setPos and so on. I've noticed the event loop goes slower than it did also a while ago.

Added after 33 minutes:

I've narrow it down a bit. It started happening when I added a slave display that grabs a screenshot of the main window.

Added after 7 minutes:

Yep, it's exactly that. If I do this:


The bug appears.

If I do it on the centralWidget, thought, it doesn't happen (and it's also a pixmap with things drawn into it). Maybe because it's a dockwidget?

24th August 2015, 16:46
I've created a MWE here:

it took me a while to reproduce because using fitInView "solves" the issue. Probably because it forces a repaint or something. Also, undocking solves it.

None of the two solutions is good, does anybody else have an idea how to solve the bug? Does it happen on other SOs and graphic cards?

Added after 1 31 minutes:

The "solution" is to change the mode of the viewport with

ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportU pdate);

as pointed out by Lazlo on https://bugreports.qt.io/browse/QTBUG-47898