Results 1 to 2 of 2

Thread: extending native-style QFileDialog

  1. #1
    Join Date
    Feb 2010
    Qt products

    Default extending native-style QFileDialog

    is there any means of extending (=adding widgets to) the native style QFileDialog?

    I'm working on Windows and would like to use the native(!) look of the QFileDialog for letting the user export some data.
    However I would like to add some controls on it to let them customize the export:
    basically adding a QLabel and a QComboBox.

    In Win32 or MFC you can do this by using SetTemplate for example.

    I already tried adding a control like this:

    Qt Code:
    1. QFileDialog *exportDialog = new QFileDialog();
    2. QLabel *label = new QLabel(exportDialog);
    3. label->setText("New label");
    4. QGridLayout *layout = (QGridLayout*)exportDialog->layout();
    5. layout->addWidget(label, 0, 0);
    6. exportDialog->setModal(true);
    7. exportDialog->show();
    To copy to clipboard, switch view to plain text mode 

    but this apparently turns off the native look.
    Is there anyway to do this or is it just impossible?


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

    Default Re: extending native-style QFileDialog

    The native dialog is only used from within the static methods of QFileDialog so you can't customize it. If you want a custom native file dialog, use native API for the whole dialog.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Slow non-native QFileDialog
    By wssddc in forum Newbie
    Replies: 1
    Last Post: 26th November 2009, 20:26
  2. Native QFileDialog
    By bgougeon in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2009, 01:33
  3. Native QFileDialog position under Win32
    By no_ghost in forum Qt Programming
    Replies: 0
    Last Post: 28th May 2009, 14:07
  4. Native QFileDialog block
    By Darktib in forum Qt Programming
    Replies: 9
    Last Post: 30th December 2008, 02:56
  5. Native QFileDialog
    By adonel in forum Qt Programming
    Replies: 1
    Last Post: 17th September 2008, 18:40


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.