[Development] QCommandLineParser

Thiago Macieira thiago.macieira at intel.com
Mon Jul 29 22:40:53 CEST 2013


On segunda-feira, 29 de julho de 2013 20:38:38, David Faure wrote:
> Now Oswald suggests that apps *could* set up QLocale and QTranslator before 
> instanciating qapp, and therefore qapp could create a QCommandLineParser
> instance and feed its options into it, and use it for parsing. Not sure how
> much this can really work, Thiago always says Qt APIs shouldn't be used
> before the QCoreApp ctor (e.g. no local8Bit etc.). So it sounds a bit too
> experimental to me.

Correct. QLocale sets itself up, which is not a problem.

QTranslator takes filenames as parameters. That requires the locale 8-bit codec 
to be working. That *only* works after QCoreApplication has been instantiated.

So I'm against using QTranslator before QCoreApplication. We should not 
recommend any mainstream API to be used before QCoreApplication. The creation 
of the application object should generally be the first thing in the main 
function.

-- 
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/development/attachments/20130729/afdcc3df/attachment.sig>


More information about the Development mailing list