From 3f2db1b027c4e8afd655103e19fe0686be75c16a Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 13:17:15 +0000 Subject: [PATCH] Fix item index in wxRadioBox events in wxQt Use 0-based index for the radio box items, as in the other ports, instead of auto-generated values. Closes https://github.com/wxWidgets/wxWidgets/pull/1127 --- src/qt/radiobox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 4e58afed50..b2093e3596 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -116,10 +116,12 @@ static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, in Button *btn; bool isFirst = true; + int id = 0; + while ( count-- > 0 ) { btn = new Button( wxQtConvertString( *choices++ )); - qtButtonGroup->addButton( btn ); + qtButtonGroup->addButton( btn, id++ ); qtBoxLayout->addWidget( btn ); if ( isFirst )