aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin ROBIN <dev@benjarobin.fr>2024-01-14 18:16:50 +0100
committerYordan Karadzhov <y.karadz@gmail.com>2024-01-20 12:06:16 +0200
commit05976148449f84d56379506d04a43b4bafd8d3b5 (patch)
tree4334ccae6cdc17968858890e3c5f651d758185e6
parent98291e2854981e0e77f55ccfaeb15604dd9efa35 (diff)
downloadkernel-shark-05976148449f84d56379506d04a43b4bafd8d3b5.tar.gz
kernelshark: Fix modelReset() signaling, rename update to updateGeom
Fix segfault introduced by the migration to Qt6. There was a public update() function in KsGLWidget class which overrides QWidget::update(). The QAbstractTableModel::modelReset signal was connected to the QWidget::update slot using "old" connect syntax. This was working since QWidget::update was declared as a slot, and registered in QWidget meta information. When migrating to Qt6, the new connect syntax was used, which accidentally connect the KsGLWidget::update function instead of QWidget::update. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218350 Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr> Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
-rw-r--r--src/KsGLWidget.cpp4
-rw-r--r--src/KsGLWidget.hpp2
-rw-r--r--src/KsTraceGraph.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp
index 023d1c83..9e3dac35 100644
--- a/src/KsGLWidget.cpp
+++ b/src/KsGLWidget.cpp
@@ -53,7 +53,7 @@ KsGLWidget::KsGLWidget(QWidget *parent)
setMouseTracking(true);
connect(&_model, &QAbstractTableModel::modelReset,
- this, &KsGLWidget::update);
+ this, qOverload<>(&KsGLWidget::update));
}
void KsGLWidget::_freeGraphs()
@@ -89,7 +89,7 @@ void KsGLWidget::initializeGL()
ksplot_init_font(&_font, 15, TT_FONT_FILE);
_labelSize = _getMaxLabelSize() + FONT_WIDTH * 2;
- update();
+ updateGeom();
}
/**
diff --git a/src/KsGLWidget.hpp b/src/KsGLWidget.hpp
index 03bd5eb1..1c6253fe 100644
--- a/src/KsGLWidget.hpp
+++ b/src/KsGLWidget.hpp
@@ -86,7 +86,7 @@ public:
void reset();
/** Reprocess all graphs. */
- void update() {resizeGL(width(), height());}
+ void updateGeom() {resizeGL(width(), height());}
void mousePressEvent(QMouseEvent *event);
diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp
index 65e5a796..f80477d4 100644
--- a/src/KsTraceGraph.cpp
+++ b/src/KsTraceGraph.cpp
@@ -614,7 +614,7 @@ void KsTraceGraph::updateGeom()
* widget is extended to maximum.
*/
- _glWindow.update();
+ _glWindow.updateGeom();
}
/**