There are several options:
QLineEdit with Validator is not enough for us, we were unable to achieve convenient editing and correct presentation (with symbols "," and "degrees" in place and the ability to prohibit incorrect values ββand still allow semi-correct states, and the target behavior is not to flag errors and force the user to correct them, and so that the user can enter only valid values).
Three spins are edited in a line with the corresponding characters between them, grouped as one widget and some code to move keyboard input from one next to the right, etc. In some cases, it looks good enough, and you can find an implementation option in the famous Marble project.
However, my boss said that this approach is almost as ugly as the first, so here is another approach: a subclass of QAbstractSpinBox, as Trolltech did in its QDateTimeEditor. In fact, the behavior of such a widget is almost similar to the one implemented in QDateTimeEditor. I myself have not done this yet, setting priorities for the tasks, but I will have to do it.
Maxim Popravko
source share