@@ -563,12 +563,20 @@ 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
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. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- kernel-shark/src/KsTraceViewer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)