Results 1 to 4 of 4

Thread: qfile dialog error

  1. #1
    Join Date
    Oct 2016
    Posts
    61
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default qfile dialog error

    Hi i was checking to modify the content of one file but show me this error:
    shell\comdlg32\fileopensave.cpp(14247)\comdlg32.dl l!77B01E65: (caller: 77B3268C) ReturnHr(1) tid(2114) 80004005 Error no especificado
    CallContext:[\PickerModalLoop]

    What does it mean? I was only creating the file and writing.
    I think is because for this line:
    myfile.setFileName(QFileDialog::getSaveFileName(th is,"myfile"));

    Show me this error

  2. #2
    Join Date
    Oct 2016
    Posts
    61
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: qfile dialog error

    it's for this
    ui->textfield->setText(QFileDialog::getOpenFileName(this,"Abri r archivo"));

    Anyways i tried to update with the example of qt 5.7 and take me the same error. I think it's a bug for windows 10.
    I was thinking that was solved but i think it's not possible to solve it.

  3. #3
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: qfile dialog error

    I'm going to go out on a limb and guess that QFileDialog::getOpenFileName works on Windows 10. What's the stack trace when your program crashes?
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qfile dialog error

    ui->textfield->setText(QFileDialog::getOpenFileName(this,"Abri r archivo"));
    It is never a good idea to write statements like this which do no error checking and make it more difficult to find an error if it occurs.

    Is "this" a valid pointer at the place where you use it? If the object that "this" points to isn't valid, then "ui" and "ui->textfield" won't be valid either.

    Is "textfield" a valid pointer to a QLineEdit / QTextEdit?

    Break your statement into two or more lines. First call the QFileDialog method and assign the result to a QString. You can check that to see that it is valid and that the method worked. (You can also set a breakpoint on that statement to confirm that "this" is valid). Next, call setText() to put the QString into the text edit. (At the same time you can confirm that "ui" and "textfield" are valid pointers).
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Very interesting Error QFile and QDir
    By hazad in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2013, 10:29
  2. Replies: 2
    Last Post: 6th May 2013, 08:06
  3. QFile dialog, native view
    By franco.amato in forum Qt Programming
    Replies: 4
    Last Post: 17th February 2010, 04:15
  4. Binary QFile error
    By Affenbrotbaum in forum Newbie
    Replies: 3
    Last Post: 29th January 2010, 02:13
  5. Replies: 0
    Last Post: 4th November 2009, 10:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.