History

perf scripts python: exported-sql-viewer.py: Fix copy to clipboard from Top Calls by elapsed Time report

Provide missing argument to prevent following error when copying a selection to the clipboard: Traceback (most recent call last): File "tools/perf/scripts/python/exported-sql-viewer.py", line 4041, in <lambda> menu.addAction(CreateAction("&Copy selection", "Copy to clipboard", lambda: CopyCellsToClipboardHdr(self.view), self.view)) File "tools/perf/scripts/python/exported-sql-viewer.py", line 4021, in CopyCellsToClipboardHdr CopyCellsToClipboard(view, False, True) File "tools/perf/scripts/python/exported-sql-viewer.py", line 4018, in CopyCellsToClipboard view.CopyCellsToClipboard(view, as_csv, with_hdr) File "tools/perf/scripts/python/exported-sql-viewer.py", line 3871, in CopyTableCellsToClipboard val = model.headerData(col, Qt.Horizontal) TypeError: headerData() missing 1 required positional argument: 'role'

Adrian Hunter committed 5 years ago

Commit a6172051 parent bffcbe71 file · +1 −1Browse 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+1−1
@@ -3868,7 +3868,7 @@ def CopyTableCellsToClipboard(view, as_csv=False, with_hdr=False): · 3867 unmodified lines
38683868 if with_hdr:
38693869 model = indexes[0].model()
38703870 for col in range(min_col, max_col + 1):
3871− val = model.headerData(col, Qt.Horizontal)
3871+ val = model.headerData(col, Qt.Horizontal, Qt.DisplayRole)
38723872 if as_csv:
38733873 text += sep + ToCSValue(val)
38743874 sep = ","