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.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -877,9 +877,10 @@ class TreeWindowBase(QMdiSubWindow): · 876 unmodified lines | ||
| 877 | 877 | super(TreeWindowBase, self).__init__(parent) |
| 878 | 878 | |
| 879 | 879 | self.model = None |
| 880 | − self.view = None | |
| 881 | 880 | self.find_bar = None |
| 882 | 881 | |
| 882 | + self.view = QTreeView() | |
| 883 | + | |
| 883 | 884 | def DisplayFound(self, ids): |
| 884 | 885 | if not len(ids): |
| 885 | 886 | return False |
| @@ -921,7 +922,6 @@ class CallGraphWindow(TreeWindowBase): · 35 unmodified lines | ||
| 921 | 922 | |
| 922 | 923 | self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x)) |
| 923 | 924 | |
| 924 | − self.view = QTreeView() | |
| 925 | 925 | self.view.setModel(self.model) |
| 926 | 926 | |
| 927 | 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 | 945 | self.model = LookupCreateModel("Call Tree", lambda x=glb: CallTreeModel(x)) |
| 946 | 946 | |
| 947 | − self.view = QTreeView() | |
| 948 | 947 | self.view.setModel(self.model) |
| 949 | 948 | |
| 950 | 949 | for c, w in ((0, 230), (1, 100), (2, 100), (3, 70), (4, 70), (5, 100)): |