allow errors to propagate past Qt, add debug logging#1448
Merged
carsen-stringer merged 1 commit intomainfrom May 7, 2026
Merged
allow errors to propagate past Qt, add debug logging#1448carsen-stringer merged 1 commit intomainfrom
carsen-stringer merged 1 commit intomainfrom
Conversation
mrariden
commented
May 7, 2026
Comment on lines
+651
to
+675
| is_right_click = ev.button() == QtCore.Qt.RightButton | ||
| if self.parent.loaded \ | ||
| and (is_right_click or ev.modifiers() & QtCore.Qt.ShiftModifier and not ev.double())\ | ||
| and not self.parent.deleting_multiple: | ||
| if not self.parent.in_stroke: | ||
| ev.accept() | ||
| self.create_start(ev.pos()) | ||
| self.parent.stroke_appended = False | ||
| self.parent.in_stroke = True | ||
| self.drawAt(ev.pos(), ev) | ||
| else: | ||
| ev.accept() | ||
| self.end_stroke() | ||
| self.parent.in_stroke = False | ||
| elif not self.parent.in_stroke: | ||
| y, x = int(ev.pos().y()), int(ev.pos().x()) | ||
| if y >= 0 and y < self.parent.Ly and x >= 0 and x < self.parent.Lx: | ||
| if ev.button() == QtCore.Qt.LeftButton and not ev.double(): | ||
| idx = self.parent.cellpix[self.parent.currentZ][y, x] | ||
| if idx > 0: | ||
| if ev.modifiers() & QtCore.Qt.ControlModifier: | ||
| # delete mask selected | ||
| self.parent.remove_cell(idx) | ||
| elif ev.modifiers() & QtCore.Qt.AltModifier: | ||
| self.parent.merge_cells(idx) |
Collaborator
Author
There was a problem hiding this comment.
Just de-indented the code's try/catch to use the function decorator instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qt silences exceptions originating from built in methods, (e.g.
hoverEvent,keyPressEvent, etc) making debugging difficult. This PR adds a function decorator that wraps these problematic functions to guarantee exception reporting.Current behavior reports that an error occurs to the user and the full stack trace is saved to the log in
~/.cellpose/run.log