Dialogs in Qt Quick

The Qt Quick Dialogs module has undergone a lot of changes in the last two years. Its purpose has always been to make it simple for developers to add dialogs to their applications. Native dialogs should be used by default on platforms that have a native dialog for a specific dialog type, and if the system can't provide one, then the module should fall back to a suitable dialog that's implemented in Qt.

With the release of Qt 6 we removed the previous Qt Quick Controls 1 module, which the Qt Quick Dialogs module depended on at the time. Because of this, we ended up rewriting the module from scratch, and we've been gradually introducing the various dialogs back into the module since Qt 6.2. The new fallback dialogs are now based on the Qt Quick Controls 2 module, which means that we've taken extra care to ensure that they all look good with each Qt Quick Controls Style.

In Qt 6.2 we reintroduced the FileDialog and the FontDialog.

In Qt 6.3 we reintroduced the FolderDialog and the MessageDialog.

In Qt 6.4 we're reintroducing the ColorDialog.

FileDialog

The file dialog will be native by default on Windows, macOS, Android, iOS and Gtk.
The screenshots below demonstrate the fallback dialogs in each Qt Quick Controls style:

Basic style Fusion style
Imagine style Material style
Universal style  

FontDialog

The font dialog is native by default on macOS and Gtk.
The fallback dialog will look like the following for the various styles:

Font Dialog Basic StyleBasic style Font Dialog Fusion StyleFusion style
Font Dialog Imagine StyleImagine style Font Dialog Material StyleMaterial style
Font Dialog Universal StyleUniversal style  

 

FolderDialog

The FolderDialog will naturally share a lot of similarities with the FileDialog.
It's native by default on Windows, macOS, iOS, Android and Gtk. The fallback dialog will look like the following images:

Folder Dialog Basic StyleBasic style Folder Dialog Fusion StyleFusion style
Folder Dialog Imagine StyleImagine style Folder Dialog Material StyleMaterial style
Folder Dialog Universal StyleUniversal style  

MessageDialog

The message dialog is a pretty basic dialog that will be native by default on iOS and Android.
Otherwise it will look like the following for the various styles:

Message Dialog Basic StyleBasic style Message Dialog Fusion StyleFusion style
Message Dialog Imagine StyleImagine style Message Dialog Material StyleMaterial style
Message Dialog Universal StyleUniversal style  

ColorDialog

The color dialog is the newest addition to the family.
It will be native by default on macOS and Gtk, and otherwise will look like the following for the various styles.

Basic style Fusion style
Imagine style Material style
Universal style  

 

Future work

While 6.4 adds the last remaining dialog, we still have more features that we wish to introduce in the future.

The fallback dialogs are implemented as items in the scene, rather than true top-level windows. This is advantageous on some platforms, like embedded platforms, mobile and web assembly, but we know that desktop users will likely prefer top level windows by default. This is something that we would like to fix in a future release.

We also want to introduce more features in the color dialog to make it as powerful as color pickers in designer applications.

 

 


Blog Topics:

Comments