Results 1 to 2 of 2

Thread: Graphic glitch: Ellipse item predeceding positions aren't deleted

  1. #1
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Graphic glitch: Ellipse item predeceding positions aren't deleted

    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:

    crosstrack.png

    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:

    this->grab(ui->dockWidget_3->geometry());

    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?
    Last edited by quimnuss; 20th August 2015 at 16:03.

  2. #2
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Graphic glitch: Ellipse item predeceding positions aren't deleted

    I've created a MWE here:
    https://github.com/quimnuss/grabBug

    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

    Qt Code:
    1. ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    To copy to clipboard, switch view to plain text mode 

    as pointed out by Lazlo on https://bugreports.qt.io/browse/QTBUG-47898
    Last edited by quimnuss; 24th August 2015 at 15:46.

Similar Threads

  1. Replies: 1
    Last Post: 6th January 2014, 10:49
  2. Replies: 0
    Last Post: 30th April 2013, 17:32
  3. Best practice to implement a graphic item
    By Jon Heron in forum Newbie
    Replies: 1
    Last Post: 4th December 2010, 22:20
  4. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 15:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.