The stylesheet applied to QTreeView::item in treeview.py has two related problems:
-
Row content shifts on hover. Normal items use margin: 5px while hover/selected states switch to margin: 0px; padding: 5px. These are different box model properties and cause the row content to visibly jump a few pixels to the right when the cursor enters the row.
-
Excessive row padding. The margin: 5px on the base item state makes rows taller than necessary.
Fix: Use padding consistently across all item states (base, :hover, :selected) and suppress the focus rectangle with QTreeView { outline: 0 }. This eliminates the shift, reduces row height, and keeps the hover/selection highlight flush across cells.
The stylesheet applied to
QTreeView::itemintreeview.pyhas two related problems:Row content shifts on hover. Normal items use
margin: 5pxwhile hover/selected states switch tomargin: 0px; padding: 5px. These are different box model properties and cause the row content to visibly jump a few pixels to the right when the cursor enters the row.Excessive row padding. The
margin: 5pxon the base item state makes rows taller than necessary.Fix: Use
paddingconsistently across all item states (base,:hover,:selected) and suppress the focus rectangle withQTreeView { outline: 0 }. This eliminates the shift, reduces row height, and keeps the hover/selection highlight flush across cells.