Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labelme
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jakambs
labelme
Commits
a1c1ef65
Commit
a1c1ef65
authored
Apr 1, 2018
by
Kentaro Wada
Browse files
Options
Downloads
Patches
Plain Diff
Fix for flake8: labelme/zoomWidget.py
parent
d800ee1a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
labelme/zoomWidget.py
+12
-12
12 additions, 12 deletions
labelme/zoomWidget.py
with
12 additions
and
12 deletions
labelme/zoomWidget.py
+
12
−
12
View file @
a1c1ef65
# flake8: noqa
#
#
# Copyright (C) 2011 Michael Pitidis, Hussein Abdulwahid.
# Copyright (C) 2011 Michael Pitidis, Hussein Abdulwahid.
#
#
...
@@ -19,28 +18,29 @@
...
@@ -19,28 +18,29 @@
#
#
try
:
try
:
from
PyQt5
.QtGui
import
*
from
PyQt5
import
QtCore
from
PyQt5
.QtCore
import
*
from
PyQt5
import
QtGui
from
PyQt5
.
QtWidgets
import
*
from
PyQt5
import
QtWidgets
except
ImportError
:
except
ImportError
:
from
PyQt4.QtGui
import
*
from
PyQt4
import
QtCore
from
PyQt4.QtCore
import
*
from
PyQt4
import
QtGui
from
PyQt4
import
QtGui
as
QtWidgets
class
ZoomWidget
(
QSpinBox
):
class
ZoomWidget
(
QtWidgets
.
QSpinBox
):
def
__init__
(
self
,
value
=
100
):
def
__init__
(
self
,
value
=
100
):
super
(
ZoomWidget
,
self
).
__init__
()
super
(
ZoomWidget
,
self
).
__init__
()
self
.
setButtonSymbols
(
QAbstractSpinBox
.
NoButtons
)
self
.
setButtonSymbols
(
QtWidgets
.
QAbstractSpinBox
.
NoButtons
)
self
.
setRange
(
1
,
500
)
self
.
setRange
(
1
,
500
)
self
.
setSuffix
(
'
%
'
)
self
.
setSuffix
(
'
%
'
)
self
.
setValue
(
value
)
self
.
setValue
(
value
)
self
.
setToolTip
(
'
Zoom Level
'
)
self
.
setToolTip
(
'
Zoom Level
'
)
self
.
setStatusTip
(
self
.
toolTip
())
self
.
setStatusTip
(
self
.
toolTip
())
self
.
setAlignment
(
Qt
.
AlignCenter
)
self
.
setAlignment
(
QtCore
.
Qt
.
AlignCenter
)
def
minimumSizeHint
(
self
):
def
minimumSizeHint
(
self
):
height
=
super
(
ZoomWidget
,
self
).
minimumSizeHint
().
height
()
height
=
super
(
ZoomWidget
,
self
).
minimumSizeHint
().
height
()
fm
=
QFontMetrics
(
self
.
font
())
fm
=
QtGui
.
QFontMetrics
(
self
.
font
())
width
=
fm
.
width
(
str
(
self
.
maximum
()))
width
=
fm
.
width
(
str
(
self
.
maximum
()))
return
QSize
(
width
,
height
)
return
QtCore
.
QSize
(
width
,
height
)
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