Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
89abfc31
P
PaddleOCR
项目概览
s920243400
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89abfc31
编写于
1月 22, 2022
作者:
H
HinGwenWoong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed: zoom slider wont move while using mouse wheel
上级
5fbe1190
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
21 deletion
+23
-21
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+23
-21
未找到文件。
PPOCRLabel/PPOCRLabel.py
浏览文件 @
89abfc31
...
...
@@ -222,24 +222,25 @@ class MainWindow(QMainWindow):
self
.
dock
.
setWidget
(
labelListContainer
)
# ================== Zoom Bar ==================
self
.
imgsplider
=
QSlider
(
Qt
.
Horizontal
)
self
.
imgsplider
.
valueChanged
.
connect
(
self
.
CanvasSizeChange
)
self
.
imgsplider
.
setMinimum
(
-
150
)
self
.
imgsplider
.
setMaximum
(
150
)
self
.
imgsplider
.
setSingleStep
(
1
)
self
.
imgsplider
.
setTickPosition
(
QSlider
.
TicksBelow
)
self
.
imgsplider
.
setTickInterval
(
1
)
self
.
imageSlider
=
QSlider
(
Qt
.
Horizontal
)
self
.
imageSlider
.
valueChanged
.
connect
(
self
.
CanvasSizeChange
)
self
.
imageSlider
.
setMinimum
(
-
9
)
self
.
imageSlider
.
setMaximum
(
510
)
self
.
imageSlider
.
setSingleStep
(
1
)
self
.
imageSlider
.
setTickPosition
(
QSlider
.
TicksBelow
)
self
.
imageSlider
.
setTickInterval
(
1
)
op
=
QGraphicsOpacityEffect
()
op
.
setOpacity
(
0.2
)
self
.
im
gsp
lider
.
setGraphicsEffect
(
op
)
# self.imgsplider.setAttribute(Qt.WA_TranslucentBackground)
self
.
im
gsp
lider
.
setStyleSheet
(
"background-color:transparent"
)
self
.
im
gs
liderDock
=
QDockWidget
(
getStr
(
'ImageResize'
),
self
)
self
.
im
gs
liderDock
.
setObjectName
(
getStr
(
'IR'
))
self
.
im
gsliderDock
.
setWidget
(
self
.
imgsp
lider
)
self
.
im
gs
liderDock
.
setFeatures
(
QDockWidget
.
DockWidgetFloatable
)
self
.
im
gs
liderDock
.
setAttribute
(
Qt
.
WA_TranslucentBackground
)
self
.
addDockWidget
(
Qt
.
RightDockWidgetArea
,
self
.
im
gs
liderDock
)
self
.
im
ageS
lider
.
setGraphicsEffect
(
op
)
self
.
im
ageS
lider
.
setStyleSheet
(
"background-color:transparent"
)
self
.
im
ageS
liderDock
=
QDockWidget
(
getStr
(
'ImageResize'
),
self
)
self
.
im
ageS
liderDock
.
setObjectName
(
getStr
(
'IR'
))
self
.
im
ageSliderDock
.
setWidget
(
self
.
imageS
lider
)
self
.
im
ageS
liderDock
.
setFeatures
(
QDockWidget
.
DockWidgetFloatable
)
self
.
im
ageS
liderDock
.
setAttribute
(
Qt
.
WA_TranslucentBackground
)
self
.
addDockWidget
(
Qt
.
RightDockWidgetArea
,
self
.
im
ageS
liderDock
)
self
.
zoomWidget
=
ZoomWidget
()
self
.
colorDialog
=
ColorDialog
(
parent
=
self
)
...
...
@@ -403,7 +404,7 @@ class MainWindow(QMainWindow):
'Ctrl+E'
,
'edit'
,
getStr
(
'editLabelDetail'
),
enabled
=
False
)
#
####### New actions #######
#
================== New Actions ==================
AutoRec
=
action
(
getStr
(
'autoRecognition'
),
self
.
autoRecognition
,
''
,
'Auto'
,
getStr
(
'autoRecognition'
),
enabled
=
False
)
...
...
@@ -447,7 +448,7 @@ class MainWindow(QMainWindow):
# self.preButton.setDefaultAction(openPrevImg)
# self.nextButton.setDefaultAction(openNextImg)
#
############ Zoom layout ##############
#
================== Zoom layout ==================
zoomLayout
=
QHBoxLayout
()
zoomLayout
.
addStretch
()
self
.
zoominButton
=
QToolButton
()
...
...
@@ -929,8 +930,8 @@ class MainWindow(QMainWindow):
self
.
loadFile
(
filename
)
def
CanvasSizeChange
(
self
):
if
len
(
self
.
mImgList
)
>
0
:
self
.
zoomWidget
.
setValue
(
self
.
zoomWidgetValue
+
self
.
imgsp
lider
.
value
())
if
len
(
self
.
mImgList
)
>
0
and
self
.
imageSlider
.
hasFocus
()
:
self
.
zoomWidget
.
setValue
(
self
.
imageS
lider
.
value
())
def
shapeSelectionChanged
(
self
,
selected_shapes
):
self
.
_noSelectionSlot
=
True
...
...
@@ -1181,6 +1182,8 @@ class MainWindow(QMainWindow):
def
addZoom
(
self
,
increment
=
10
):
self
.
setZoom
(
self
.
zoomWidget
.
value
()
+
increment
)
print
(
self
.
zoomWidget
.
value
()
+
increment
)
self
.
imageSlider
.
setValue
(
self
.
zoomWidget
.
value
()
+
increment
)
# set zoom slider value
def
zoomRequest
(
self
,
delta
):
# get the current scrollbar positions
...
...
@@ -1273,7 +1276,6 @@ class MainWindow(QMainWindow):
fileWidgetItem
=
self
.
fileListWidget
.
item
(
index
)
print
(
'unicodeFilePath is'
,
unicodeFilePath
)
fileWidgetItem
.
setSelected
(
True
)
###
self
.
iconlist
.
clear
()
self
.
additems5
(
None
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录