How to convert TBuf to QString

From Qt Wiki
Jump to navigation Jump to search

Template:Abstract For information about converting other descriptor types see Using Qt and Symbian C++ Together#Converting a Descriptor to a QString.

Template:ArticleMetaData

TBuf to QString[edit | edit source]

_LIT(KMsg,"Hello"); TBuf<10> buf(KMsg); QString qString((QChar*)buf.Ptr(),buf.Length());

QString to TBuf[edit | edit source]

QString text = "Some text"; TPtrC16 textPtr(reinterpret_cast<const TUint16*>(text.utf16())); or QString text = "Some text"; TBuf<KBufLength> buffer(text.utf16());

pt:Como converter um TBuf para QString
zh-hans:如何将TBuf转换为QString