Linked by Thom Holwerda on Tue 1st Dec 2009 19:03 UTC, submitted by poundsmack
Qt Nokia has released the latest version of its cross-platform toolkit Qt, version 4.6. As usual, it comes with a whole slew of improvements and new features, and this time, they even added a new platform into the mix.
Thread beginning with comment 397365
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: KDE
by leos on Tue 1st Dec 2009 21:16 UTC in reply to "RE[2]: KDE"
leos
Member since:
2005-09-21

I actually like GTK. In my limited experience, in GTK, more typing is involved, but things make more sense and it's easier to get things right. In particular, I like how containers (that provide layouts) are widgets themselves, meaning that you can put a complex layout with multiple widgets in it anywhere that you could put a single widget. That's not true in Qt (at least, not without a little extra work): there, layouts are a separate entity from widgets.


Normally you would insert a widget and set the layout inside that widget to get the behaviour you describe.

This bit me recently trying to create a push-button in Qt that could accommodate arbitrary child widgets and layouts: that's just there in GTK, but I had to sub-class QFrame in Qt and override the mouseReleaseEvent (which got the job done, save for the minor quibble that the result doesn't look like a normal QPushButton).


I'm curious why you wanted this? A huge button with arbitrary widgets inside? How would that even work if those widget should interact with input? Push buttons accept images and text, I don't think you should be putting other widgets inside one.

Reply Parent Score: 5

RE[4]: KDE
by boldingd on Tue 1st Dec 2009 21:36 in reply to "RE[3]: KDE"
boldingd Member since:
2009-02-19

Heh, well, partly because we didn't want them to look like QPushButtons: we just wanted images you could click on, without the border or background-gradient. (So, when I complained that they "didn't look like QPushButtons," what I guess I should have said was, "most of QFrame's borders where too ugly to use.") Also, for whatever reason, when I used QPushButtons, they didn't size themselves properly (I think: they didn't show up, and my theory at the time was that they where requesting a zero size allocation, for some reason).

Reply Parent Score: 2

RE[5]: KDE
by vivainio on Tue 1st Dec 2009 21:51 in reply to "RE[4]: KDE"
vivainio Member since:
2008-12-26

Heh, well, partly because we didn't want them to look like QPushButtons: we just wanted images you could click on, without the border or background-gradient.


Stylesheets can come in handy for cases like this:

http://doc.trolltech.com/4.6/stylesheet-examples.html#customizing-q...

Reply Parent Score: 4