[Development] A new approach for Qt main()

Friedemann Kleint Friedemann.Kleint at qt.io
Fri Dec 9 11:00:00 CET 2016


Hi,

 > Q_GUI_MAIN(appInit, appExit);

Magic macros for main should be avoided, IMO.

A typical application main() can look like

  main()
  {
     QApplication a();

     Initialization code for other libraries

     parseArguments(), return if failed

     show some FileDialog prompting for argument if sth was missing

     try {
       app.exec()
     } catch (exception) {
     }
     De-Initialize something
  }

There is no way to shoehorn this into some macro; this can already be 
observed when trying to adding some initialization to a test.

Regards,
Friedemann

-- 

Friedemann Kleint
The Qt Company GmbH




More information about the Development mailing list