GUI - List item selection not working in Definitions Editor #66
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Affected File:
gui/definitions_editor_dialog.pyProblem Description:
User mouse clicks on items within the
QListWidgetinstances (for Asset Types, File Types, and Suppliers) in the Definitions Editor dialog do not trigger item selection or thecurrentItemChangedsignal. The first item is selected by default and its details are displayed correctly. Programmatic selection of items (e.g., via a diagnostic button) does correctly trigger thecurrentItemChangedsignal and updates the UI detail views. The issue is specific to user-initiated mouse clicks for selection after the initial load.Debugging Steps Taken & Findings:
Initial Analysis:
Documentation/02_Developer_Guide/06_GUI_Internals.md) andgui/definitions_editor_dialog.pysource code.currentItemChangedto display slots) are made.Logging in Display Slots (
_display_*_details):currentItemChangedis not firing.Color Swatch Palette Role:
QPalette.ColorRolefor color swatches (reverted fromBackgroundtoWindow). This fixed anAttributeErrorbut did not resolve the selection issue.Robust Error Handling in Display Slots:
try...finallyblocks with detailed logging. Confirmed slots complete without error for initial selection and signals for detail widgets are reconnected.Diagnostic Lambda for
currentItemChanged:currentItemChangedalongside the main display slot.QListWidgetitself was not emitting the signal.Explicit
setEnabledandsetSelectionModeonQListWidget:Explicit
setEnabledandsetFocusPolicy(Qt.ClickFocus)ontab_page(parent ofQListWidgetlayout):currentItemChangedand update the UI.Event Filter Investigation:
QListWidget: Did NOT receive mouse press/release events from user clicks.tab_page(parent ofQListWidget's layout): Did NOT receive mouse press/release events.self.tab_widget(QTabWidget): DID receive mouse press/release events.self.tab_widget's event filter to returnFalsefor events over the current page, attempting to ensure propagation.tab_widgetfilter, an event filter re-added toasset_type_list_widgetdid start receiving mouse press/release events. However,asset_type_list_widgetstill did not emitcurrentItemChangedfrom these user clicks.DebugListWidget(SubclassingQListWidget):DebugListWidgetoverridingmousePressEventwith logging.DebugListWidgetforasset_type_list_widget.DebugListWidget.mousePressEventlogs were NOT appearing for user clicks. This means that even with theQTabWidgetevent filter attempting to propagate events, and theasset_type_list_widget's filter (from step 8) confirming it received them, themousePressEventof theQListWidgetitself was not being triggered by those propagated events. This is the current mystery.Current Status:
asset_type_list_widget(afterQTabWidgetfilter modification) but do not result inmousePressEventbeing called on theQListWidget(orDebugListWidget) itself, and thus nocurrentItemChangedsignal is emitted.QListWidgetinstances when they are children of theQTabWidgetpages, even when events appear to reach the list widget via an event filter.Next Steps (When Resuming):
DebugListWidget.mousePressEventtest. If it's truly not being called despite its event filter seeing events, this is extremely unusual._create_tab_panemethod drastically for one tab:DebugListWidgetdirectly to thetab_page's layout without the intermediateleft_pane_layout.QListWidgetor its parents via stylesheets could be interfering with hit testing or event processing (unlikely for this specific symptom, but possible).QListWidgetor its items if a subtle corruption is occurring.QListWidgetwith aQListViewand aQStringListModelas a more fundamental change to see if the issue is specific toQListWidgetin this context.