Results 1 to 6 of 6

Thread: QFileDialog options

  1. #1
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFileDialog options

    Here what I have
    Qt Code:
    1. QFileDialog *fileDialog = new QFileDialog();
    2. fileDialog->setWindowTitle("Open media file");
    3. fileDialog->setFilter(QString("Media Files (*.mp3 *.wav *.wma)"));
    4. fileDialog->exec();
    5. QString szTempFile = fileDialog->result();
    To copy to clipboard, switch view to plain text mode 

    I can set WindowTitle, Filter and other functions that take flags, but there is no function that take the Options like QFileDialog::ShowDirsOnly, QFileDialog:ontUseNativeDialog and etc. Maybe there is other way and I can't see it? I don't want to use the static public members like getExistingDirectory() and such.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileDialog options

    If you use the non-static method, native dialog won't be used. You can substitute ShowDirsOnly with setting the fileMode property.

  3. #3
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog options

    Ahh, ok, then is there a way to add custom widget to the native windows dialog like a checkbox for recursive dirs. I have seen this in some players and other programs or they had created a new custom dialog that looks like the windows one ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileDialog options

    If you access the layout of the widget, then why not...

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QFileDialog options

    Quote Originally Posted by The Storm View Post
    Ahh, ok, then is there a way to add custom widget to the native windows dialog like a checkbox for recursive dirs. I have seen this in some players and other programs or they had created a new custom dialog that looks like the windows one ?
    I suppose the native file dialog has an option for such checkbox. You might have to construct such file dialog yourself via WinAPI...

    Quote Originally Posted by wysota View Post
    If you access the layout of the widget, then why not...
    I'm afraid a native file dialog doesn't have a layout which would be able to manage QWidgets...
    J-P Nurmi

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileDialog options

    Well... yes, somehow I missed the fact that the question was for the native dialog.

Similar Threads

  1. QFileDialog and file sequences
    By peterhillman in forum Qt Programming
    Replies: 5
    Last Post: 24th November 2007, 10:16
  2. Handcoder's IDE for Qt
    By magland in forum Qt-based Software
    Replies: 55
    Last Post: 7th September 2007, 15:09
  3. QFileDialog in Qt designer
    By tpf80 in forum Qt Tools
    Replies: 1
    Last Post: 17th May 2007, 00:41
  4. QFileDialog Mac / PC
    By hey in forum Qt Programming
    Replies: 3
    Last Post: 26th April 2007, 18:23
  5. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 14:26

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.