2

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 its aspect ratio?

Daniel Hedberg
  • 5,677
  • 4
  • 36
  • 61
SimonV
  • 511
  • 5
  • 12

1 Answers1

1

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

Community
  • 1
  • 1
Georg Schölly
  • 124,188
  • 49
  • 220
  • 267
  • 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 Mar 19 '09 at 19:13
  • 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 Mar 19 '09 at 19:26
  • 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 Schölly Mar 19 '09 at 20:48
  • I've just seen that there's a complete example at the first link. – Georg Schölly Mar 19 '09 at 20:48