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
18f59c7e
Commit
18f59c7e
authored
Mar 20, 2012
by
Benjamin Long
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when user press F2 to edit the TreeView
parent
dfce1f57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
pqLineEditEventTranslator.cxx
pqLineEditEventTranslator.cxx
+7
-2
No files found.
pqLineEditEventTranslator.cxx
View file @
18f59c7e
...
...
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqLineEditEventTranslator.h"
#include <QEvent>
#include <QDebug>
#include <QLineEdit>
#include <QSpinBox>
#include <QTextDocument>
...
...
@@ -53,7 +54,8 @@ bool pqLineEditEventTranslator::translateEvent(QObject* Object, QEvent* Event, b
return
false
;
}
// If this line edit is part of a spinbox, don't translate events (the spinbox translator will receive the final value directly)
// If this line edit is part of a spinbox, don't translate events
// (the spinbox translator will receive the final value directly)
if
(
qobject_cast
<
QSpinBox
*>
(
Object
->
parent
()))
{
return
false
;
...
...
@@ -76,8 +78,11 @@ bool pqLineEditEventTranslator::translateEvent(QObject* Object, QEvent* Event, b
emit
recordEvent
(
Object
,
"set_string"
,
teObject
->
document
()
->
toPlainText
());
}
}
else
// if we record F2 event, will cause some issue with the TreeView
// Need test to know if we need to record those events
else
if
(
ke
->
key
()
!=
Qt
::
Key_F2
)
{
qDebug
()
<<
"key text"
<<
ke
->
text
();
emit
recordEvent
(
Object
,
"key"
,
QString
(
"%1"
).
arg
(
ke
->
key
()));
}
}
...
...
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