From 899b1dbc7424ce8023b665d91134048a84400a3a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 21 Jun 2024 03:16:21 +0300 Subject: [PATCH] Added ability to NumberInput to change limits. --- ui/widgets/fields/number_input.cpp | 4 ++++ ui/widgets/fields/number_input.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ui/widgets/fields/number_input.cpp b/ui/widgets/fields/number_input.cpp index 293cae0a..ceb5a6fa 100644 --- a/ui/widgets/fields/number_input.cpp +++ b/ui/widgets/fields/number_input.cpp @@ -21,6 +21,10 @@ NumberInput::NumberInput( } } +void NumberInput::changeLimit(int limit) { + _limit = limit; +} + void NumberInput::correctValue( const QString &was, int wasCursor, diff --git a/ui/widgets/fields/number_input.h b/ui/widgets/fields/number_input.h index 3e248956..84d1dc8e 100644 --- a/ui/widgets/fields/number_input.h +++ b/ui/widgets/fields/number_input.h @@ -23,6 +23,8 @@ class NumberInput final : public MaskedInputField { const QString &value, int limit); + void changeLimit(int limit); + protected: void correctValue( const QString &was,