Results 1 to 12 of 12

Thread: How to save file with QFileDialog

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to save file with QFileDialog

    QFileDialog only asks user for the file name. It won't save your data, because it doesn't even know what data to save.

    In C++ you would do this:
    Qt Code:
    1. filename = QFileDialog::getSaveFileName( ... );
    2. QFile f( filename );
    3. f.open( QIODevice::WriteOnly );
    4. // store data in f
    5. f.close();
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to jacek for this useful post:

    spagatoni (1st December 2008)

Similar Threads

  1. QFileDialog and file extension
    By calhal in forum Qt Programming
    Replies: 3
    Last Post: 9th March 2010, 12:54
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. QFileDialog and file sequences
    By peterhillman in forum Qt Programming
    Replies: 5
    Last Post: 24th November 2007, 10:16
  4. Replies: 4
    Last Post: 13th June 2007, 15:37
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.