From e831703aae9523362f65598d6865bb444efa8bcf Mon Sep 17 00:00:00 2001 From: phowstan <46815312+phowstan@users.noreply.github.com> Date: Wed, 30 Jan 2019 11:13:03 +0000 Subject: [PATCH] Handled null cursor correctly in wxQt SetCursor() Make passing invalid wxCursor object to SetCursor() work and reset any previously specified cursor. Closes https://github.com/wxWidgets/wxWidgets/pull/1197 --- src/qt/window.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 9690d97405..c4011e0ce1 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -518,7 +518,10 @@ bool wxWindowQt::SetCursor( const wxCursor &cursor ) if (!wxWindowBase::SetCursor(cursor)) return false; - GetHandle()->setCursor(cursor.GetHandle()); + if ( cursor.IsOk() ) + GetHandle()->setCursor(cursor.GetHandle()); + else + GetHandle()->unsetCursor(); return true; }