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
74f44dd2
Commit
74f44dd2
authored
Feb 25, 2022
by
HinGwenWoong
Browse files
the height of key list set to a quarter of the windows height
parent
6bb6a83d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+7
-4
PPOCRLabel/libs/unique_label_qlist_widget.py
PPOCRLabel/libs/unique_label_qlist_widget.py
+3
-2
No files found.
PPOCRLabel/PPOCRLabel.py
View file @
74f44dd2
...
...
@@ -162,11 +162,14 @@ class MainWindow(QMainWindow):
# ================== Key List ==================
if
self
.
kie_mode
:
# self.keyList = QListWidget()
self
.
keyList
=
UniqueLabelQListWidget
()
# self.keyList.itemSelectionChanged.connect(self.keyListSelectionChanged)
# self.keyList.itemDoubleClicked.connect(self.editBox)
# self.keyList.itemChanged.connect(self.keyListItemChanged)
# set key list height
key_list_height
=
int
(
QApplication
.
desktop
().
height
()
//
4
)
if
key_list_height
<
50
:
key_list_height
=
50
self
.
keyList
.
setMaximumHeight
(
key_list_height
)
self
.
keyListDockName
=
getStr
(
'keyListTitle'
)
self
.
keyListDock
=
QDockWidget
(
self
.
keyListDockName
,
self
)
self
.
keyListDock
.
setWidget
(
self
.
keyList
)
...
...
PPOCRLabel/libs/unique_label_qlist_widget.py
View file @
74f44dd2
# -*- encoding: utf-8 -*-
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtCore
import
Qt
,
QSize
from
PyQt5
import
QtWidgets
...
...
@@ -40,6 +40,7 @@ class UniqueLabelQListWidget(EscapableQListWidget):
qlabel
.
setText
(
'<font color="#{:02x}{:02x}{:02x}">●</font> {} '
.
format
(
*
color
,
label
))
qlabel
.
setAlignment
(
Qt
.
AlignBottom
)
item
.
setSizeHint
(
qlabel
.
sizeHint
())
# item.setSizeHint(qlabel.sizeHint())
item
.
setSizeHint
(
QSize
(
25
,
25
))
self
.
setItemWidget
(
item
,
qlabel
)
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