There is no "single click behavior" in the Qt 4.7 QFileDialog (or AFAICT in Linguist) whether I use the native (KDE) or generic dialog. This complete example works perfectly fine here:
#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
// That's your code without the heap allocation
fd.setObjectName("fileopendialog");
qDebug() << fd.exec();
qDebug() << fd.selectedFiles();
return 0;
}
#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString fdcapt = QObject::tr("File dialog caption");
QString textdir(".");
// That's your code without the heap allocation
QFileDialog fd(0, fdcapt, textdir );
fd.setObjectName("fileopendialog");
fd.setViewMode(QFileDialog::List);
fd.setFileMode( QFileDialog::ExistingFile );
fd.setAcceptMode(QFileDialog::AcceptOpen);
qDebug() << fd.exec();
qDebug() << fd.selectedFiles();
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks