[Qt-interest] qt4.5: automatic cast to ascii not available when no qt3 support

Alexander Vassilev avasilev at voipgate.com
Thu Jun 4 11:56:17 CEST 2009


Hi all,
I am using qt4.5 on windows. I have the following problem: I would like 
to have automatic conversion of QString to char*, i.e. the const char* 
operator of QString. QT_NO_CAST_TO_ASCII is not defined, but still I 
dont have the operator. I checked the qstring.h file, put checks to see 
if somehow QT_NO_CAST_TO_ASCII is defined there, but it is not. Further, 
I realized that the definition of the const char* operator is done not 
only if QT_NO_CAST_TO_ASCII isn't defined, but also only if QT3_SUPPORT 
is defined. I don't have QT3_SUPPORT defined because I don't need qt3 
compatibility. However I would like to have the const char* operator of 
QString, and the documentation about QT_NO_CAST_TO_ASCII does not say 
anything about qt3 support enabled. How do I solve this problem, and 
what is the idea of having the char* cast only if there is qt3 support?
Thanks in advance

Best regards
Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avasilev.vcf
Type: text/x-vcard
Size: 134 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090604/1e551324/attachment.vcf 


More information about the Qt-interest-old mailing list