--- a/eric6/UI/SymbolsWidget.py Mon Apr 12 18:25:52 2021 +0200 +++ b/eric6/UI/SymbolsWidget.py Mon Apr 12 19:05:23 2021 +0200 @@ -373,9 +373,11 @@ elif col == 4: return unicodedata.name(chr(symbolId), '').title() - if role == Qt.ItemDataRole.BackgroundColorRole: - if index.column() == 0: - return QColor(Qt.GlobalColor.lightGray) + if ( + role == Qt.ItemDataRole.BackgroundColorRole and + index.column() == 0 + ): + return QColor(Qt.GlobalColor.lightGray) if role == Qt.ItemDataRole.TextColorRole: char = chr(symbolId) @@ -392,9 +394,11 @@ else: return QColor(Qt.GlobalColor.darkGray) - if role == Qt.ItemDataRole.TextAlignmentRole: - if index.column() in [0, 1, 3]: - return Qt.AlignmentFlag.AlignHCenter + if ( + role == Qt.ItemDataRole.TextAlignmentRole and + index.column() in [0, 1, 3] + ): + return Qt.AlignmentFlag.AlignHCenter return None