PDA

View Full Version : QKeyEvent problem 'QbyteArray::operator QNoImplicitBoolCast() const is private



cnguyen
28th May 2014, 15:22
Any idea why this error message comes up when I compile. 'QbyteArray::operator QNoImplicitBoolCast() const is private when using QKeyEvent

void editmode::keyPressEvent(QKeyEvent *k)
{
keycode=k->text();
qDebug() << keycode.toAscii();
}

Basically I want to capture the key from keyboard and convert it to ascii.

Thanks ,
New Member and New to QT

wysota
28th May 2014, 17:27
If you want key() then why are you calling text()?