Add label delete method

basic_orders
Tyler Goodlet 2021-02-11 11:49:01 -05:00
parent 0edca84b3d
commit ca576ca3cf
1 changed files with 6 additions and 0 deletions

View File

@ -105,6 +105,9 @@ class Label:
self._af = self.txt.pos().x
# not sure if this makes a diff
self.txt.setCacheMode(QtGui.QGraphicsItem.DeviceCoordinateCache)
# TODO: edit and selection support
# https://doc.qt.io/qt-5/qt.html#TextInteractionFlag-enum
# self.setTextInteractionFlags(QtGui.Qt.TextEditorInteraction)
@ -186,3 +189,6 @@ class Label:
def hide(self) -> None:
self.txt.hide()
def delete(self) -> None:
self.vb.scene().removeItem(self.txt)