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. When I do addWidget, the screen flickers.
Forum Update on Monday, May 27th 2025

When I do addWidget, the screen flickers.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 505 Views
  • 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    Creates one title bar object. And when popping up each ui class, pass the title bar object pointer as a constructor argument.

    AddWidget to frame the pointer received as an argument from each ui class.
    Up to this point, there is nothing wrong.

    If you end the UI class and addWidget again the title bar on the main screen, the screen will flicker momentarily.

    How can I solve this?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      What is a "title bar object"? What does "frame the pointer" mean? What does "end the UI class" mean? What does "addWidget again the title bar" mean?

      You will have to explain what you are doing and demonstrate it somehow because I doubt anybody will understand otherwise.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        IknowQT
        wrote on last edited by IknowQT
        #3

        @ChrisW67

        I explained it in my own way.

        Create widget A in the constructor of the main widget.

        The main widget is composed of a vertical layout and has 3 frames. For simplicity, I will say M_1, M_2, M_3.

        I added a widget called A to frame M_1. And it pops up widget B. At this time, the object pointer of widget A is passed to widget B.
        And widget B is also composed of three vertical layouts.
        For simplicity, I'll say B_1, B_2, B_3.

        Add widget A to frame B_1. So far it's working fine. After that, close the widget named B. When closing, add again to the main widget M_1.
        At this time, there is a momentary flickering phenomenon.

        At first I thought it was because of the different layout sizes of the widgets.
        The same phenomenon appears when testing with all sizes fixed.

        b8832c3a-fed9-479d-aa54-8ff394454987-7.gif

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          So, in your animated gif, "A" is the button "Spectrum"? It does not appear in Widget "B" which I assume is the other set of widgets we see.

          Removing a widget from a layout, or adding a widget, will cause the layout to re-evaluate positioning and redraw the view. This seems liklely to be the cause of the "flicker".
          What are you trying to achieve by moving widget A between parent widgets?

          I 1 Reply Last reply
          0
          • C ChrisW67

            So, in your animated gif, "A" is the button "Spectrum"? It does not appear in Widget "B" which I assume is the other set of widgets we see.

            Removing a widget from a layout, or adding a widget, will cause the layout to re-evaluate positioning and redraw the view. This seems liklely to be the cause of the "flicker".
            What are you trying to achieve by moving widget A between parent widgets?

            I Offline
            I Offline
            IknowQT
            wrote on last edited by
            #5
            This post is deleted!
            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