PDA

View Full Version : change arrangement of radiobttons at runtime



tuli
6th October 2012, 08:54
Hi,

i have a widget that is used in several larger widgets and should take as little space as possible. It`s basically 4 radio buttons.
Depending on the location of the widget and available space, it would advantageous to have one of these two arrangements:

12
34

and

1234

if the width is small, i`d go for a), if the height is limited, for b).

Is there any way i can implement this without having to fiddle with layouts at runtime?

Zlatomir
6th October 2012, 09:47
I don't know what you mean by "fiddle" with layouts, but most likely you must play with layouts to change layouts.

An idea is to create functionality (in separate* a class) that change the layout from one state to the other, it should be pretty easy to do... and if you have problems you can post the code.
*by "separate" i mean create a QWidget derived class that contains the buttons together with the functionality the change the layouts.