Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Unicode 文字列 (QString タイプ) から Unicode 文字 (QChare タイプ) を取得するにはどうすればよいですか? Qt クリエーター 2.0.1)。私は Qt の初心者なので、これはおそらく簡単な質問です。
文字列を QString にロードする場合でも、.at(index) 関数を使用できます。単一の wchar_t (UTF-16) である QChar を返します。その QChar を wchar_t にキャストして、Unicode 文字を取得できます。
次のようなことを試しましたか:
QString s("text"); QChar unicodeChar(s.at(0).unicode());