diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2022-08-23 10:23:16 +0200 |
| commit | 2d1068e60bce7ae1fff11623454900e8cee956b1 (patch) | |
| tree | acebe276e30466ef0ab91bc3da5e379bec0d7dc5 /widgets/LettersSpinBox.cpp | |
| parent | 43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (diff) | |
New upstream version 2.6.0~rc3+repackupstream/2.6.0_rc3+repack
Diffstat (limited to 'widgets/LettersSpinBox.cpp')
| -rwxr-xr-x | widgets/LettersSpinBox.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/widgets/LettersSpinBox.cpp b/widgets/LettersSpinBox.cpp index 9079d8d9..05db1ead 100755 --- a/widgets/LettersSpinBox.cpp +++ b/widgets/LettersSpinBox.cpp @@ -1,25 +1,25 @@ -#include "LettersSpinBox.hpp" - -#include <QString> -#include "moc_LettersSpinBox.cpp" - -QString LettersSpinBox::textFromValue (int value) const -{ - QString text; - do { - auto digit = value % 26; - value /= 26; - text = QChar {lowercase_ ? 'a' + digit : 'A' + digit} + text; - } while (value); - return text; -} - -int LettersSpinBox::valueFromText (QString const& text) const -{ - int value {0}; - for (int index = text.size (); index > 0; --index) - { - value = value * 26 + text[index - 1].toLatin1 () - (lowercase_ ? 'a' : 'A'); - } - return value; -} +#include "LettersSpinBox.hpp"
+
+#include <QString>
+#include "moc_LettersSpinBox.cpp"
+
+QString LettersSpinBox::textFromValue (int value) const
+{
+ QString text;
+ do {
+ auto digit = value % 26;
+ value /= 26;
+ text = QChar {lowercase_ ? 'a' + digit : 'A' + digit} + text;
+ } while (value);
+ return text;
+}
+
+int LettersSpinBox::valueFromText (QString const& text) const
+{
+ int value {0};
+ for (int index = text.size (); index > 0; --index)
+ {
+ value = value * 26 + text[index - 1].toLatin1 () - (lowercase_ ? 'a' : 'A');
+ }
+ return value;
+}
|
