Skip to content

Commit

Permalink
ui: fixed exception colorizing cells
Browse files Browse the repository at this point in the history
On some distros (Fedora 37), on the very 1st launch of the GUI, it
crashed with the error:
 "object of type QCommonStyle has been deleted"

The only way I've found of getting rid of this error is by obtaining this
object on every paint() call.
  • Loading branch information
gustavo-iniguez-goya committed Feb 26, 2023
1 parent 303c7f7 commit df5fe3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/opensnitch/customwidgets/colorizeddelegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def paint(self, painter, option, index):
defaultPen = painter.pen()
defaultBrush = painter.brush()

self._style = QApplication.style()
# get default margins in order to respect them.
# option.widget is the QTableView
hmargin = self._style.pixelMetric(
Expand Down

0 comments on commit df5fe3b

Please sign in to comment.