Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
bachelor-paa-bittet
soitool
Commits
751b692b
Commit
751b692b
authored
4 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#98 Kodetabeller bruker felles hurtigtast-funksjoner
parent
89940f84
No related branches found
Branches containing commit
No related tags found
1 merge request
!73
#98 Kodefrasemodul
Pipeline
#83713
passed with stages
in 2 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
soitool/modules/code_table_base.py
+5
-8
5 additions, 8 deletions
soitool/modules/code_table_base.py
with
5 additions
and
8 deletions
soitool/modules/code_table_base.py
+
5
−
8
View file @
751b692b
...
...
@@ -10,6 +10,8 @@ from soitool.modules.module_base import (
ModuleBase
,
get_table_size
,
resize_table
,
event_is_ctrl_minus
,
event_is_ctrl_plus
,
HEADLINE_FONT
,
TABLE_CELL_DEFAULT_FONT
,
)
...
...
@@ -198,18 +200,13 @@ class CodeTableBase(ModuleBase, QTableWidget, metaclass=Meta):
def
keyPressEvent
(
self
,
event
):
"""
Add or remove row when
'
Ctrl + +
'
and
'
Ctrl + -
'
are pressed.
"""
if
(
event
.
modifiers
()
==
Qt
.
ControlModifier
and
event
.
key
()
==
Qt
.
Key_Plus
):
if
event_is_ctrl_plus
(
event
):
# If a row is selected
row_index
=
self
.
currentRow
()
if
row_index
!=
-
1
:
self
.
add_row
(
row_index
)
elif
(
event
.
modifiers
()
==
Qt
.
ControlModifier
and
event
.
key
()
==
Qt
.
Key_Underscore
):
elif
event_is_ctrl_minus
(
event
):
# If at least two rows (+ headline-row) exists and a row other than
# headline-row is selected
row_index
=
self
.
currentRow
()
...
...
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