I got problem with this code
#define twobit(ch) ((toupper(ch)) == 'S' ? 0LL : \
(toupper(ch)) == 'M' ? 1LL : \
(toupper(ch)) == 'F' ? 2LL : 3LL)
const QString pop("SWDGMKF");
qDebug()<<twobit(pop[2]); //Erorr
QChar represents a unicode character. Thus it cannot be converted to char safely. If you know that it contains ASCII or Latin1 characters only, you can convert it using toAscii() or toLatin1(), respectively.
If possible, I’d avoid converting to char though, and use QChar methods. I.e., instead of toupper() use QChar::toUpper: