aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYordan Karadzhov (VMware) <y.karadz@gmail.com>2019-07-15 16:20:41 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-18 17:04:56 -0400
commite9ad1b94a320dc8f380924caf4bfc93654d3020d (patch)
tree2883131dfa1b1451f14274b628d2aae896cfd1d4
parent8b4bd284b975fdfe4539e00a17a181ec8af1c4e1 (diff)
downloadtrace-cmd-e9ad1b94a320dc8f380924caf4bfc93654d3020d.tar.gz
kernel-shark: Always clear the marker after resizing the table.
It looks more like a Qt bug, but sometimes the automatic resize of the table widget done in KsTraceViewer::_resizeToContents() has the parasitic effect to select the first row of the table (making the row green). If this is happening clear the selection by hand. Link: http://lore.kernel.org/linux-trace-devel/20190715132042.5154-3-y.karadz@gmail.com Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel-shark/src/KsTraceViewer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp
index 89e5dba2..c176cefe 100644
--- a/kernel-shark/src/KsTraceViewer.cpp
+++ b/kernel-shark/src/KsTraceViewer.cpp
@@ -563,13 +563,21 @@ void KsTraceViewer::keyReleaseEvent(QKeyEvent *event)
void KsTraceViewer::_resizeToContents()
{
- int rows, columnSize;
+ int rows, columnSize, markRow = selectedRow();
_view.setVisible(false);
_view.resizeColumnsToContents();
_view.setVisible(true);
/*
+ * It looks like a Qt bug, but sometimes when no row is selected in
+ * the table, the automatic resize of the widget (the lines above) has
+ * the parasitic effect to select the first row of the table.
+ */
+ if (markRow == KS_NO_ROW_SELECTED)
+ _view.clearSelection();
+
+ /*
* Because of some unknown reason the first column doesn't get
* resized properly by the code above. We will resize this
* column by hand.