Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2007
Extending QFileDialog in qt4 with custom widget


Message 1 in thread

I want to add a widget on side of the "save file" dialog, that will
contain custom Widget with extra options dependent on which file type
is selected in the filters (like manipulating JPEG quality if user
picks *.jpg, etc ....)
However, when I looked at QFileDialog documentation, I saw no function
allowing me to insert a custom widget in the dialog and if I extend
the QFileDialog class, trying to forcing in some extra widgets in
constructor, it may be tricky, as the dialog have changed between 4.2
and 4.3 and may change further in newer versions...

I thought about cutting the QFileDialog from QT source tree and
customizing it, however this may be a bit tricky too, due to classes
like QFileDialogPrivate, which in turn include other "private"
classes, like QFileSystemModel ... and if these classes differ in
multiple platforms (like different implementations in X11 and Windows)
I may run in further trouble.

I also thought about stuffing the QFileDialog as children widget
somewhere (in one window with my custom widget), howewer QDialog from
which QFileDialog inherits does not allow this.

Is there some simple way to enhance the save dialog with extra widget
that will react on changing the file filter?

Martin Petricek

--
 [ signature omitted ]