From 7657684dadf0bc937b869fd122a316ec6e5fe6d6 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Tue, 7 Jun 2016 13:22:39 -0400 Subject: [PATCH] Fix mouse tracking to fix tooltip behavior. Also hide tooltips when the mouse is moved. --- apps/opencs/view/render/scenewidget.cpp | 3 +++ apps/opencs/view/render/worldspacewidget.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 2ba396563..93d3be865 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -173,6 +173,9 @@ SceneWidget::SceneWidget(boost::shared_ptr resourceSys mResourceSystem->getSceneManager()->setParticleSystemMask(Mask_ParticleSystem); + // Recieve mouse move event even if mouse button is not pressed + setMouseTracking(true); + /// \todo make shortcut configurable QShortcut *focusToolbar = new QShortcut (Qt::Key_T, this, 0, 0, Qt::WidgetWithChildrenShortcut); connect (focusToolbar, SIGNAL (activated()), this, SIGNAL (focusToolbarRequest())); diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index f8c3af2bb..782dc5354 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -646,7 +646,10 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent (QMouseEvent *event) mToolTipPos = event->globalPos(); if (mShowToolTips) + { + QToolTip::hideText(); mToolTipDelayTimer.start (mToolTipDelay); + } } SceneWidget::mouseMoveEvent(event);