Results 1 to 12 of 12

Thread: How to save file with QFileDialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to save file with QFileDialog

    Hello
    i try to use Qfiledialog for a save dialog too
    but ther is an error that i cant see the reason that's my code

    <code>
    void Frm::evtBtnFileTarget()
    {
    QFileDialog::getSaveFileName(this, "Save file", "", ".conf");
    }
    </code>

    that's the error:

    Frm.cpp:945: erreur: no matching function for call to «QFileDialog::getSaveFileName(Frm* const, const char [10], const char [1], const char [6])»
    /usr/include/qt4/QtGui/qfiledialog.h:201: note: candidats sont: static QString QFileDialog::getSaveFileName(QWidget*, const QString&, const QString&, const QString&, QString*, QFlags<QFileDialog::Option>)



    thx

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: How to save file with QFileDialog

    your class Frm must be a subclass of QWidget or pass 0 instead of this as the first parameter

  3. #3
    Join Date
    May 2009
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to save file with QFileDialog

    c'est bien ca, Mercii

  4. #4
    Join Date
    May 2012
    Posts
    33
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: How to save file with QFileDialog

    QString s = QFileDialog::getSaveFileName(
    "/home",
    "Images (*.png *.xpm *.jpg)",
    this,
    "save file dialog",
    "Choose a filename to save under" );

    use this works fine
    http://linux.die.net/man/3/qfiledialog

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: How to save file with QFileDialog

    Thanks for the timely response. I'm sure these guys have been struggling to find this answer since 2009.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: How to save file with QFileDialog

    Been a few of these lately. I suspect there will be another spate in three years

  7. #7
    Join Date
    May 2012
    Posts
    33
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    9

    Default Re: How to save file with QFileDialog

    The reason i answered because if in future if some1 have a same problem, he will have a solution here.

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