QT——QChar

来源:互联网 发布:up安全卫士炒股软件 编辑:程序博客网 时间:2024/06/05 10:04

需求分析:

学习QChar使用
学习QT在QChar中体现的内容


编译环境:

Qt Creator
visual studio 2010


解决方案:

在QT中QChar是unicode字符,占用两个字节,一个字节的时候使用的是QLatin1Char

struct QLatin1Char{public:    // 构造函数,并且必须显示声明    Q_DECL_CONSTEXPR inline explict QLatin1Char(char c) : ch(c) {}    // 可以理解为GetChar    Q_DECL_CONSTEXPR inline char toLatin1() const { return ch; }    // 可以理解为GetUnicode    Q_DECL_CONSTEXPR inline ushort unicode() const { return ushor(uchar(ch)); }private:    char ch;}
0 0
原创粉丝点击