Congratulations to our 2022 Qt Champions!


  • Hi,

    i'm doing

        QString homePath = QDir::currentPath();
        QString filename = QFileDialog::getSaveFileName(this, "Enregistrer sous...", homePath, "Configuration (*.xml)");
        saveConf(filename);  //which create a XML etc... (this function is working)

    But here, if I manually close the QFileDialog, what happen ?

    I would like to do something like :

    if( myQFileDialogIsClosedOrFailedOrWhateverYouWant ){

    is it possible to do that ?

    By the way, is there a problem with QFileDialog on W10 ?

    When I use it there's warning like

    shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](1) tid(2b88) 80070490 Élément introuvable.

  • Test this:


  • @HenrikSt.

    It's working thanks !

    What about warnings ?

  • Hi. Good news...

    What about warnings?
    I don't know what you mean but you can you QMessageBox...

  • @HenrikSt.

    Sorry I was busy..

    these warnings :

    shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](3) tid(5f4) 80070490 Élément introuvable.
    shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](4) tid(5f4) 80070490 Élément introuvable.

    When I use getSaveFileName(...);

  • Moderators

    My French is pretty rudimentary, but "Élément introuvable" is a bit confusing. I don't understand what element can't be found, and somehow this comes from comdlg32 ...
    I think you're safe to ignore these warnings for now, but if you find any strange effects do tell.

  • Maybe you cab post your completely code here for understanding the error ?

  • @HenrikSt.

    void myClass::on_pushSaveCom_clicked(){ //On click QPushButton (save my configuration)
          //set some variable according to my UI
          QString homePath = QDir::currentPath();
          QString path = QFileDialog::getSaveFileName(this, "Enregistrer sous...", homePath, "Configuration (*.xml)");
          saveConf(path); //which create the new XML according to my new value set earlier in this function

  • Moderators

    Your code looks fine to me. So as I said, I think it's safe to ignore those warnings for now. If you observe some side effect, report it here again so we could attempt to track it down.

Log in to reply