History

perf scripts python: exported-sql-viewer.py: Move view creation

As preparation for adding support for copying to clipboard, create view in TreeWindowBase instead of derived classes. Committer testing: Tested using an old .db used to test some older patches: $ python ~acme/libexec/perf-core/scripts/python/exported-sql-viewer.py ~/c/adrian.hunter/simple-retpoline.db Nothing breaks.

Adrian Hunter committed 7 years ago

Commit be6e7471 parent ca138a71 file · +2 −3Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+2−3
@@ -877,9 +877,10 @@ class TreeWindowBase(QMdiSubWindow): · 876 unmodified lines
877 super(TreeWindowBase, self).__init__(parent)877 super(TreeWindowBase, self).__init__(parent)
878 878
879 self.model = None879 self.model = None
880 self.view = None
881 self.find_bar = None880 self.find_bar = None
882 881
882 self.view = QTreeView()
883
883 def DisplayFound(self, ids):884 def DisplayFound(self, ids):
884 if not len(ids):885 if not len(ids):
885 return False886 return False
@@ -921,7 +922,6 @@ class CallGraphWindow(TreeWindowBase): · 35 unmodified lines
921 922
922 self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x))923 self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x))
923 924
924 self.view = QTreeView()
925 self.view.setModel(self.model)925 self.view.setModel(self.model)
926 926
927 for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):927 for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):
@@ -944,7 +944,6 @@ class CallTreeWindow(TreeWindowBase): · 16 unmodified lines
944 944
945 self.model = LookupCreateModel("Call Tree", lambda x=glb: CallTreeModel(x))945 self.model = LookupCreateModel("Call Tree", lambda x=glb: CallTreeModel(x))
946 946
947 self.view = QTreeView()
948 self.view.setModel(self.model)947 self.view.setModel(self.model)
949 948
950 for c, w in ((0, 230), (1, 100), (2, 100), (3, 70), (4, 70), (5, 100)):949 for c, w in ((0, 230), (1, 100), (2, 100), (3, 70), (4, 70), (5, 100)):