Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog
QtWS25 Last Chance

QFileDialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.6k Views
  • 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.
  • PuntP Offline
    PuntP Offline
    Punt
    wrote on last edited by
    #1

    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
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Test this:

      if(filename.isEmpty())
      QMessageBox::warning(....)
      
      PuntP 1 Reply Last reply
      2
      • ? A Former User

        Test this:

        if(filename.isEmpty())
        QMessageBox::warning(....)
        
        PuntP Offline
        PuntP Offline
        Punt
        wrote on last edited by
        #3

        @HenrikSt.

        It's working thanks !

        What about warnings ?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hi. Good news...

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

          PuntP 1 Reply Last reply
          0
          • ? A Former User

            Hi. Good news...

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

            PuntP Offline
            PuntP Offline
            Punt
            wrote on last edited by
            #5

            @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(...);

            kshegunovK 1 Reply Last reply
            0
            • PuntP Punt

              @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(...);

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              @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
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

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

                PuntP 1 Reply Last reply
                0
                • ? A Former User

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

                  PuntP Offline
                  PuntP Offline
                  Punt
                  wrote on last edited by
                  #8

                  @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
                  }
                  
                  kshegunovK 1 Reply Last reply
                  0
                  • PuntP Punt

                    @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
                    }
                    
                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

                    @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
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved