QDoubleSpinBox (and QDateTimePicker) not centered like QSpinBox
5e9c6575 attempted to center spinbox text, but only managed to do so for QSpinBox, not other subclasses of QAbstractSpinBox.
I think QDoubleSpinBox obviously benefits from centering, but I'm not sure about QDateTimePicker, since I'm not sure how it's used in practice. So I don't know whether to center all QAbstractSpinBox or only QSpinBox and QAbstractSpinBox.
I rebuilt Breeze locally with all QAbstractSpinBox centered, and whipped up a test program for QDateTimePicker. I think that using it as a month picker looks good when centered (but I'm not sure about a numeric date/time picker):
Patch:
diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
index 608f40b7..c631340e 100644
--- a/kstyle/breezestyle.cpp
+++ b/kstyle/breezestyle.cpp
@@ -40,7 +40,7 @@
#include <QRadioButton>
#include <QScrollBar>
#include <QItemDelegate>
-#include <QSpinBox>
+#include <QAbstractSpinBox>
#include <QSplitterHandle>
#include <QTextEdit>
#include <QToolBar>
@@ -419,7 +419,7 @@ namespace Breeze
widget->setAttribute(Qt::WA_StyledBackground);
} else if ( auto btn = qobject_cast<QPushButton*> (widget) ) {
btn->setAutoDefault(false);
- } else if ( auto spbx = qobject_cast<QSpinBox*> (widget) ) {
+ } else if ( auto spbx = qobject_cast<QAbstractSpinBox*> (widget) ) {
spbx->setAlignment(Qt::AlignCenter);
}
Edited by Tabby Kitten