summaryrefslogtreecommitdiff
path: root/mycustomspinbox.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
committerChristoph Berg <myon@debian.org>2026-04-07 19:02:45 +0200
commitf647d78463c1250ce9c99af664615fafccf5e959 (patch)
tree5b00428cef68aef1c9d407e2d4535687422419b6 /mycustomspinbox.cpp
parent0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff)
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'mycustomspinbox.cpp')
-rw-r--r--mycustomspinbox.cpp16
1 files changed, 16 insertions, 0 deletions
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;
+}