View Full Version : QFileDialog

28th November 2007, 22: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, 14:22

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.

29th November 2007, 14: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!