<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QApplication constructors]]></title><description><![CDATA[<p dir="auto">I'm not sure what is at fault here, but I just noticed that there are some inconsistencies with the QApplication constructors.</p>
<p dir="auto">If I type the following code in the editor:<br />
@<br />
QCoreApplication *application = new QApplication(<br />
@</p>
<p dir="auto">the code completion shows me that there are 4 different constructors, but if I press F1 on QApplication, none of the constructors in the help match the signatures of the constructors listed by the code completion.</p>
<p dir="auto">According to the help:<br />
@<br />
QApplication ( int &amp; argc, char ** argv )<br />
QApplication ( int &amp; argc, char ** argv, bool GUIenabled )<br />
QApplication ( int &amp; argc, char ** argv, Type type )<br />
QApplication ( Display * display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0 )<br />
QApplication ( Display * display, int &amp; argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0 )<br />
QApplication ( QApplication::QS60MainApplicationFactory factory, int &amp; argc, char ** argv )<br />
@</p>
<p dir="auto">If I introduce a compile error, the output is:<br />
@<br />
..\Launcher\main.cpp:15: error: no matching function for call to 'QApplication::QApplication(int, int)'<br />
....\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtGui/qapplication.h:389: note: candidates are: QApplication::QApplication(const QApplication&amp;)<br />
....\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtGui/qapplication.h:130: note:                 QApplication::QApplication(int&amp;, char**, QApplication::Type, int)<br />
....\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtGui/qapplication.h:129: note:                 QApplication::QApplication(int&amp;, char**, bool, int)<br />
....\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtGui/qapplication.h:128: note:                 QApplication::QApplication(int&amp;, char**, int)<br />
@</p>
<p dir="auto">It looks like the code completion at least matches the compiler. The online Qt documentation matches the help in QtCreator. So, is this simply a case of incorrect documentation?</p>
]]></description><link>https://forum.qt.io/topic/16182/qapplication-constructors</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 18:17:02 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/16182.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Apr 2012 11:40:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QApplication constructors on Wed, 25 Apr 2012 15:50:33 GMT]]></title><description><![CDATA[<p dir="auto">I haven't verified this but the last parameter might be marked as internal (it is even named <em>internal</em> if I recall correctly), which means that it is hidden in the documentation (automatically by the documentation tool) but shown in Qt Creator - which just analyzes the source files and suggests what found.</p>
<p dir="auto">Be aware that some of the constructors are available on certain platforms only.</p>
]]></description><link>https://forum.qt.io/post/136918</link><guid isPermaLink="true">https://forum.qt.io/post/136918</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 25 Apr 2012 15:50:33 GMT</pubDate></item><item><title><![CDATA[Reply to QApplication constructors on Wed, 25 Apr 2012 14:17:28 GMT]]></title><description><![CDATA[<p dir="auto">Yep, noticed that. Which is also interesting since the code<br />
@<br />
QCoreApplication *application = new QApplication(0, 0);<br />
@</p>
<p dir="auto">Compiles on Ubuntu with the Qt Creator installed from the repository and I think Qt 4.7.1. But it shouldn't...</p>
<p dir="auto">But that's not the point, the point is the difference between the help file and the actual code.</p>
]]></description><link>https://forum.qt.io/post/136905</link><guid isPermaLink="true">https://forum.qt.io/post/136905</guid><dc:creator><![CDATA[rincewind]]></dc:creator><pubDate>Wed, 25 Apr 2012 14:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to QApplication constructors on Wed, 25 Apr 2012 14:08:53 GMT]]></title><description><![CDATA[<p dir="auto">Note that the first parameter is a reference to int, not an int.</p>
]]></description><link>https://forum.qt.io/post/136902</link><guid isPermaLink="true">https://forum.qt.io/post/136902</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 25 Apr 2012 14:08:53 GMT</pubDate></item></channel></rss>