Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Ben Boeckel
QtTesting
Commits
9ad9ac3c
Commit
9ad9ac3c
authored
Jan 30, 2012
by
Benjamin Long
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic KeyPress as "Esc" or "Enter" on QDialog
parent
5731bd04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
pqBasicWidgetEventTranslator.cxx
pqBasicWidgetEventTranslator.cxx
+10
-0
No files found.
pqBasicWidgetEventTranslator.cxx
View file @
9ad9ac3c
...
...
@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqBasicWidgetEventTranslator.h"
#include <QDialog>
#include <QEvent>
#include <QKeyEvent>
#include <QWidget>
...
...
@@ -60,6 +61,15 @@ bool pqBasicWidgetEventTranslator::translateEvent(QObject* Object,
emit
recordEvent
(
Object
,
"contextMenu"
,
""
);
}
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
::
MouseButtonDblClick
:
case
QEvent
::
MouseButtonRelease
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment