Results 1 to 2 of 2

Thread: QFileDialog::getSaveFileName Save Button

  1. #1
    Join Date
    Dec 2010
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default QFileDialog::getSaveFileName Save Button

    I'm using QFileDialog::getSaveFileName to save a file in my application

    Qt Code:
    1. QString fileName=QFileDialog::getSaveFileName(this,"Save As");
    To copy to clipboard, switch view to plain text mode 

    However, in the dialog box , the SAVE button is always enabled, even when no text is written in save as file name text box.
    I want the save button to get enabled only after a file name i written in the text box.
    How do i do that?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog::getSaveFileName Save Button

    You will have to subclass and override getSaveFileName() with the functionality you want.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Strange behaviour of QFileDialog::getSaveFileName
    By LuckyBlade in forum Qt Programming
    Replies: 2
    Last Post: 14th December 2010, 06:57
  2. QInputDialog like QFileDialog::getSaveFileName
    By BIllNo123 in forum Newbie
    Replies: 5
    Last Post: 23rd September 2010, 14:51
  3. problem with QFileDialog::getSaveFileName
    By navi1084 in forum Qt Programming
    Replies: 4
    Last Post: 26th June 2009, 07:38
  4. file name returned by QFileDialog::getSaveFileName()
    By Lexrst in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 16:38
  5. A question about QFileDialog::getSaveFileName
    By Ali in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2007, 19:46

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.