Fixed another flags use. eric7

Sun, 27 Jun 2021 11:22:03 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 27 Jun 2021 11:22:03 +0200
branch
eric7
changeset 8443
8794cb212647
parent 8442
a23078cc9fa7
child 8444
88b242eba71b

Fixed another flags use.

eric7/WebBrowser/History/HistoryTreeModel.py file | annotate | diff | comparison | revisions
--- a/eric7/WebBrowser/History/HistoryTreeModel.py	Sat Jun 26 19:24:53 2021 +0200
+++ b/eric7/WebBrowser/History/HistoryTreeModel.py	Sun Jun 27 11:22:03 2021 +0200
@@ -232,12 +232,13 @@
         @param index index of the item (QModelIndex)
         @return flags (Qt.ItemFlags)
         """
-        if not index.isValid():
-            return Qt.ItemFlags(Qt.ItemFlag.NoItemFlags)
-        return Qt.ItemFlags(
-            Qt.ItemFlag.ItemIsSelectable |
-            Qt.ItemFlag.ItemIsEnabled |
-            Qt.ItemFlag.ItemIsDragEnabled)
+        return (
+            Qt.ItemFlag.NoItemFlags
+            if not index.isValid() else
+            (Qt.ItemFlag.ItemIsSelectable |
+             Qt.ItemFlag.ItemIsEnabled |
+             Qt.ItemFlag.ItemIsDragEnabled)
+        )
     
     def setSourceModel(self, sourceModel):
         """

eric ide

mercurial