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
3868 if with_hdr:3868 if with_hdr:
3869 model = indexes[0].model()3869 model = indexes[0].model()
3870 for col in range(min_col, max_col + 1):3870 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)
3872 if as_csv:3872 if as_csv:
3873 text += sep + ToCSValue(val)3873 text += sep + ToCSValue(val)
3874 sep = ","3874 sep = ","