Doesn't work with escape being pressed. If I set keyval = 111 in the keyPressEvent call and comment out the conditional operator, it should set keyval to 111 with any keypress. But its not. Likewise, if I set keyval=111 in the mousePressEvent below, it works, and is being called. Why isn't keyPressEvent being called?
Thanks in advance.
{
/*
switch( e->key() )
{
case Qt::Key_Escape:
keyval=111;
}
*/
keyval = 111; // the label should read 111 if any keypress is occuring
}
{
lastPos = event->pos();
// if I put keyval = 111 here, it shows in the label with mousepress
}
void GLWidget::keyPressEvent(QKeyEvent *e)
{
/*
switch( e->key() )
{
case Qt::Key_Escape:
keyval=111;
}
*/
keyval = 111; // the label should read 111 if any keypress is occuring
}
void GLWidget::mousePressEvent(QMouseEvent *event)
{
lastPos = event->pos();
// if I put keyval = 111 here, it shows in the label with mousepress
}
To copy to clipboard, switch view to plain text mode
Bookmarks