Hi all,
For several of my apps, I use an enhanced version of QFileDialog, that
adds some extra widgets to the bottom of the dialog so that the user
can specify options about how to load his file.
This worked fine in Qt 4.4.x, but under Qt 4.5.0-tp1 (MacOS/X version)
my extra widgets don't appear. (They do appear under Linux, FWIW).
Below is a trivial example app showing what I do. Note that when
built against Qt 4.4.2, this app's file dialog shows the "This is my
extra widgets' area" label at the bottom of the dialog, but when built
against Qt 4.5.0-tp1, the label is missing.
Am I doing something wrong, or is this a bug in Qt-4.5.0-tp1? FWIW,
calling setOption(DontUseNativeDialog) in the QFileDialog constructor
doesn't make any difference.
-Jeremy
--------------------
#include <QApplication>
#include <QFileDialog>
#include <QGridLayout>
#include <QLabel>
class EnhancedFileDialog : public QFileDialog
{
public:
EnhancedFileDialog(QWidget * parent) : QFileDialog(parent)
{
setViewMode(Detail);
QWidget * extras = new QLabel(tr("This is my extra widgets'
area"), this);
QGridLayout * gl = dynamic_cast<QGridLayout*>(layout());
if (gl)
{
int r = gl->rowCount();
gl->addWidget(extras, r, 0, 1, gl->columnCount(),
Qt::AlignCenter);
gl->setRowStretch(r, 0);
}
}
};
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
EnhancedFileDialog afd(NULL);
afd.show();
return app.exec();
}
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback