You can force the uppercase by setting the capitalization of your spinBox
's font to QFont::AllUppercase
QFont font = ui->spinBox->font();
font.setCapitalization(QFont::AllUppercase);
ui->spinBox->setFont(font);
EDIT: I have prepared a small example to show the behavior
#include <QWidget>
#include <QApplication>
#include <QHBoxLayout>
#include <QSpinBox>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *w = new QWidget();
QLayout* layout = new QHBoxLayout(w);
QSpinBox* spinBox = new QSpinBox(w);
spinBox->setRange(0, 0xFF);
spinBox->setDisplayIntegerBase(16);
QFont font = spinBox->font();
font.setCapitalization(QFont::AllUppercase);
spinBox->setFont(font);
QSpinBox* spinBox2 = new QSpinBox(w);
spinBox2->setRange(0, 0xFF);
spinBox2->setDisplayIntegerBase(16);
spinBox->setValue(0x1a);
spinBox2->setValue(0x1a);
layout->addWidget(spinBox);
layout->addWidget(spinBox2);
w->show();
return a.exec();
}
This gives the following result :
