From 2c91463c81fef4ffa72c5490a680e072fe627272 Mon Sep 17 00:00:00 2001 From: Matthew Griffin <45285214+matthew-griffin@users.noreply.github.com> Date: Fri, 13 Sep 2019 13:17:27 +0100 Subject: [PATCH] Enable mouse tracking on construction of every wxQt widget Not all controls use wxWindow::Create(), so move setMouseTracking() call where it is always executed. Closes https://github.com/wxWidgets/wxWidgets/pull/1528 --- include/wx/qt/private/winevent.h | 1 + src/qt/window.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/wx/qt/private/winevent.h b/include/wx/qt/private/winevent.h index f29b329e67..87623cf605 100644 --- a/include/wx/qt/private/winevent.h +++ b/include/wx/qt/private/winevent.h @@ -61,6 +61,7 @@ public: QObject::connect( this, &QObject::destroyed, this, &wxQtEventSignalHandler::HandleDestroyedSignal ); + Widget::setMouseTracking(true); } void HandleDestroyedSignal() diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 2530a016cf..84e8e0ace1 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -319,8 +319,6 @@ bool wxWindowQt::Create( wxWindowQt * parent, wxWindowID id, const wxPoint & pos m_qtWindow = new wxQtWidget( parent, this ); } - - GetHandle()->setMouseTracking(true); if ( !wxWindowBase::CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) return false;