Dear Maintainer,
I wrote program QFileDialog to select file(s).
With non-native dialog (Qt owned, not Desktop-Environment's), this is very slow.
This widget eats a lot of CPU time usage at creating , also move to some directories.
--- Sample ---
#include <QFileDialog>
void foo::open_dialog(QString& _dir, QStringList& _filter_list)
{
QFileDialog* dlg = new QFileDialog(nullptr);
dlg->setAttribute(Qt::WA_DeleteOnClose, true);
dlg->setOption(QFileDialog::ReadOnly, (is_save) ? false : true);
dlg->setOption(QFileDialog::DontUseCustomDirectoryIcons, true);
dlg->setAcceptMode(QFileDialog::AcceptOpen);
dlg->setFileMode(QFileDialog::ExistingFile);
// [1]
dlg->setOption(QFileDialog::DontUseNativeDialog, true);
// [2]
//dlg->setViewMode(QFileDialog::Detail);
dlg->setViewMode(QFileDialog::List);
// Below connection is sample.Any slots may exist.
connect(dlg, SIGNAL(fileSelected(QString)), this, SLOT(read_file(QString)));
connect(dlg, SIGNAL(finished(int)), this, SLOT(finished_dialog_slot(int)));
connect(dlg, SIGNAL(destroyed()), this, SLOT(close_dialog_slot()));
dlg->setDirectory(_dir);
dlg->setNameFilters(_filter_list);
dlg->setModal(false);
dlg->open();
}
--- END SAMPLE ---
This regression don't happen with Qt 5.x, at least 5.15.
# I forgot for older minor version, i.e. 5.6 ...
But, with Qt 6.x (also 6.2! not only 6.4!), this regression always happenes.
[1] When this option set to false, use theme's file-selector (i.e. Gtk, Mate, XDG...).
[2] Set with both List and Detail, seems to be no difference.
Best regards,
Kyuma Ohta.
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?
*** End of the template - remove these template lines ***