From fcd6ee532432eed24a8c3904bad0c6c9c37dbf05 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Thu, 20 Jun 2019 12:02:12 +0100 Subject: [PATCH] Disable Qt's automatic "auto default" state for buttons Let the wx layer handle default-ness, as the auto behaviour has unhappy consequences that can't be controlled via the wx API. (For example, a Delete button being considered default simply because it's the first button in the dialog.) Closes https://github.com/wxWidgets/wxWidgets/pull/1366 --- src/qt/anybutton.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/anybutton.cpp b/src/qt/anybutton.cpp index 1bf235bd46..5c6f880c6b 100644 --- a/src/qt/anybutton.cpp +++ b/src/qt/anybutton.cpp @@ -85,8 +85,9 @@ wxAnyButton::wxAnyButton() : void wxAnyButton::QtCreate(wxWindow *parent) { - // create the default push button (used in button and bmp button) - m_qtPushButton = new wxQtPushButton( parent, this ); + // create the basic push button (used in button and bmp button) + m_qtPushButton = new wxQtPushButton(parent, this); + m_qtPushButton->setAutoDefault(false); } void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )