WSJT-X/widgets/LettersSpinBox.cpp

26 lines
562 B
C++
Raw Normal View History

Make the main window more portable and font change capable The Rx meter is now a better Qt citizen and can be resized. Added a more obvious peak signal indicator. It is now a custom widget derived from QFrame and is now directly added via promotion in Designer. Added a custom widget to act as a letter spin box, this is used for sub mode control. Switched the frequency tolerance widget to a combo box with preset values so that it is more uniform across systems and font sizes. Added container widgets for group control of various UI widgets such as QSO controls, DX call controls and WSPR controls. Introduced a stacked widget to allow the WSPR controls to be swapped in in place of the "QSO" controls. The "QSO" controls are are the Rx, Tx and related controls along with the main tab widget with the message buttons and fields. This means that the WSPR version of the main window (and EME Echo mode) are now much cleaner. Increased the size of the rig control widget and styled its colour using a dynamic property so that it can be defined in the Designer UI definition. Reinstated it as a push button to do a rig control reset and retry after an error. Reset most UI widgets to default properties, particularly removing any fixed sizes so that they can resize freely when fonts are changed. The overall layout is now controlled almost exclusively by stretch factors on some of the rows and columns of the various grid layout managers. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5630 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-06-25 18:41:13 -04:00
#include "LettersSpinBox.hpp"
Make the main window more portable and font change capable The Rx meter is now a better Qt citizen and can be resized. Added a more obvious peak signal indicator. It is now a custom widget derived from QFrame and is now directly added via promotion in Designer. Added a custom widget to act as a letter spin box, this is used for sub mode control. Switched the frequency tolerance widget to a combo box with preset values so that it is more uniform across systems and font sizes. Added container widgets for group control of various UI widgets such as QSO controls, DX call controls and WSPR controls. Introduced a stacked widget to allow the WSPR controls to be swapped in in place of the "QSO" controls. The "QSO" controls are are the Rx, Tx and related controls along with the main tab widget with the message buttons and fields. This means that the WSPR version of the main window (and EME Echo mode) are now much cleaner. Increased the size of the rig control widget and styled its colour using a dynamic property so that it can be defined in the Designer UI definition. Reinstated it as a push button to do a rig control reset and retry after an error. Reset most UI widgets to default properties, particularly removing any fixed sizes so that they can resize freely when fonts are changed. The overall layout is now controlled almost exclusively by stretch factors on some of the rows and columns of the various grid layout managers. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5630 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-06-25 18:41:13 -04:00
#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);
Make the main window more portable and font change capable The Rx meter is now a better Qt citizen and can be resized. Added a more obvious peak signal indicator. It is now a custom widget derived from QFrame and is now directly added via promotion in Designer. Added a custom widget to act as a letter spin box, this is used for sub mode control. Switched the frequency tolerance widget to a combo box with preset values so that it is more uniform across systems and font sizes. Added container widgets for group control of various UI widgets such as QSO controls, DX call controls and WSPR controls. Introduced a stacked widget to allow the WSPR controls to be swapped in in place of the "QSO" controls. The "QSO" controls are are the Rx, Tx and related controls along with the main tab widget with the message buttons and fields. This means that the WSPR version of the main window (and EME Echo mode) are now much cleaner. Increased the size of the rig control widget and styled its colour using a dynamic property so that it can be defined in the Designer UI definition. Reinstated it as a push button to do a rig control reset and retry after an error. Reset most UI widgets to default properties, particularly removing any fixed sizes so that they can resize freely when fonts are changed. The overall layout is now controlled almost exclusively by stretch factors on some of the rows and columns of the various grid layout managers. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5630 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-06-25 18:41:13 -04:00
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');
}
Make the main window more portable and font change capable The Rx meter is now a better Qt citizen and can be resized. Added a more obvious peak signal indicator. It is now a custom widget derived from QFrame and is now directly added via promotion in Designer. Added a custom widget to act as a letter spin box, this is used for sub mode control. Switched the frequency tolerance widget to a combo box with preset values so that it is more uniform across systems and font sizes. Added container widgets for group control of various UI widgets such as QSO controls, DX call controls and WSPR controls. Introduced a stacked widget to allow the WSPR controls to be swapped in in place of the "QSO" controls. The "QSO" controls are are the Rx, Tx and related controls along with the main tab widget with the message buttons and fields. This means that the WSPR version of the main window (and EME Echo mode) are now much cleaner. Increased the size of the rig control widget and styled its colour using a dynamic property so that it can be defined in the Designer UI definition. Reinstated it as a push button to do a rig control reset and retry after an error. Reset most UI widgets to default properties, particularly removing any fixed sizes so that they can resize freely when fonts are changed. The overall layout is now controlled almost exclusively by stretch factors on some of the rows and columns of the various grid layout managers. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5630 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-06-25 18:41:13 -04:00
return value;
}