tags:

views:

578

answers:

1

Hi all,

I'm using Ruby Qt bindings.

I'm trying to make a square widget (checker board), but it doesn't seem to work. This is the code that I tried

What is the proper way to making a widget that maintains it's aspect ratio?

+2  A: 

See this question: How to maintain widget's aspect ratio in Qt?

Georg
this doesn't seem to work for me with Ruby bindings
SimonV
Have you tried subclassing QLayout?
Georg
I've sub classed QGridLayout and implemented sizePolicy,hasHeightForWidth,heightForWidth(w)I haven't implemented setGeometry, and this is my main suspect right now. As for the other functions listed there, I figured they were related to having a single item in the layout, is this correct?
SimonV
I've implemented setGeometry and I can see the effect now... Now the layout and it's content aspect ratio is maintained but the aspect ratio of the main window isn't.
SimonV
I haven't done it myself, but in that post is a lot of information. There are also some links to the Qt documentation.
Georg
I've just seen that there's a complete example at the first link.
Georg