Results 1 to 3 of 3

Thread: Native QFile Dialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,347
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Native QFile Dialog

    By default, Qt will use the native file dialog when one is available, so I am not sure why that is not happening in your case. You can look in the discussion of QFileDialog::Option and DontUseNativeDialog. You might have to derive a class from QFileDialog in order to get the behavior you want.

    I am not a python expert, but the methof you are calling: getExistingDirectory() is a static member function in C++. You do not need to create an instance of the QFileDialog class in order to use it. I think the same is true in python, so your code probably should be:

    Qt Code:
    1. self.workspace = QtGui.QFileDialog.getExistingDirectory(self, 'Select folder', options=QtGui.QFileDialog.ShowDirsOnly)
    To copy to clipboard, switch view to plain text mode 
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Aug 2017
    Posts
    2
    Qt products
    Platforms
    Unix/X11

    Default Re: Native QFile Dialog

    Thanks for the tips about the static method.

    I've already tried to use the DontUseNativeDialog option before, it doesn't work. I think the problem here is the chroot, which mess things.

Similar Threads

  1. qfile dialog error
    By SirJonas in forum Newbie
    Replies: 3
    Last Post: 2nd November 2016, 16:08
  2. Replies: 2
    Last Post: 6th May 2013, 09:06
  3. QFile dialog, native view
    By franco.amato in forum Qt Programming
    Replies: 4
    Last Post: 17th February 2010, 05:15
  4. Canceling the getOpenFileName native dialog
    By mclark in forum Qt Programming
    Replies: 1
    Last Post: 14th August 2009, 23:59
  5. Replies: 2
    Last Post: 4th February 2008, 12: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
  •  
Qt is a trademark of The Qt Company.