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. Glitch when resize widget in a layout
Forum Updated to NodeBB v4.3 + New Features

Glitch when resize widget in a layout

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 744 Views 2 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.
  • T Offline
    T Offline
    tnn24
    wrote on 10 Dec 2023, 15:08 last edited by
    #1

    I encountered a glitch when resize widgets in a layout
    Here is the video: https://mega.nz/file/ISJCRA4Q#sqWrb8IlKNO9LVQ0QJufiPNkVYyK7UFH6lq80m_S4_8
    (You may need to download this video to view it offline if your browser doesn't support playing this video)

    Here is a brief structure of these components:
    QScrollArea -> parentWidget (just a QWidget) -> QVBoxLayout -> [widget1, widget2, widget3, stretch]
    widget1, widget2, widget3 are custom widgets. In the video, I show widget2 and widget3.
    When clicked on the header of a widget, it triggers an animation. This animation works on minimumHeight and maximumHeight attribute, making that widget fold or unfold.
    As you can see, unfolding widget2 or widget3 can cause a glitch. This glitch only happens when total size of all widgets [widget1, widget2, widget3] go beyond the edge of the window (i.e. parentWidget becomes too big and QScrollArea will need a scrollbar)
    Which causes this glitch and how to fix this?
    I use Qt 5.15.8 on OpenSUSE Leap 15.5
    Many thanks!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Dec 2023, 19:37 last edited by
      #2

      Hi and welcome to devnet,

      First thing I would do is to try with a more recent version of Qt. There have been several releases since 5.15.8.

      One thing you could try is to force the scroll bar to be off until the animation ends and then allow it to appear.

      Hope it helps.

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

      A T 2 Replies Last reply 10 Dec 2023, 19:41
      1
      • S SGaist
        10 Dec 2023, 19:37

        Hi and welcome to devnet,

        First thing I would do is to try with a more recent version of Qt. There have been several releases since 5.15.8.

        One thing you could try is to force the scroll bar to be off until the animation ends and then allow it to appear.

        Hope it helps.

        A Offline
        A Offline
        Axel Spoerl
        Moderators
        wrote on 10 Dec 2023, 19:41 last edited by
        #3

        I can’t watch the video. Just by reading, I think I know which glitch it is. It’s fixed in Qt 6, so you could try 6.2 or better 6.5.

        Software Engineer
        The Qt Company, Oslo

        T 1 Reply Last reply 11 Dec 2023, 12:53
        2
        • A Axel Spoerl
          10 Dec 2023, 19:41

          I can’t watch the video. Just by reading, I think I know which glitch it is. It’s fixed in Qt 6, so you could try 6.2 or better 6.5.

          T Offline
          T Offline
          tnn24
          wrote on 11 Dec 2023, 12:53 last edited by
          #4

          @Axel-Spoerl said in Glitch when resize widget in a layout:

          I can’t watch the video. Just by reading, I think I know which glitch it is. It’s fixed in Qt 6, so you could try 6.2 or better 6.5.

          I will migrate my code to Qt 6.5 and see if this issue is fixed or not, and I will provide an update on this issue later.
          Many thanks!

          1 Reply Last reply
          0
          • S SGaist
            10 Dec 2023, 19:37

            Hi and welcome to devnet,

            First thing I would do is to try with a more recent version of Qt. There have been several releases since 5.15.8.

            One thing you could try is to force the scroll bar to be off until the animation ends and then allow it to appear.

            Hope it helps.

            T Offline
            T Offline
            tnn24
            wrote on 16 Dec 2023, 12:20 last edited by tnn24
            #5

            @Axel-Spoerl said in Glitch when resize widget in a layout:

            I can’t watch the video. Just by reading, I think I know which glitch it is. It’s fixed in Qt 6, so you could try 6.2 or better 6.5.

            I migrated my project to Qt6 and built it with both Qt 6.2 on Ubuntu 22.04 and Qt 6.6 on openSUSE Tumbleweed. Sadly, the glitch is still there

            @SGaist said in Glitch when resize widget in a layout:

            Hi and welcome to devnet,

            First thing I would do is to try with a more recent version of Qt. There have been several releases since 5.15.8.

            One thing you could try is to force the scroll bar to be off until the animation ends and then allow it to appear.

            Hope it helps.

            Yes, scroll bar of QScrollArea is off the whole time

            Not sure if this is a bug in Qt or a problem in my code. If I provide a simple code that reproduces the problem, could you guys take a look?

            A 1 Reply Last reply 16 Dec 2023, 12:58
            0
            • T tnn24
              16 Dec 2023, 12:20

              @Axel-Spoerl said in Glitch when resize widget in a layout:

              I can’t watch the video. Just by reading, I think I know which glitch it is. It’s fixed in Qt 6, so you could try 6.2 or better 6.5.

              I migrated my project to Qt6 and built it with both Qt 6.2 on Ubuntu 22.04 and Qt 6.6 on openSUSE Tumbleweed. Sadly, the glitch is still there

              @SGaist said in Glitch when resize widget in a layout:

              Hi and welcome to devnet,

              First thing I would do is to try with a more recent version of Qt. There have been several releases since 5.15.8.

              One thing you could try is to force the scroll bar to be off until the animation ends and then allow it to appear.

              Hope it helps.

              Yes, scroll bar of QScrollArea is off the whole time

              Not sure if this is a bug in Qt or a problem in my code. If I provide a simple code that reproduces the problem, could you guys take a look?

              A Offline
              A Offline
              Axel Spoerl
              Moderators
              wrote on 16 Dec 2023, 12:58 last edited by
              #6

              @tnn24
              Yes, please provide a minimal reproducer!

              Software Engineer
              The Qt Company, Oslo

              T 1 Reply Last reply 16 Dec 2023, 16:51
              0
              • A Axel Spoerl
                16 Dec 2023, 12:58

                @tnn24
                Yes, please provide a minimal reproducer!

                T Offline
                T Offline
                tnn24
                wrote on 16 Dec 2023, 16:51 last edited by
                #7

                @Axel-Spoerl Here is a simple example that can reproduce the glitch: https://mega.nz/file/EHoWXZjK#8D81AYaX_c0CZy-YbOD8uigdBqCBbYEULecNQfggkuo
                When quickly click the fold/unfold button of widget 2, I can make the glitch happen.
                Please take a look. Many thanks!

                1 Reply Last reply
                0

                1/7

                10 Dec 2023, 15:08

                • Login

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