From 14395990799390a472d0961f1311e70739f1fa7f Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 27 Sep 2022 18:43:17 -0500 Subject: [PATCH] Fix tooltip to be compatible with Qt 5.14 --- src/ui/prefab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/prefab.cpp b/src/ui/prefab.cpp index 054e6daa..150ed323 100644 --- a/src/ui/prefab.cpp +++ b/src/ui/prefab.cpp @@ -208,9 +208,9 @@ void Prefab::updatePrefabUi(Map *map) { parentFrame->layout()->addWidget(frame); // Clicking on the prefab graphics item selects it for painting. - QObject::connect(frame->ui->graphicsView_Prefab, &ClickableGraphicsView::clicked, [this, item](QMouseEvent *event){ + QObject::connect(frame->ui->graphicsView_Prefab, &ClickableGraphicsView::clicked, [this, item, frame](QMouseEvent *event){ selector->setPrefabSelection(item.selection); - QToolTip::showText(event->globalPosition().toPoint(), "Selected prefab!", nullptr, {}, 1000); + QToolTip::showText(frame->ui->graphicsView_Prefab->mapToGlobal(event->pos()), "Selected prefab!", nullptr, {}, 1000); }); // Clicking the delete button removes it from the list of known prefabs and updates the UI.