Flickering of widgets when created with nullptr as parent

  • Hello everyone,
    I am trying to create two qwidgets and each of them have few dynamically created labels and checkboxes. The two widgets body is constructed using designer and layout is also provided here.Now when i create these widgets i provide nullptr as parent and later add them in the layout. But when i open up the the widget i can see a window for every label and check box for fraction of second and then i see in the layout. This action seems to be like flickering, and how can i avoid it. Thank you

  • Lifetime Qt Champion


    Please show the code you are using.

  • Moderators

    simple answer: don't set a nullptr parent. Use a already hidden parent widget for example.

Log in to reply