Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
49d32f0a
Commit
49d32f0a
authored
Jun 11, 2020
by
Thomas Vincent
Browse files
Update avoid addItem->addShape renaming deprecation warning
parent
b30abfe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
xsocs/gui/silx_imports/ImageRois.py
View file @
49d32f0a
...
...
@@ -28,6 +28,7 @@ from collections import OrderedDict, namedtuple
import
numpy
as
np
from
silx.gui
import
qt
,
icons
from
silx
import
hexversion
as
silx_hexversion
__author__
=
[
"D. Naudet"
]
__license__
=
"MIT"
...
...
@@ -238,12 +239,16 @@ class RoiItemBase(qt.QObject):
assert
item
==
handle
def
_drawShape
(
self
):
item
=
self
.
_plot
.
addItem
(
self
.
xData
,
self
.
yData
,
shape
=
self
.
shape
,
legend
=
self
.
_name
,
overlay
=
True
,
color
=
'pink'
)
if
silx_hexversion
>=
0xd00d2
:
# silx >= v0.13.0b2
addShape
=
self
.
_plot
.
addShape
else
:
# Backward compatibility silx <=0.12.0
addShape
=
self
.
_plot
.
addItem
item
=
addShape
(
self
.
xData
,
self
.
yData
,
shape
=
self
.
shape
,
legend
=
self
.
_name
,
overlay
=
True
,
color
=
'pink'
)
assert
item
==
self
.
_name
def
_setHandleData
(
self
,
name
,
point
):
...
...
xsocs/gui/view/QspaceView.py
View file @
49d32f0a
...
...
@@ -34,6 +34,7 @@ import os
import
numpy
as
np
from
silx
import
hexversion
as
silx_hexversion
from
silx.utils.weakref
import
WeakMethodProxy
from
silx.gui
import
qt
as
Qt
from
silx.gui.plot
import
actions
,
items
,
PlotToolButtons
,
PlotWidget
...
...
@@ -688,7 +689,11 @@ class QSpaceView(Qt.QMainWindow):
xRange
=
roiSliders
[
xIndex
].
getValues
()
yRange
=
roiSliders
[
yIndex
].
getValues
()
self
.
__stackView
.
addItem
(
if
silx_hexversion
>=
0xd00d2
:
# silx >= v0.13.0b2
addShape
=
self
.
__stackView
.
addShape
else
:
# Backward compatibility silx <=0.12.0
addShape
=
self
.
__stackView
.
addItem
addShape
(
xRange
,
yRange
,
legend
=
"__QSpaceView_ROI__"
,
shape
=
'rectangle'
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment