// ^ operator is not defined for QChar, you have to convert it to char first QChar a = 'x'; char b = a.toLatin1(); char c = b ^ 0x0f;