PDA

View Full Version : QFileDialog



ToddAtWSU
28th November 2007, 21:36
I am trying to subclass a QFileDialog by adding some extra buttons to it on a side of the dialog. In Qt3 there were some functions called addLeftWidget( ), addRightWidget( ), addWidget( ). But I cannot find this anywhere in the Qt4 documentation. Is there a simple way to do this in Qt without writing a whole entire File Dialog myself? Thanks!

Khal Drogo
29th November 2007, 13:22
Greetings.

I hope i won't lead you on a wrong trail, because i haven't tried this myself, but:

QFileDialog almost certainly has a layout, accessible with the layout() method.
Based on what layout it is, probably a QGridLayout, you can use one of the overloaded addWidget() methods of that particular class.

Good luck.

ToddAtWSU
29th November 2007, 13:36
Yeah I can try that. It would just be nice if they had the convenience functions like they did in Qt3 so it doesn't matter what style of layout they use, it would be fail-safe. Now if they change the layout (though very unlikely) my code could break in a future version of Qt. But this probably is the best route I can go as of right now. Thanks for the idea!