diff options
| author | Christoph Berg <myon@debian.org> | 2025-01-09 22:12:06 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-01-09 22:12:06 +0100 |
| commit | 992d4b4b8d3f3a630a2cf00d593ee4ce4dfa7ce8 (patch) | |
| tree | fbfdfe6bcb0a8a114be2480dac53d88c977e4869 /widgets/LettersSpinBox.cpp | |
| parent | 4320ce238aae1fe87fc9f379cdd816e9317885fa (diff) | |
New upstream version 2.7.0~rc8+repackupstream/2.7.0_rc8+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 05db1ead..9079d8d9 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; +} |
