[Interest] Removal of GUIenabled constructor argument of QApplication in Qt5

Thiago Macieira thiago.macieira at intel.com
Tue Jan 21 17:49:37 CET 2014


On terça-feira, 21 de janeiro de 2014 14:34:00, Marc Schmitzer wrote:
> Hi,
> 
> I know I'm a little late to the party, but while trying to port our
> project to Qt5, I just discovered that the QApplication constructor that
> takes a "bool GUIenabled" argument has been removed. I cannot find any
> mention of this in the official change lists.
> 
> This change is quite unfortunate for us because we have some programs
> with "runtime optional" GUIs. These programs would simply instantiate a
> QApplication, passing true as the GUIenabled argument only if the
> "DISPLAY" environment variable was not empty. This all worked nicely.
> Now, without that constructor, I have to explicitly instantiate
> QApplication or QCoreApplication on the heap and keep it in a pointer.
> 
> Another problem is that the change does not break existing code, because
> the "normal" QApplication constructor (int&,char**) actually has a third
> argument (int) that is hidden from the docs. This means that existing
> code will continue to compile, but pass one or zero as the third
> argument, which normally defaults to QT_VERSION (0x05****).
> 
> I realize that this is more of a complaint than a question, but maybe
> somebody here can shed some light on the story.

We can re-add the constructor with a bool as a private member, which will 
cause a compilation error for you.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140121/38e3dc8f/attachment.sig>


More information about the Interest mailing list