Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
3cf0237f
Commit
3cf0237f
authored
Feb 20, 2022
by
HinGwenWoong
Browse files
Select box wil select key in key list at the same time
parent
e8edb437
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+4
-1
PPOCRLabel/libs/unique_label_qlist_widget.py
PPOCRLabel/libs/unique_label_qlist_widget.py
+3
-1
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
3cf0237f
...
...
@@ -465,7 +465,7 @@ class MainWindow(QMainWindow):
'Ctrl+Z'
,
"undo"
,
getStr
(
"undo"
),
enabled
=
False
)
change_cls
=
action
(
getStr
(
"keyChange"
),
self
.
change_box_key
,
'Ctrl+B'
,
"
undo
"
,
getStr
(
"keyChange"
),
enabled
=
False
)
'Ctrl+B'
,
"
edit
"
,
getStr
(
"keyChange"
),
enabled
=
False
)
lock
=
action
(
getStr
(
"lockBox"
),
self
.
lockSelectedShape
,
None
,
"lock"
,
getStr
(
"lockBoxDetail"
),
...
...
@@ -980,6 +980,9 @@ class MainWindow(QMainWindow):
self
.
labelList
.
scrollToItem
(
self
.
currentItem
())
# QAbstractItemView.EnsureVisible
self
.
BoxList
.
scrollToItem
(
self
.
currentBox
())
if
len
(
self
.
canvas
.
selectedShapes
)
==
1
and
self
.
keyList
.
count
()
>
0
:
selected_key_item_row
=
self
.
keyList
.
findItemsByLabel
(
self
.
canvas
.
selectedShapes
[
0
].
key_cls
,
get_row
=
True
)
self
.
keyList
.
setCurrentRow
(
selected_key_item_row
)
self
.
_noSelectionSlot
=
False
n_selected
=
len
(
selected_shapes
)
...
...
PPOCRLabel/libs/unique_label_qlist_widget.py
View file @
3cf0237f
...
...
@@ -17,12 +17,14 @@ class UniqueLabelQListWidget(EscapableQListWidget):
if
not
self
.
indexAt
(
event
.
pos
()).
isValid
():
self
.
clearSelection
()
def
findItemsByLabel
(
self
,
label
):
def
findItemsByLabel
(
self
,
label
,
get_row
=
False
):
items
=
[]
for
row
in
range
(
self
.
count
()):
item
=
self
.
item
(
row
)
if
item
.
data
(
Qt
.
UserRole
)
==
label
:
items
.
append
(
item
)
if
get_row
:
return
row
return
items
def
createItemFromLabel
(
self
,
label
):
...
...
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