From e5042a6a539f7ddabe73a8cc2e979baffb1aa710 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Apr 2021 13:05:09 +0200 Subject: [PATCH] Implement wxSpinCtrl::GetTextValue() for wxQt too --- include/wx/qt/spinctrl.h | 1 + src/qt/spinctrl.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/wx/qt/spinctrl.h b/include/wx/qt/spinctrl.h index 9355ff9fc6..c6f0ca5954 100644 --- a/include/wx/qt/spinctrl.h +++ b/include/wx/qt/spinctrl.h @@ -29,6 +29,7 @@ public: T min, T max, T initial, T inc, const wxString& name ); + virtual wxString GetTextValue() const wxOVERRIDE; virtual void SetValue(const wxString&) wxOVERRIDE {} virtual void SetSnapToTicks(bool snap_to_ticks) wxOVERRIDE; diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index 1e67adc6af..d1c4b628f4 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -58,6 +58,12 @@ bool wxSpinCtrlQt< T, Widget >::Create( wxWindow *parent, wxWindowID id, return QtCreateControl( parent, id, pos, size, style, wxDefaultValidator, name ); } +template< typename T, typename Widget > +wxString wxSpinCtrlQt< T, Widget >::GetTextValue() const +{ + return wxQtConvertString(m_qtSpinBox->text()); +} + template< typename T, typename Widget > void wxSpinCtrlQt< T, Widget >::SetValue( T val ) {