Results 1 to 9 of 9

Thread: QFileDialog

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFileDialog

    Is there an easy way to add a button to select all files shows in current windows dialog..

  2. #2
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    Hey guys, is it possible to add a custom button to a QfileDialog to select all files in the current dir, with Qt4?
    thx
    roby

  3. #3
    Join Date
    Apr 2009
    Posts
    36
    Thanks
    1
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    Quote Originally Posted by rmagro View Post
    Hey guys, is it possible to add a custom button to a QfileDialog to select all files in the current dir, with Qt4?
    thx
    roby
    Is there a special reason for a separate button instead of using the "Ctrl-A" shortcut key?

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

    Default Re: QFileDialog

    Well you can subclass QFileDialog and add a custom button to the layout which holds the other button. Then add a slot which selects all files. That's it.

  5. #5
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    Many thx for your kind reply..

    can you provide an example about how to select all file programmatrically.. it seems to me that Qt4 dos not have anymore this functionality..

  6. #6
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    does "Ctrl-A" shortcut key work for you to select all files in a QFileDialog?

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

    Default Re: QFileDialog

    Quote Originally Posted by rmagro View Post
    can you provide an example about how to select all file programmatrically.. it seems to me that Qt4 dos not have anymore this functionality..
    True, I can't find such a function. Crazy. A hack inside a subclass could be:
    Qt Code:
    1. QListView* w = qobject_cast<QListView*>(itemDelegate()->parent());
    2. if (w)
    3. {
    4. w->selectAll();
    5. }
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    very kind,
    thanks

  9. #9
    Join Date
    Apr 2009
    Posts
    36
    Thanks
    1
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog

    Quote Originally Posted by rmagro View Post
    does "Ctrl-A" shortcut key work for you to select all files in a QFileDialog?
    Yes, the Ctrl-A shortcut does work in a QFileDialog (at least on Windows, but it should work on every platform, take a look at http://qt.nokia.com/doc/4.6/qkeysequence.html for more information).

Similar Threads

  1. QFileDialog
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2007, 13:41
  2. QFileDialog
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 29th November 2007, 13:36
  3. QFileDialog Mac / PC
    By hey in forum Qt Programming
    Replies: 3
    Last Post: 26th April 2007, 18:23
  4. QFileDialog and '~'
    By Levon Nikoghosyan in forum Qt Programming
    Replies: 4
    Last Post: 15th November 2006, 19:37
  5. [Qt4] need help with QFileDialog
    By patcito in forum Qt Programming
    Replies: 2
    Last Post: 7th January 2006, 18:00

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.