Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
82309fdd
Commit
82309fdd
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
don't crash in case of BZDNG-238
parent
e595f1d5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/src/python_shell/python_shell_widget.cc
+22
-1
22 additions, 1 deletion
modules/gui/src/python_shell/python_shell_widget.cc
with
22 additions
and
1 deletion
modules/gui/src/python_shell/python_shell_widget.cc
+
22
−
1
View file @
82309fdd
...
...
@@ -482,7 +482,7 @@ void PythonShellWidget::OnExecuteStateEntered()
insertPlainText
(
QString
(
QChar
::
ParagraphSeparator
));
}
block_edit_start_
=
textCursor
().
block
();
std
::
cout
<<
block_edit_start_
.
isValid
()
<<
std
::
endl
;
}
...
...
@@ -737,6 +737,27 @@ QTextBlock PythonShellWidget::GetEditStartBlock()
void
PythonShellWidget
::
keyPressEvent
(
QKeyEvent
*
event
)
{
// BZDNG-238
// Letting Qt do the handling of the backspace key leads to a crash when
// multiline block mode and doing the following:
//
// (a) Hit Ctrl+A
// (b) Hit Backspace
// (c) Hit Return
//
// If we emulate the deletion of the text manually all is fine.
if
(
event
->
key
()
==
Qt
::
Key_Backspace
)
{
QTextCursor
cursor
=
this
->
textCursor
();
if
(
cursor
.
hasSelection
())
{
cursor
.
removeSelectedText
();
}
else
{
if
(
cursor
.
position
()
>
this
->
GetEditStartBlock
().
position
())
{
cursor
.
deletePreviousChar
();
}
}
event
->
accept
();
return
;
}
// BZDNG-173
if
(
event
->
key
()
==
Qt
::
Key_Left
)
{
if
(
this
->
textCursor
().
position
()
==
GetEditStartBlock
().
position
()
||
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment