From 928b00ad556c9dbd6c34b877aec16ed9462121d6 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Tue, 4 Dec 2018 10:02:39 +0000 Subject: [PATCH] Fix setting initial value of wxSpinCtrl in wxQt When creating a QSpinBox, the range must be set before setting the initial value as otherwise setting it would fail if it were outside of the default [0, 99] range. This fixes a test failure in the corresponding unit test. Closes https://github.com/wxWidgets/wxWidgets/pull/1041 --- src/qt/spinctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index ee0b1e670d..e7cdeddff7 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -42,8 +42,8 @@ bool wxSpinCtrlQt< T, Widget >::Create( wxWindow *parent, wxWindowID id, m_qtSpinBox->setAccelerated(true); // to match gtk behavior - SetValue( initial ); SetRange( min, max ); + SetValue( initial ); SetIncrement( inc ); if ( !value.IsEmpty() )