Hi Guys,
Trying to get my keypressevent working, but it's being stubborn:
void GLWidget
::keyPressEvent(QKeyEvent *cKeyEventPtr
) {
qDebug() << m_bShow;
qDebug() << cKeyEventPtr;
if(cKeyEventPtr->key() == Qt::Key_F1 && m_bShow == ON)
{
qDebug() << m_bShow;
this->hide();
}
else if(cKeyEventPtr->key() == Qt::Key_F1 && m_bShow == OFF)
{
qDebug() << m_bShow;
this->show();
}
}
void GLWidget::keyPressEvent(QKeyEvent *cKeyEventPtr)
{
qDebug() << m_bShow;
qDebug() << cKeyEventPtr;
if(cKeyEventPtr->key() == Qt::Key_F1 && m_bShow == ON)
{
qDebug() << m_bShow;
this->hide();
}
else if(cKeyEventPtr->key() == Qt::Key_F1 && m_bShow == OFF)
{
qDebug() << m_bShow;
this->show();
}
}
To copy to clipboard, switch view to plain text mode
It's not showing any lines of code when I start bashing all my keys on my keyboard, so not sure why this is the case. My mouse click events are working fine
.
I've got:
#include <QKeyEvent>
Bookmarks