[Interest] Porting to Qt5/macx-xcode Mountain Lion

Joshua Grauman jnfo-c at grauman.com
Fri Jan 25 01:20:37 CET 2013


I'm not sure I completely understand your question, but I'll give it a 
shot. I had a global variable as follows (bad style, I know). It seems 
pointless I know, but it's because I also have other custom 
implementations of QTextCodec that get instantiated right next to it, so I 
just put them all together.

QTextCodec *Ecodec = QTextCodec::codecForName("UTF-8");

So since this was a global variable, it gets called before 
QCoreApplication, and I'm assuming that's why it returns 0. Does that 
help?

Then after that, even calling QTextStream.setCodec("UTF-8") after 
QCoreApplication has been instantiated will fail because a bad value has 
been cached.

Note that it only returns 0 when called before QCoreApplication under 
Qt5/Mac. Linux and Windows were fine, and Mac was too under 4.8/Snow 
Leopard. It's only Qt5-Mac that is affected.

Josh

> On quinta-feira, 24 de janeiro de 2013 15.29.07, Joshua Grauman wrote:
>>> It's definitely a bug. Please remember that most Qt API is not supported
>>> before the QCoreApplication object is initialized, so this bug will have
>>> a low priority of fixing.
>>
>> That's fine. It was an easy work-around once I figured out what was
>> causing it. But it's nice to be able to track something all the way down
>> to ground to be sure what was going on rather than just fiddling with
>> things until it works!
>
> Thanks for that.
>
> But if you tell me where the first call went off to get a null pointer because
> it was prior to QCoreApplication, I might be able to give you a fix.
>
>



More information about the Interest mailing list