PDA

View Full Version : CString realized as QString



coralbird
16th January 2006, 03:31
I have to change my platform from windows to unix,and I choice qt to replace
MFC,but i don't want to change my code where using CString. Who can provide
such a class? thanks a lot!

kandalf
16th January 2006, 03:46
If you're wroking with Qt3 you can use QCString class, and if you are using Qt4 this (http://doc.trolltech.com/4.1/porting4.html#qcstring) may help you.


Hope it helps.

Cheers.

coralbird
16th January 2006, 03:53
I use qt3.3.4. i will check it as you told me.thanks !

coralbird
16th January 2006, 04:01
I have view the class QCString. Still there are difference between MFC's CString and QCString. For example, CString have a function named Format(),and QCString
don't have.maybe i have to write a class named QMyCSting inherited from QCString to realize these functions?

vitaly
16th January 2006, 08:37
Why QCString? CString support unicode if UNICODE macro is defined. May be you should use QString because it support unicode too.

coralbird
16th January 2006, 09:34
sure, I mention this too.and the trolltech's document tells QCString exist shortcoming.The Document describes as below:"QCString tries to behave like a more convenient const char *. The price of doing this is that some algorithms will perform badly".And trolltech recommends to use QString

jacek
16th January 2006, 17:49
I have to change my platform from windows to unix,and I choice qt to replace
MFC,but i don't want to change my code where using CString.
You might be interested in these links:
http://www.trolltech.com/products/qt/migrate/mfc.html
http://www.trolltech.com/products/solutions/catalog/Windows/qtwinmigrate/

coralbird
17th January 2006, 01:26
thanks to all.I have begin to realize the CString,after done this,if anyone need
this,please post here,i will upload

iPecador
13th July 2007, 12:36
If you have finished your CString class and if you are still OK to give it, thank you