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. Are there existing ways to move several instances of QWidget simultaneously, without jittering?
Forum Updated to NodeBB v4.3 + New Features

Are there existing ways to move several instances of QWidget simultaneously, without jittering?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 346 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.
  • N Offline
    N Offline
    nen777w
    wrote on last edited by
    #1

    I have several instances of QWidget objects. One of them is a chief widget, rest are the child-widgets.
    When I move the chief widget all child-widgets should move on the same offset.
    I tried to implement it in two ways:

    1. In the chief widget call installEventFilter() for each child-widgets and move controlled for QEvent::Move event.
    2. Override void moveEvent(QMoveEvent* event) in chief-widget and call move for each child-widgets.

    It works, but I observe the jittering when child-widgets move in both cases.
    I suppose it happens due to the not-synchronous widgets redrawing.
    Is it possible to solve this problem with special Qt-tricks?

    JonBJ 1 Reply Last reply
    0
    • N nen777w

      I have several instances of QWidget objects. One of them is a chief widget, rest are the child-widgets.
      When I move the chief widget all child-widgets should move on the same offset.
      I tried to implement it in two ways:

      1. In the chief widget call installEventFilter() for each child-widgets and move controlled for QEvent::Move event.
      2. Override void moveEvent(QMoveEvent* event) in chief-widget and call move for each child-widgets.

      It works, but I observe the jittering when child-widgets move in both cases.
      I suppose it happens due to the not-synchronous widgets redrawing.
      Is it possible to solve this problem with special Qt-tricks?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @nen777w
      I admit I have not tried, but if you mean they others are child widgets of the "chief" widget and you move that, I would have expected the child widgets to move with it, maintaining their relative positions. You say they do not? Are you using layouts to position children within parent or not?

      N 1 Reply Last reply
      0
      • JonBJ JonB

        @nen777w
        I admit I have not tried, but if you mean they others are child widgets of the "chief" widget and you move that, I would have expected the child widgets to move with it, maintaining their relative positions. You say they do not? Are you using layouts to position children within parent or not?

        N Offline
        N Offline
        nen777w
        wrote on last edited by
        #3

        @JonB No, I just use words "chief" and "child" instead of the "master" and "slave".
        In any case, these widgets are independent of each other but should move together.

        JoeCFDJ 1 Reply Last reply
        0
        • N nen777w

          @JonB No, I just use words "chief" and "child" instead of the "master" and "slave".
          In any case, these widgets are independent of each other but should move together.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @nen777w not sure how you lay them out. One possible way to try:
          create a widget to hold all of them and move this widget.

          N 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @nen777w not sure how you lay them out. One possible way to try:
            create a widget to hold all of them and move this widget.

            N Offline
            N Offline
            nen777w
            wrote on last edited by
            #5

            @JoeCFD In this case, if the child-widget is out of the chief widget it will not be visible.

            JoeCFDJ 1 Reply Last reply
            0
            • N nen777w

              @JoeCFD In this case, if the child-widget is out of the chief widget it will not be visible.

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              @nen777w that may not be true. Show your layout please.

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nen777w
                wrote on last edited by nen777w
                #7

                Hm....!
                Interesting found!
                If I call for the child-widget

                setWindowFlags(Qt::ToolTip);
                

                the jittering disappears. It looks like it helps to synchronize widget painting.
                Or even better:

                Qt::Window|Qt::FramelessWindowHint
                

                p.s.
                My fault.
                The problem is not solved.
                I played with that and found that these flags do not eliminate jittering completely, they just make it less obvious.

                JoeCFDJ 1 Reply Last reply
                1
                • N nen777w

                  Hm....!
                  Interesting found!
                  If I call for the child-widget

                  setWindowFlags(Qt::ToolTip);
                  

                  the jittering disappears. It looks like it helps to synchronize widget painting.
                  Or even better:

                  Qt::Window|Qt::FramelessWindowHint
                  

                  p.s.
                  My fault.
                  The problem is not solved.
                  I played with that and found that these flags do not eliminate jittering completely, they just make it less obvious.

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by
                  #8

                  @nen777w Good for you. Interesting. No sure how this flag is related to jittering.

                  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