Pushbuttons with fixed aspect ratios?
I'm back with another stupid newbie question.
I have an app with a screen with a row of QPushbuttons. The customer wishes to be able to re-size the screen and have the buttons re-size with it. But they want the buttons to maintain their aspect ratio. That is, if a button is twice as wide as it is tall, it should keep that ratio of width to height no matter how the button changes its size.
I have experimented with various size policies in Qt Designer, but none of them seem to command the button(s) to obey the initial aspect ratio. Am I missing something? Or is there a way to do this programatically?
Re: Pushbuttons with fixed aspect ratios?
Take a look at baseSize and sizeIncrement.
Re: Pushbuttons with fixed aspect ratios?
Thank you. Unfortunately it appears that I am out of luck. I am developing for the Windows platform.
In the documentation for sizeIncrement it says: Warning: The size increment has no effect under Windows, and may be disregarded by the window manager on X.
I did try setting the QPushButtons' size increment to 1,1 and the base size to the desired values, but in the application it had no apparent effect with respect to maintaining the aspect ratio while the window was re-sized.
Thank you anyway.
Re: Pushbuttons with fixed aspect ratios?
In that case you might want to subclass the button class and use heightForWidth to return a square size.