When I do addWidget, the screen flickers.
-
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?
-
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.
-
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. -
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? -
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?