Important: Please read the Qt Code of Conduct -

QFileDialog very slow reaction

  • Hello!!

    I want to show a QFileDialog to open .raw files. I have this function associated to a QPushButton:

    void settingsWindow::on_buttonRawPath_clicked()
        m_sRawPath = QFileDialog::getOpenFileName(NULL, "Select RAW file...", tr("C:/borrar"), tr("RAW Files (*.raw)"));
        m_sRawPath = "";

    But this doesn't work very well. If I repeat the process several times the application remains frozen and it takes a long time to react.

    Do you see something wrong?

    Thank you very much!

  • Lifetime Qt Champion

    @ivanicy I don't see anything wrong. Are you sure it is slow because of on_buttonRawPath_clicked()?
    You did not say when it is actually frozen. Is it when you open the file dialog?
    Did you try with other directories (instead of c:/borrar)?
    Did you try to disable anti-virus software?

  • @jsulm Thank you for your answer. Well, I extract this part to another project and it works perfectly. So it must be another thing. I call this dialog in another window of the application. I initialize the window in the mainwindow constructor and I launch it when I push a button using window->show().

Log in to reply