Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QFileDialog

    General and Desktop
    3
    9
    2285
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Punt
      Punt last edited by

      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 ){
          QMessageBox::warning(......);
      else
          saveConf(filename);
      }
      

      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.
          CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData]
      
      1 Reply Last reply Reply Quote 0
      • H
        HenrikSt. last edited by

        Test this:

        if(filename.isEmpty())
        QMessageBox::warning(....)
        
        Punt 1 Reply Last reply Reply Quote 2
        • Punt
          Punt @HenrikSt. last edited by

          @HenrikSt.

          It's working thanks !

          What about warnings ?

          1 Reply Last reply Reply Quote 0
          • H
            HenrikSt. last edited by

            Hi. Good news...

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

            Punt 1 Reply Last reply Reply Quote 0
            • Punt
              Punt @HenrikSt. last edited by

              @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.
                  CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData] 
              shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](4) tid(5f4) 80070490 Élément introuvable.
                  CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData] 
              

              When I use getSaveFileName(...);

              kshegunov 1 Reply Last reply Reply Quote 0
              • kshegunov
                kshegunov Moderators @Punt last edited by

                @Punt
                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.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply Reply Quote 0
                • H
                  HenrikSt. last edited by

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

                  Punt 1 Reply Last reply Reply Quote 0
                  • Punt
                    Punt @HenrikSt. last edited by

                    @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)");
                          if(path.isEmpty())
                                return;
                    
                          saveConf(path); //which create the new XML according to my new value set earlier in this function
                    }
                    
                    kshegunov 1 Reply Last reply Reply Quote 0
                    • kshegunov
                      kshegunov Moderators @Punt last edited by

                      @Punt
                      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.

                      Read and abide by the Qt Code of Conduct

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post