From 7a56d615dff6ae629599093f41b7610880949a8c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 18 Oct 2024 10:59:14 +0200 Subject: [PATCH] UI Tour: Fix clicking on the User Interface link at the end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends df54a15651567e534bdb56c84e357eb2dc81d88b When fixing QTCREATORBUG-31447 this broke in turn. We may not filter out click events to the text. Fixes: QTCREATORBUG-31850 Change-Id: I0afd0db64c28d111109c80a8644bb4d94535ef6f Reviewed-by: Christian Stenger Reviewed-by: Robert Löhning --- src/plugins/welcome/introductionwidget.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index 4da7e937b33..1869947503f 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -86,8 +87,12 @@ IntroductionWidget::IntroductionWidget() m_stepText->setTextFormat(Qt::RichText); // why is palette not inherited??? m_stepText->setPalette(palette()); - m_stepText->setOpenExternalLinks(true); - m_stepText->installEventFilter(this); + connect(m_stepText, &QLabel::linkActivated, this, [this](const QString &link) { + // clicking the User Interface link should both open the documentation page + // and step forward (=end the tour) + step(); + QDesktopServices::openUrl(link); + }); layout->addWidget(m_stepText); m_continueLabel = new QLabel(this); @@ -173,12 +178,8 @@ bool IntroductionWidget::event(QEvent *e) bool IntroductionWidget::eventFilter(QObject *obj, QEvent *ev) { - if (obj == parent() && ev->type() == QEvent::Resize) { + if (obj == parent() && ev->type() == QEvent::Resize) resizeToParent(); - } else if (obj == m_stepText && ev->type() == QEvent::MouseButtonRelease) { - step(); - return true; - } return QWidget::eventFilter(obj, ev); }