Results 1 to 2 of 2

Thread: getSaveFileName overwrite check question

  1. #1
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default getSaveFileName overwrite check question

    Hello all,

    I'm using Qt 4.3.3 and openSuse 10.3.

    Seeing what I think is a bug but I don't see it listed in the Task Tracker on the Trolltech site.

    Using the static funtion QFileDialog::getSaveFileName() and it works as expected, except for one case. This is when the user chooses a file name that matches a file that exists in the system and the overwrite check is enabled. In this case when you press the save button on the dialog it displays a warning message box with the text:

    "foo.bin already exists. Do you want to replace it?"

    with a yes and no button in the dialog. The issue I'm seeing is that when I press the no button, the warning dialog and the file dialog both go away. I thought that when the user selected the no button it was supposed to bring them back to the file dialog, so they can specify a different filename. Also there is no way in code (that I can find) to detect that the user pressed the no button in the warning dialog, so when I check the filename returned from getSaveFileName it's not null and not empty so I assume the user pressed Save.(per the documentation)

    Am I missing something in how I do this or is this not working as it should?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: getSaveFileName overwrite check question

    Quote Originally Posted by Lexrst View Post
    I thought that when the user selected the no button it was supposed to bring them back to the file dialog, so they can specify a different filename.
    This is the way it works for me with Qt/X11 4.4.2.
    J-P Nurmi

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.