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. How to fix error code code: 0x8001010e when using getSaveFileName
Forum Updated to NodeBB v4.3 + New Features

How to fix error code code: 0x8001010e when using getSaveFileName

Scheduled Pinned Locked Moved Unsolved General and Desktop
25 Posts 4 Posters 8.2k 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.
  • 1 11hours
    14 Jun 2017, 05:11

    @joeQ Sorry my English is so poor. I mean I wanna make a short post.
    and yes, i got same error code of 0x8001010e by using slot-signal.

    J Offline
    J Offline
    joeQ
    wrote on 14 Jun 2017, 05:24 last edited by
    #10

    @11hours Hi, friend,

    void MainWindow::SaveFile()
    {
        QString xlsFile = QFileDialog::getSaveFileName(this, QString("111"),
                   QString("E:/GoogleDrive/Projects/QT/FRACTURE/test.xlsx"),
                   QString("excel(*.xls *.xlsx)"),
                   &QString("excel(*.xls *.xlsx)"), QFileDialog::ShowDirsOnly); ///< why you used the & ???
    
    }
    

    Just do it!

    1 Reply Last reply
    2
    • 1 11hours
      14 Jun 2017, 05:11

      @joeQ Sorry my English is so poor. I mean I wanna make a short post.
      and yes, i got same error code of 0x8001010e by using slot-signal.

      J Offline
      J Offline
      joeQ
      wrote on 14 Jun 2017, 05:35 last edited by
      #11

      @11hours

      Hi, friend, i am so worry not to watch you code careful. the below code is ok in my Mac OS.

      I think you used wrong about selectedFilter.

      #include "widget.h"
      #include <QFileDialog>
      #include <QTimer>
      #include <QDebug>
      
      Widget::Widget(QWidget *parent)
          : QWidget(parent)
      {
          QTimer::singleShot(1000,this,&Widget::StSaveFile);
      }
      
      Widget::~Widget()
      {
      
      }
      
      void Widget::StSaveFile()
      {
          QString filter = QString("excel(*.xls *.xlsx)");
          QString selFile = QFileDialog::getSaveFileName(this,
                                                         QString("111"),
                                                         QString("E:/GoogleDrive/Projects/QT/FRACTURE/test.xlsx"),
                                                         QString("excel(*.xls *.xlsx)"),
                                                         &filter, QFileDialog::ShowDirsOnly);
          qDebug() << selFile;
      }
      

      Just do it!

      1 1 Reply Last reply 14 Jun 2017, 06:10
      0
      • J joeQ
        14 Jun 2017, 05:35

        @11hours

        Hi, friend, i am so worry not to watch you code careful. the below code is ok in my Mac OS.

        I think you used wrong about selectedFilter.

        #include "widget.h"
        #include <QFileDialog>
        #include <QTimer>
        #include <QDebug>
        
        Widget::Widget(QWidget *parent)
            : QWidget(parent)
        {
            QTimer::singleShot(1000,this,&Widget::StSaveFile);
        }
        
        Widget::~Widget()
        {
        
        }
        
        void Widget::StSaveFile()
        {
            QString filter = QString("excel(*.xls *.xlsx)");
            QString selFile = QFileDialog::getSaveFileName(this,
                                                           QString("111"),
                                                           QString("E:/GoogleDrive/Projects/QT/FRACTURE/test.xlsx"),
                                                           QString("excel(*.xls *.xlsx)"),
                                                           &filter, QFileDialog::ShowDirsOnly);
            qDebug() << selFile;
        }
        
        1 Offline
        1 Offline
        11hours
        wrote on 14 Jun 2017, 06:10 last edited by
        #12

        @joeQ the code can get the correct file name.
        qDebug output the selFile : "E:/GoogleDrive/Projects/QT/FRACTURE/test.xlsx".
        but the it still throw the error code.

        J 1 Reply Last reply 14 Jun 2017, 06:18
        0
        • 1 11hours
          14 Jun 2017, 06:10

          @joeQ the code can get the correct file name.
          qDebug output the selFile : "E:/GoogleDrive/Projects/QT/FRACTURE/test.xlsx".
          but the it still throw the error code.

          J Offline
          J Offline
          joeQ
          wrote on 14 Jun 2017, 06:18 last edited by
          #13

          @11hours ok, let's test again.

          test the below code.

          QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"",tr("Images (*.png *.xpm *.jpg)"));
          qDebug()<< fileName
          

          Just do it!

          1 2 Replies Last reply 14 Jun 2017, 06:28
          0
          • J joeQ
            14 Jun 2017, 06:18

            @11hours ok, let's test again.

            test the below code.

            QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"",tr("Images (*.png *.xpm *.jpg)"));
            qDebug()<< fileName
            
            1 Offline
            1 Offline
            11hours
            wrote on 14 Jun 2017, 06:28 last edited by
            #14

            @joeQ it is still the same

            1 Reply Last reply
            0
            • J joeQ
              14 Jun 2017, 06:18

              @11hours ok, let's test again.

              test the below code.

              QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"",tr("Images (*.png *.xpm *.jpg)"));
              qDebug()<< fileName
              
              1 Offline
              1 Offline
              11hours
              wrote on 14 Jun 2017, 06:32 last edited by
              #15

              @joeQ I think it is because the method QT uses to call WINDOWS native dialog is not safe, so WINDOWS throw the error, right?

              J 1 Reply Last reply 14 Jun 2017, 07:07
              0
              • 1 11hours
                14 Jun 2017, 06:32

                @joeQ I think it is because the method QT uses to call WINDOWS native dialog is not safe, so WINDOWS throw the error, right?

                J Offline
                J Offline
                joeQ
                wrote on 14 Jun 2017, 07:07 last edited by joeQ
                #16

                @11hours

                From these test, i am sure this error is not your fault.

                did you used DontUseNativeDialog option, you can test it.

                
                QFileDialog::DontUseNativeDialog
                
                Do not use the native file dialog. By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro, or the platform does not have a native dialog of the type that you require.
                

                test code snippet

                QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"",tr("Images (*.png *.xpm *.jpg)"),0,QFileDialog::DontUseNativeDialog);
                qDebug()<< fileName
                ``

                Just do it!

                1 1 Reply Last reply 14 Jun 2017, 07:14
                0
                • J joeQ
                  14 Jun 2017, 07:07

                  @11hours

                  From these test, i am sure this error is not your fault.

                  did you used DontUseNativeDialog option, you can test it.

                  
                  QFileDialog::DontUseNativeDialog
                  
                  Do not use the native file dialog. By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro, or the platform does not have a native dialog of the type that you require.
                  

                  test code snippet

                  QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"",tr("Images (*.png *.xpm *.jpg)"),0,QFileDialog::DontUseNativeDialog);
                  qDebug()<< fileName
                  ``
                  1 Offline
                  1 Offline
                  11hours
                  wrote on 14 Jun 2017, 07:14 last edited by
                  #17

                  @joeQ yes, like I said before, if i use DontUseNativeDialog, there will be no error reported.

                  J 1 Reply Last reply 14 Jun 2017, 07:32
                  0
                  • 1 11hours
                    14 Jun 2017, 07:14

                    @joeQ yes, like I said before, if i use DontUseNativeDialog, there will be no error reported.

                    J Offline
                    J Offline
                    joeQ
                    wrote on 14 Jun 2017, 07:32 last edited by joeQ
                    #18

                    @11hours

                    From this, I think i got into problem same with you before. ok, you can use one macro in your program, use the windows native file dialog under release version, not use native file dialog under debug version.

                    void MainWindow::StOpenFile()
                    {
                        /** ... */
                    #ifdef DONT_USE_NATIVE_DIALOG
                        QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                               tr("Open files"),
                                                                               defaultDir,
                                                                               QString(STR_OPEN_FILE),
                                                                               0,
                                                                               QFileDialog::DontUseNativeDialog);
                    #else
                        QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                               tr("Open files"),
                                                                               defaultDir,
                                                                               QString(STR_OPEN_FILE));
                    #endif
                    
                    /** ... */
                    }
                    
                    

                    Just do it!

                    J 1 2 Replies Last reply 14 Jun 2017, 07:40
                    0
                    • J joeQ
                      14 Jun 2017, 07:32

                      @11hours

                      From this, I think i got into problem same with you before. ok, you can use one macro in your program, use the windows native file dialog under release version, not use native file dialog under debug version.

                      void MainWindow::StOpenFile()
                      {
                          /** ... */
                      #ifdef DONT_USE_NATIVE_DIALOG
                          QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                                 tr("Open files"),
                                                                                 defaultDir,
                                                                                 QString(STR_OPEN_FILE),
                                                                                 0,
                                                                                 QFileDialog::DontUseNativeDialog);
                      #else
                          QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                                 tr("Open files"),
                                                                                 defaultDir,
                                                                                 QString(STR_OPEN_FILE));
                      #endif
                      
                      /** ... */
                      }
                      
                      
                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 14 Jun 2017, 07:40 last edited by
                      #19

                      @joeQ Would be good to file a bug for this issue

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      J 1 Reply Last reply 14 Jun 2017, 07:48
                      0
                      • J jsulm
                        14 Jun 2017, 07:40

                        @joeQ Would be good to file a bug for this issue

                        J Offline
                        J Offline
                        joeQ
                        wrote on 14 Jun 2017, 07:48 last edited by
                        #20

                        @jsulm oh, my honor. but how to file a bug to qt team?

                        Just do it!

                        J 1 Reply Last reply 14 Jun 2017, 07:49
                        0
                        • J joeQ
                          14 Jun 2017, 07:48

                          @jsulm oh, my honor. but how to file a bug to qt team?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 14 Jun 2017, 07:49 last edited by
                          #21

                          @joeQ https://bugreports.qt.io/secure/Dashboard.jspa

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • J joeQ
                            14 Jun 2017, 07:32

                            @11hours

                            From this, I think i got into problem same with you before. ok, you can use one macro in your program, use the windows native file dialog under release version, not use native file dialog under debug version.

                            void MainWindow::StOpenFile()
                            {
                                /** ... */
                            #ifdef DONT_USE_NATIVE_DIALOG
                                QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                                       tr("Open files"),
                                                                                       defaultDir,
                                                                                       QString(STR_OPEN_FILE),
                                                                                       0,
                                                                                       QFileDialog::DontUseNativeDialog);
                            #else
                                QStringList ltFilePath = QFileDialog::getOpenFileNames(this,
                                                                                       tr("Open files"),
                                                                                       defaultDir,
                                                                                       QString(STR_OPEN_FILE));
                            #endif
                            
                            /** ... */
                            }
                            
                            
                            1 Offline
                            1 Offline
                            11hours
                            wrote on 14 Jun 2017, 08:14 last edited by
                            #22

                            thank you @joeQ.
                            I'm sure now, the error also happens under release version, cause I tried using VS to compile, and it reported the same error under release version.
                            I don't know why QT does not report it.
                            I decide ignore the error temporarily.
                            thank you guys!

                            1 Reply Last reply
                            0
                            • 1 Offline
                              1 Offline
                              11hours
                              wrote on 15 Jun 2017, 03:00 last edited by
                              #23

                              although this problem is not solved yet, it seems like another issue in COM technology. I guess, in WINDOWS system, qFileDialog calls FileDialog in WINDOWS API.

                              J 1 Reply Last reply 15 Jun 2017, 03:15
                              0
                              • 1 11hours
                                15 Jun 2017, 03:00

                                although this problem is not solved yet, it seems like another issue in COM technology. I guess, in WINDOWS system, qFileDialog calls FileDialog in WINDOWS API.

                                J Offline
                                J Offline
                                joeQ
                                wrote on 15 Jun 2017, 03:15 last edited by
                                #24

                                @11hours did you move your programer to another computer to test it ? win7? or win10? or 64bit Qt etc.

                                Just do it!

                                1 1 Reply Last reply 16 Jun 2017, 14:06
                                0
                                • J joeQ
                                  15 Jun 2017, 03:15

                                  @11hours did you move your programer to another computer to test it ? win7? or win10? or 64bit Qt etc.

                                  1 Offline
                                  1 Offline
                                  11hours
                                  wrote on 16 Jun 2017, 14:06 last edited by
                                  #25

                                  @joeQ sorry, my friend. I was out of the earth without internet yesterday. I have't tried yet. Let me find some other computers.

                                  1 Reply Last reply
                                  0
                                  • B bdieterm referenced this topic on 29 May 2023, 20:25

                                  19/25

                                  14 Jun 2017, 07:40

                                  • Login

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