<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>Yes, and we will forever (?) support that kind of main function and application entry point. I don't think that we can break that.</p>
<p><br>
</p>
<p>I'm all interested in supporting a second supported way of describing an entry point that more closely matches today's semantics</p>
<p>of graphics applications on the underlying operating/windowing systems.</p>
<p><br>
</p>
<p>Oddly, I do like the way that we're doing this on Windows and have been doing it forever, by shoehorning main() into WinMain()</p>
<p>through a static library. I'm not suggesting to replace QtMain, but I wonder if we could offer a cross-platform QtMain (with a different</p>
<p>name that doesn't clash with the existing one) that requires the programmer to supply a _two_ (or more?) functions instead of one function. No</p>
<p>macros involved then.</p>
<p><br>
</p>
<p><br>
</p>
<p>Simon</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Development <development-bounces+simon.hausmann=qt.io@qt-project.org> on behalf of Friedemann Kleint <Friedemann.Kleint@qt.io><br>
<b>Sent:</b> Friday, December 9, 2016 11:00:00 AM<br>
<b>To:</b> development@qt-project.org<br>
<b>Subject:</b> Re: [Development] A new approach for Qt main()</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi,<br>
<br>
 > Q_GUI_MAIN(appInit, appExit);<br>
<br>
Magic macros for main should be avoided, IMO.<br>
<br>
A typical application main() can look like<br>
<br>
  main()<br>
  {<br>
     QApplication a();<br>
<br>
     Initialization code for other libraries<br>
<br>
     parseArguments(), return if failed<br>
<br>
     show some FileDialog prompting for argument if sth was missing<br>
<br>
     try {<br>
       app.exec()<br>
     } catch (exception) {<br>
     }<br>
     De-Initialize something<br>
  }<br>
<br>
There is no way to shoehorn this into some macro; this can already be <br>
observed when trying to adding some initialization to a test.<br>
<br>
Regards,<br>
Friedemann<br>
<br>
-- <br>
<br>
Friedemann Kleint<br>
The Qt Company GmbH<br>
<br>
_______________________________________________<br>
Development mailing list<br>
Development@qt-project.org<br>
<a href="http://lists.qt-project.org/mailman/listinfo/development">http://lists.qt-project.org/mailman/listinfo/development</a><br>
</div>
</span></font>
</body>
</html>