Fix wrong pointer type casting

Method event can get called with QChildEvent instead of
QHelpEvent.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
This commit is contained in:
Melg Eight 2022-02-10 04:20:53 +03:00
parent 72ab898db7
commit 4e1269974f
No known key found for this signature in database
GPG Key ID: 8F73D998D1992669

View File

@ -39,10 +39,11 @@ class tipMenu : public QMenu
tipMenu(QString n, QWidget *w) : QMenu(n, w) {}
bool event (QEvent * e)
{
const QHelpEvent *helpEvent = static_cast <QHelpEvent *>(e);
if (helpEvent->type() == QEvent::ToolTip && activeAction() &&
if (e->type() == QEvent::ToolTip && activeAction() &&
activeAction()->toolTip() != activeAction()->text()) {
QToolTip::showText(helpEvent->globalPos(),
const QHelpEvent *helpEvent = static_cast <QHelpEvent *>(e);
QToolTip::showText(helpEvent->globalPos(),
activeAction()->toolTip());
} else {
QToolTip::hideText();