[PyQt] QFileDialog static methods accept parameter 'directory' not 'dir' (pyqt 5.10.1)

Phil Thompson phil at riverbankcomputing.com
Thu May 10 19:09:48 BST 2018


On 10 May 2018, at 7:03 pm, Kyle Altendorf <sda at fstab.net> wrote:
> 
> At least QFileSystem.getSaveFileName() and .getOpenFileName() expect a parameter 'directory' instead of the 'dir' that the Qt docs list.  I didn't test the rest of the static methods (or other standard methods)>.
> 
> docs: http://doc.qt.io/qt-5/qfiledialog.html#getSaveFileName
> source: https://github.com/qt/qtbase/blob/e843e3bb00d26c841bd7132c00779c085368eab3/src/widgets/dialogs/qfiledialog.cpp#L2122

It's intentional. Most of the time PyQt follows the Qt docs but not always (because of inconsistencies in the latter).

The definitive signature is always obtained using help().

Phil


More information about the PyQt mailing list