[Qt-interest] Force file extension with QFileDialog::getSaveFileName?
David Doria
daviddoria at gmail.com
Tue Jun 21 21:20:52 CEST 2011
> It's a *HUGE* violation of Human Interface Design
> Principles to do something like this. Reject an
> extension/filetype if you don't like it, but don't
> you dare change it behind the user's back to suit
> your needs. That would certainly violate the principle
> of "least surprise" and on some systems, might end up
> with the user confused about why, having typed "foo.ppm",
> the program is now asking them if they want to over-write
> the exitsing "foo.bmp". (Or even worse yet, maybe the
> program simply silently over-writes their existing .bmp
> file with new contents; that loss-of-data accident could
> spell a lawsuit!)
>
> Atlant
I agree with not changing the extension, but there should be a way
(the defaultSuffix sounds like it is on the right track...) to force
the result to have a .png unless they specified something else, right?
Like in many programs if you just type "test", it will automatically
append the extension so the result is test.png.
More information about the Qt-interest-old
mailing list