[Development] A new approach for Qt main()

Morten Sorvig Morten.Sorvig at qt.io
Fri Dec 9 15:34:45 CET 2016


> On 9 Dec 2016, at 12:11, Laszlo Agocs <laszlo.agocs at qt.io> wrote:
> 
> There are two separate things in there, though: the entry point and the construction of the Q(Core|Gui)Application object. The problem is with the latter: is it not clear why Morten’s proposal moves that under the framework’s control. Introducing a new entry point, e.g. qtMain(), for all platforms in Qt 6 is fine. Moving the application object construction into the underlying platform-specific entry point Qt provides is not.


The reasoning was that QApplication management ended up as boilerplate code, so let’s simplify. This is especially true if the application type has already been selected via a macro.

Keeping support for setting options before creating the application object is a very good argument for letting user code control it though.

Morten





More information about the Development mailing list