Dear all, I would like to implement a "scientific" spin box, with features such as: 1 - Automatic switch to scientific notation if required, but not for simple numbers 2 - Number precision not limited by display (the edited number can have much more digits than displayed in non-edit mode) 3 - Handling of units automatically (such as switch from m to nm, µm, km, etc...)
I managed to subclass QDoubleSpinBox and have 1 working. But 2 and 3 seem not possible with QDoubleSpinBox. So: - Is this possible to implement it from QAbstractSpinBox? It should be, but it seems that QAbstractSpinBox was only meant for having a common interface between Qt spin boxes, and is not really subclassable by the user. For instance, text() is read-only, and there is absolutely no hint in the documentation about how to output a different text, as text() cannot be subclassed (non virtual) - I am thinking about redoing everything from scratch, using QStylePainter functions for drawing the spinbox. However, I cannot understand from QAbstractSpinBox::paintEvent source how the spinbox text is drawed, as it seems to be never passed to options and painter. So I'm not sure how to use it. Thanks in advance, Etienne
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
