Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-24

QFileDialog::getSaveFileName does not update the name field

XMLWordPrintable

    • 194992

      QFileDialog::getSaveFileNamed does not update the file extension when the user changes the selected filter. For instance, if the filter is initially set to "all files" and the user types "foo.tif" into the name field, and then changes the filter to "jpg", the name field still shows "foo.tif". Both Word and Wordpad update the name field.


      Reopened case since this can be reproduced in 4.5.0

      Example code:

      #include <QtGui>

      int main( int argc, char** argv )
      {
      QApplication app( argc, argv );
      QString filter( "Text (*.txt)" );

      QString s = QFileDialog::getSaveFileName( 0,
      "Save file test",
      "/tmp/test.txt",
      "HTML (.html);;XML (.xml);;Text (*.txt);;All files ",
      &filter );
      if( s.isEmpty() )
      printf( "No file selected.\n" );
      else
      printf( "User selected %s\n", s.toAscii().constData() );

      return 0;
      }

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            menard Alexis Menard (closed Nokia identity) (Inactive)
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes