All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin ROBIN <dev@benjarobin.fr>
To: <y.karadz@gmail.com>
Cc: <linux-trace-devel@vger.kernel.org>, Benjamin ROBIN <dev@benjarobin.fr>
Subject: [PATCH] KsGLWidget: Fix modelReset() signaling, rename update to updateGeom
Date: Thu, 11 Jan 2024 20:07:12 +0100	[thread overview]
Message-ID: <20240111190712.7670-1-dev@benjarobin.fr> (raw)

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>
---
 src/KsGLWidget.cpp   | 4 ++--
 src/KsGLWidget.hpp   | 2 +-
 src/KsTraceGraph.cpp | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp
index 023d1c8..9e3dac3 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 03bd5eb..1c6253f 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 65e5a79..f80477d 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();
 }
 
 /**
-- 
2.43.0


                 reply	other threads:[~2024-01-11 19:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240111190712.7670-1-dev@benjarobin.fr \
    --to=dev@benjarobin.fr \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.