Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsView drawing artifacts
Qt 6.11 is out! See what's new in the release blog

QGraphicsView drawing artifacts

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 4 Posters 5.4k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wawanbreton
    wrote on last edited by
    #1

    Hi,

    I am working on an application, based on a graph editor, which uses a QGraphicsView. Sometimes, when dragging the view, some strange artifacts appear, inside and even outside the widget :

    alt text
    It is quite annoying, and I don't see what I can do to remove them.
    I tried to play with the render options, but I can see no change. I also tried to use a QGLWidget for the viewport, which seems to remove them, but it causes other troubles, and I don't want the opengl dependancy.

    My items are quite standard, especially the one that seems to be the cause, the connection item : it is just a QGraphicsItemGroup with 3 QGraphicsPathItem as children. I also embed many QGraphicsProxyWidgets, but they seem to work fine after setting their bounding rect correctly.

    Any idea on what I can do to fix this ?

    If you want to test it, the whole code is on github :
    https://github.com/wawanbreton/cvcomposer

    Thanks !

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which version of Qt are you using ? On what version of Windows ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wawanbreton
        wrote on last edited by
        #3

        Hi,

        I am using Qt 5.7.0 with mingw-32 on Windows 7.
        I can try other versions of Qt it that may help, and even the Linux version.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          IIRC, there's 5.8 Beta that is available.
          You can also test the latest 5.6 to see if it's a regression.

          Just tested it on Mac and I'm not able to reproduce that problem.

          What graphic card do you have on your machine ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wawanbreton
            wrote on last edited by
            #5

            Hi,

            Sorry for the delay !
            I tried today with a 5.5 version, provided mingw and same platform, and actually it works well ! Now I should try with 5.8 as you suggested, to see if the issue has been fixed in the meantime.

            1 Reply Last reply
            0
            • W Offline
              W Offline
              wawanbreton
              wrote on last edited by
              #6

              Well, compiling Qt on Windows is quite a pain.. Can I find binaries of 5.8 somewhere ?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                The snapshot of the Beta can be found here.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • W Offline
                  W Offline
                  wawanbreton
                  wrote on last edited by
                  #8

                  Thank you for the link, I will keep it somewhere :)
                  Well, the artifacts are still presents in 5.8 Beta (tag number 584), do you want me to test other versions, for example the msvc one ?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    One more thing you can test is forcing the use of Desktop OpenGL. See here for the variable to set and how (no need to re-build Qt though).

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • W Offline
                      W Offline
                      wawanbreton
                      wrote on last edited by
                      #10

                      Hi, I tried the various values of the QT_OPENGL variable, but nothing changes. Actually, I'm not using a QGLWidget for the QGraphicsView. I tried to : it does remove the artifacts, but generates other limitations, on antialiasing for example, so I'd like to keep the "non-opengl" implementation.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Then it's likely a Windows specific issue, you should take a look at the bug report system to see if its something known.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          wawanbreton
                          wrote on last edited by
                          #12

                          I can't find something similar, I will create a new bug.
                          Thank you for the support.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Thanks ! Don't forget to share the link to the report, it will make it easier to find.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • W Offline
                              W Offline
                              wawanbreton
                              wrote on last edited by
                              #14

                              Here is the bug link :
                              https://bugreports.qt.io/browse/QTBUG-56517

                              I think I will try to make a minimal project to reproduce the bug, I know it helps developpers :)

                              mrjjM 1 Reply Last reply
                              1
                              • W wawanbreton

                                Here is the bug link :
                                https://bugreports.qt.io/browse/QTBUG-56517

                                I think I will try to make a minimal project to reproduce the bug, I know it helps developpers :)

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                @wawanbreton
                                A minimal project is very helpful ! - as it allows developers to easily reproduce
                                the bug, so please do! :)

                                1 Reply Last reply
                                0
                                • W Offline
                                  W Offline
                                  wawanbreton
                                  wrote on last edited by
                                  #16

                                  Hi,
                                  I finally had time to add a project. The bug can be reproduced by starting the application and just play a bit with the mouse (I detailed the instructions in the bug report).
                                  Now I hope someone has time to work on it :)

                                  mrjjM 1 Reply Last reply
                                  1
                                  • W wawanbreton

                                    Hi,
                                    I finally had time to add a project. The bug can be reproduced by starting the application and just play a bit with the mouse (I detailed the instructions in the bug report).
                                    Now I hope someone has time to work on it :)

                                    mrjjM Offline
                                    mrjjM Offline
                                    mrjj
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    @wawanbreton
                                    Its a good idea to post link to bug report here as
                                    people searching the forums can go vote for the issue.

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      sirhc
                                      wrote on last edited by
                                      #18

                                      I had the same problem, it took a long and frustrating amount of time to try and fix, but I think that I have found a solution.
                                      Inside my paint function for that graphicsItem I created a region, then set clip region.
                                      QRegion r1(QRect(-40, -40, 400, 200));
                                      painter->setClipRegion(r1);
                                      This may cause some other problems later, but I haven’t come across them yet. And I’m not sure on the performance cost of doing this when you have a large number of items on the screen. I think that I will move the creation of the region to outside of paint to start with.

                                      1 Reply Last reply
                                      1

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved