[Interest] Event handling for QObjects created before QApplication

Thiago Macieira thiago.macieira at intel.com
Wed Sep 24 17:19:08 CEST 2014


On Wednesday 24 September 2014 11:20:39 Hamish Moffatt wrote:
> > Qt is not supported before the creation of QCoreApplication. Your use-case
> > is not supported, so no answer is necessary.
> > 
> > Just don't do it.
> > 
> > Note: the doc is wrong.
> 
> Does that mean static objects are not supported either?

Not supported, but mostly they work. We will also fix bugs in uses that 
reasonably could happen in main() while parsing the command-line and other 
set-up procedures before QCoreApplication gets created. 

Just be careful because some things will not work. For example, 
QString::fromLocal8Bit doesn't work before QCoreApplication.

> We have lots of const QStrings in our (Qt4) application, and some static
> (non-const) QLists. But none of these are QObjects and I don't think we
> have any static QObjects.

static QObjects are not supported at all. Any application that has those will 
get rejected as a testcase on input for a Qt bug report.

The first QObject you should create is QCoreApplication.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list