From f647d78463c1250ce9c99af664615fafccf5e959 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Tue, 7 Apr 2026 19:02:45 +0200 Subject: New upstream version 3.0.0 --- mycustomspinbox.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 mycustomspinbox.cpp (limited to 'mycustomspinbox.cpp') diff --git a/mycustomspinbox.cpp b/mycustomspinbox.cpp new file mode 100644 index 00000000..0a61c906 --- /dev/null +++ b/mycustomspinbox.cpp @@ -0,0 +1,16 @@ +#include "mycustomspinbox.h" + +MyCustomSpinBox::MyCustomSpinBox(QWidget *parent) + : QSpinBox(parent) +{ +} + +QString MyCustomSpinBox::textFromValue(int val) const +{ + // Determine the desired number of digits (e.g., 2 for "01", "09", "10") + // You can make this dynamic based on the maximum value or a fixed number. + int desiredDigits = 3; // Example: always show at least 3 digits + + QString formattedString = QString("%1").arg(val, desiredDigits, 10, QChar('0')); + return formattedString; +} -- cgit v1.2.3