Add per-object display modes to the Objects panel#594
Open
markomarkovic wants to merge 7 commits into
Open
Conversation
PRINT_REDIRECTOR is a module-level singleton, so the lambda connected to sigStdoutWrite in prepare_panes accumulated one connection per MainWindow and was never disconnected. Each lambda also closed over self and resolved self.components["log"] late through a dict that MainMixin holds as a class attribute, so it reached whichever LogViewer registered last. Once a LogViewer was destroyed, the next print() called into a deleted C++ object and raised RuntimeError. Connecting the bound method instead lets PyQt drop the connection when the receiver is destroyed.
Introduces the display module: a per-object DisplayMode (Hidden, Wireframe, Transparent, Shaded), a panel-wide GlobalMode override, and effective_mode() resolving the two. HIDDEN always wins so an override never unhides an object.
Adds a per-object Display mode property (Hidden/Wireframe/Transparent/Shaded) to ObjectTreeItem and a panel-wide global mode on ObjectTree, emitting sigDisplayModesChanged/sigGlobalModeChanged with the resolved effective modes so the viewer can apply them.
Wires the object tree's display-mode signals to the viewer: apply_display_modes erases hidden objects and sets wireframe/shaded/transparency per object, and the Wireframe/Shaded/Transparent toolbar actions drive and reflect the global mode.
Replaces the name-column visibility checkbox with a row of mutually exclusive radios per object (Hidden/Wireframe/Transparent/Shaded) and an 'All' row that sets the global override. Radios are centered under centered header icons, and are torn down with the item so the joining QButtonGroup does not leak it.
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.
Adds per-object display modes to the Objects panel. Each object can be shown as shaded, transparent, or wireframe, or hidden, chosen from a row of radios in the tree. An All row applies a single mode to every object at once as a global override, while each object keeps its own mode underneath.
Testing
New
tests/test_display.pycovers the state model;tests/test_app.pyadds pytest-qt coverage for the tree state, viewer application, and the panel radios. The existingtest_inspectwas updated for the new "All" row and the radio-based visibility control.pytest tests/— full suite passes.Depends on #593 — this branch is stacked on it, so until #593 merges the diff also shows the
main_window.pyLogViewer fix.Claude AI assisted with the implementation under my direction; design, testing, and review are mine.