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. paint method of QGraphicItems & QGraphicsItemGroup do not fire after some while or some minimize/maximize of window
Forum Updated to NodeBB v4.3 + New Features

paint method of QGraphicItems & QGraphicsItemGroup do not fire after some while or some minimize/maximize of window

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 580 Views 1 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.
  • M.H.HM Offline
    M.H.HM Offline
    M.H.H
    wrote on last edited by aha_1980
    #1

    Hi everyone,
    I have been developing a graphical application.
    I have some graphical object inheriting from QGraphicsItems. I have added all of them into a QGraphicsItemGroup object and then add the QGraphicsItemGroup object to a QGraphicScene object. The QGraphicScene is created from a QGraphicView.

    The problem is that after some minimizing/maximizing the main window the drawing process will be stopped though a function trigges some methods inside the QGraphicsItemGroup object. And also, the QGraphicsItemGroup object call some method of the QGraphicsItems objects. Inside ever mehtod of QGraphicsItems/QGraphicsItemGroup the update function is called. But the paint mathod does not fire.

    Is there anyone who has some ideas how I can solve it or figure the problem out.

    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 ?
      On which OS ?
      Are you using any custom class with custom painting.

      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
      • M.H.HM Offline
        M.H.HM Offline
        M.H.H
        wrote on last edited by
        #3

        Hi there,
        Thanks for the reply.

        I am using Qt V5.12.1 with MinGW 7.3.0 64-bit on Windows 10.

        In fact, I have developed some classes inheriting from QGraphicItems or QgraphicItemGroup.

        For instance :
        MyFuzzyItem class inherits from QGraphicItem and then it will be added as Item to another class which inherits from QGraphicItemGroup ( Let's call it FuzzyComponent). And finally, FuzzyComponent will be added to the scene.
        Also, I override paint methods in each class to draw something.

        Hints :
        1- The update function of the scene works properly meaning that it can be called to redraw. But update methods of the inside items of the scene do not work. ( It happens after a while or doing some minimize/maximize of the main window. So, it is required to restart the application.)
        Also, I found out that other functions which I call from outside are working properly. I use them for changing some data which must lead to change the graphical items. I call the update method of the graphical object after changing the data. But it does not work.

        2- While the update methods do not work, the other events like the mouse Hover Enter/Leave work.

        3- While the scene does not update from inside, on every main-window maximizing the scene is redrawn and it reacts to all user action done at once( only one time).

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

          Can you update your Qt version ? If you can't leave the 5.12 series, try the latest patch release.

          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
          • M.H.HM Offline
            M.H.HM Offline
            M.H.H
            wrote on last edited by
            #5

            Sure, I'll do it and check the problem.

            1 Reply Last reply
            0
            • M.H.HM Offline
              M.H.HM Offline
              M.H.H
              wrote on last edited by
              #6

              It seems solved by updating the Qt though I checked my code on Ubuntu. It has not happened. So, I think the bug source might be MinGW. I hope I won't see it again.

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

                I'd rather go with a platform issue rather than a compiler one. In any case, glad it's fixed :-)

                Since it's working now, please mark the thread as solved so other forum users may know a solution has been found :-)

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

                M.H.HM 1 Reply Last reply
                0
                • SGaistS SGaist

                  I'd rather go with a platform issue rather than a compiler one. In any case, glad it's fixed :-)

                  Since it's working now, please mark the thread as solved so other forum users may know a solution has been found :-)

                  M.H.HM Offline
                  M.H.HM Offline
                  M.H.H
                  wrote on last edited by
                  #8

                  @SGaist Thanks for your help.

                  1 Reply Last reply
                  0

                  • Login

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