Skip to content

Commit b5e8a9d

Browse files
committed
QwtPlot.detachItems: removed unnecessary "autoDelete" arg, initialiazing rtti to None (remove all items)
1 parent 1bb6702 commit b5e8a9d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# PythonQwt Releases #
22

33

4+
### Version 0.X.X ###
5+
6+
- Changed QwtPlotItem.detachItems signature: removed unnecessary "autoDelete" argument,
7+
initialiazing "rtti" argument to None (remove all items)
8+
49
### Version 0.7.0 ###
510

611
- Added convenience functions for creating usual objects (curve, grid, marker, ...):

qwt/plot.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,16 @@ def removeItem(self, item):
164164
"""
165165
self.__data.itemList.removeItem(item)
166166

167-
def detachItems(self, rtti, autoDelete):
167+
def detachItems(self, rtti=None):
168168
"""
169169
Detach items from the dictionary
170170
171-
:param int rtti: In case of `QwtPlotItem.Rtti_PlotItem` detach all items otherwise only those items of the type rtti.
172-
:param bool autoDelete: If true, delete all detached items
171+
:param rtti: In case of `QwtPlotItem.Rtti_PlotItem` or None (default) detach all items otherwise only those items of the type rtti.
172+
:type rtti: int or None
173173
"""
174174
for item in self.__data.itemList[:]:
175-
if rtti == QwtPlotItem.Rtti_PlotItem and item.rtti() == rtti:
175+
if rtti in (None, QwtPlotItem.Rtti_PlotItem) or item.rtti() == rtti:
176176
item.attach(None)
177-
if self.autoDelete:
178-
self.__data.itemList.remove(item)
179177

180178
def itemList(self, rtti=None):
181179
"""

0 commit comments

Comments
 (0)