SLC
SLC

Reputation: 2207

Qt Creator I can't change/find the sizeHint in the widget property panel

I'm using custom compiled Qt libraries version 4.8.5 with MinGW GCC 4.8.2 along with Qt Creator 3.0.1 and I'm trying to set the sizeHint of two Tab Widgets inside a Horizontal Splitter under the Central Widget in order to have the left tab widget occupy less space than the right one. I found this answer that describes the layout mechanism a little and it says that this can be achieved with the sizeHint widget property. However I can't find find the sizeHint property inside the widget properties panel. There's only sizePolicy, minimumSize and mazimumSize (geometry is locked since it's inside a splitter). Trying to add that property manually gives me a message that the property already exists but I can't find it anywhere.

Does this property exists only in Qt libraries 5x or older 4x versions? Do I have to do this manually in C++ or can be done without programming? Where can I set this property inside the Qt Creator?

Upvotes: 2

Views: 3600

Answers (1)

elephant
elephant

Reputation: 149

You may use layout's stretch feature. When you have 2 widgets in, say, QHBoxLayout, the default is to give them equal space. But look at the "stretch" property. If you set it to "1,2", you get first one to occupy 1/(1+2) of the layout space and second to 2/(1+2).

Upvotes: 4

Related Questions