Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Is the native dialog the same as the qt dialog?


Asked by Mavis Hickman on Dec 08, 2021 FAQ



Ok. When a platform (OS) has a FileDialog, Qt uses that one. Called the native Dialog and that is why the setGeometry is ignored. and you can then resize it. but it uses Qt version of FileDialog.
Likewise,
By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro, or the platform does not have a native dialog of the type that you require. Note: This option must be set before changing dialog properties or showing the dialog.
Indeed, The native dialogs don't support the full array of features exposed by the QFileDialog class. That's why they are only available through the static short-cut functions called getOpenFileName (), getSaveFileName () etc'. If you're using these functions and still don't want to see the native dialog, you use the DontUseNativeDialog flag.
In fact,
If the user clicked OK, the file they selected is put in fileName. The dialog's working directory can be set with setDirectory(). Each file in the current directory can be selected using the selectFile() function. The Standard Dialogs example shows how to use QFileDialog as well as other built-in Qt dialogs.
And,
The QColorDialog class provides a dialog widget for specifying colors. More... The color dialog's function is to allow users to choose colors. For example, you might use this in a drawing program to allow the user to set the brush color. The static functions provide modal color dialogs.