qt can't use ^ operator on qchar 1

qt can’t use ^ operator on qchar

// ^ 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;

Here is what the above code is Doing:
1. Convert QChar to char
2. XOR the char with 0x0f
3. Convert the char back to QChar

Similar Posts