Commit 9ad9ac3c authored by Benjamin Long's avatar Benjamin Long

Add basic KeyPress as "Esc" or "Enter" on QDialog

parent 5731bd04
...@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqBasicWidgetEventTranslator.h" #include "pqBasicWidgetEventTranslator.h"
#include <QDialog>
#include <QEvent> #include <QEvent>
#include <QKeyEvent> #include <QKeyEvent>
#include <QWidget> #include <QWidget>
...@@ -60,6 +61,15 @@ bool pqBasicWidgetEventTranslator::translateEvent(QObject* Object, ...@@ -60,6 +61,15 @@ bool pqBasicWidgetEventTranslator::translateEvent(QObject* Object,
emit recordEvent(Object, "contextMenu", ""); emit recordEvent(Object, "contextMenu", "");
} }
break; break;
case QEvent::KeyPress:
{
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(Event);
if(qobject_cast<QDialog*>(Object))
{
emit recordEvent(object, "key", QString::number(keyEvent->key()));
}
}
break;
case QEvent::MouseButtonPress: case QEvent::MouseButtonPress:
case QEvent::MouseButtonDblClick: case QEvent::MouseButtonDblClick:
case QEvent::MouseButtonRelease: case QEvent::MouseButtonRelease:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment