Results 1 to 3 of 3

Thread: QFileDialog getSaveFileName() doesn't convey choice to NOT OVERWRITE existing file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog getSaveFileName() doesn't convey choice to NOT OVERWRITE existing fil

    Quote Originally Posted by aamer4yu View Post
    You can put the check yourself after you get the save file name ? cant you ?
    Also there might be so many cases, so its expected of the function to only return a file name, and not overwrite it
    Well, good idea. I can DISABLE the overwrite query popup that is automatically implemented by QFileDialog::getSaveFileName(). That can be done with the optional QFileDialog::Options parameter, bitmask value: QFileDialog:: DontConfirmOverwrite, and checking the existance of the selected file with QFileInfo, and showing my own confirmation dialog box if the file does exist. I guess I'll do that.

    But this REALLY IS a BUG (a design oversight, I think) in the Confirm-Overwrite feature of QFileDialog:: getSaveFileName(), -- enabled by default. It's a pretty bad bug because the file WILL be overwritten by the client code because -- if this is true -- the client code has no way of being informed of the user's choice to ABORT the write operation. Is this true?
    Last edited by philw; 28th March 2009 at 10:19. Reason: smiley showed up with scope operator followed by a D; and added a detail.

Similar Threads

  1. Replies: 4
    Last Post: 13th June 2007, 15:37

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.