[Qt-creator] UTF-8 Strings in QtCreator source code

Jochen Becher jochen_becher at gmx.de
Sat Sep 5 16:18:03 CEST 2015


Hi,

the modelinglib which is part of the model editor plugin uses a icon
font adding some special icons. The icons are defined as some private
UTF-8 chars in the font. In the source code I used the proposed way
(from coding style) but I've got feedback that MSVC2015 does not built
without warnings. At the end I used QChar(0xnnnn) to insert these utf-8
characters. It looks really ugly in the code.

C++11 introduced new UTF-8 string constans, so it should be possible to
write the following:

QStringLiteral(u8"This is a Unicode Character: \u2018.")

and all C++11 compiler should compile it without warnings. Right?

Shall we change the coding style and allow the new UTF-8 string
literals?

Regards, Jochen





More information about the Qt-creator mailing list