diff --git a/gui/cursorhotspotedit.py b/gui/cursorhotspotedit.py index 31a4ba5..dd81d9b 100644 --- a/gui/cursorhotspotedit.py +++ b/gui/cursorhotspotedit.py @@ -244,6 +244,8 @@ def __init__(self, parent=None, cursor: AnimatedCursor=None): for cur_picker in self._hotspot_picker_lst: cur_picker.userHotspotChange.connect(self._on_hotspot_changed) cur_picker.userDelayChange.connect(self._on_delay_changed) + # Set to delete this dialog on close... + self.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) def _share_hotspot_chg(self, state: int): @@ -278,3 +280,7 @@ def closeEvent(self, evt: QtGui.QCloseEvent): def current_cursor(self) -> AnimatedCursor: return self._cursor + + def __del__(self): + print("Deleting Hotspot Dialog...") + diff --git a/gui/cursorpreviewdialog.py b/gui/cursorpreviewdialog.py index 1002cba..6fb17e0 100644 --- a/gui/cursorpreviewdialog.py +++ b/gui/cursorpreviewdialog.py @@ -41,14 +41,12 @@ def __init__(self, parent=None, cursor: AnimatedCursor=None): self.setLayout(self._main_layout) self.setMinimumSize(self.sizeHint()) + # Set to delete this dialog on close... + self.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) + def closeEvent(self, evt: QtGui.QCloseEvent): print("Closed!") super().closeEvent(evt) - - self._preview_panel.stop_and_destroy() - for cur_view in self._viewers: - cur_view.stop_and_destroy() - self.accept() @@ -115,14 +113,5 @@ def mouseReleaseEvent(self, event: QtGui.QMouseEvent): self.mouseMoveEvent(event) self._pressed = False - def stop_and_destroy(self): - """ Forcefully destroys this CursorPreviewAreas animation timer. """ - if((self._animation_timer is not None) and (self._animation_timer.isActive())): - self._animation_timer.stop() - - del self._animation_timer - self._animation_timer = None - self.setCursor(QtGui.Qt.ArrowCursor) - def __del__(self): - self.stop_and_destroy() + del self._animation_timer