Widget Size when programm starts, how can I affect the size without setting max or min?



  • Hi,

    my research did not help me further. If I am starting my programm, my lowest Widget ist super big and the upper widget super small. I can change it with my Splitter, but how can I change it by code?



  • This post is deleted!

  • Moderators

    Hi! Please provide a screenshot, diagram or code.



  • I found the setStretchFactor method or setStreched. It is just possible with layouts, not with widgets itself. But it does not work properly. The stretch factor 1 is enough to change the upper widget to the super big size and the lower widget to the super small size. It is really confusing.
    Does somebody used it before and can give me some advice, maybe I forgot a declaration when setting the widget?

    @Wieland thanks for your comment, I dont have code for that, maybe thats the problem, I did it with qt designer. 0_1502291554051_Splitter.png



  • The setSizes method with a qlist is working better. I just take the half of the complete mainwindow and I get what I want.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.