[Interest] Strange font used for QSpinbox in QT4

zdenko podobny zdenop at gmail.com
Fri Dec 28 22:49:48 CET 2012


Hello,

I found out that can not see numbers in QSpinbox in all application created
with QT4 (4.8.4 openSUSE 12.2). Other common widgets looks ok. I know it
was ok in past, but I can not find reason what cause this (installation of
some font, or QT5???).

I thought problem is in used font for QSpinbox so I created simple test
application, but setting font have no effect. When I compile the same
application with QT5 numbers are ok. Here is my code:

  QApplication app(argc,argv);


  QSpinBox* mySpinBox = new QSpinBox();

  mySpinBox->setWindowTitle("QSpinBox Text Size");

  mySpinBox->setFixedSize(150,50);

  mySpinBox->setValue(50);


  QFont* font = new QFont();

  font->fromString("Serif,0,25,30,75,0,0,0,0,0");

  mySpinBox->setFont(*font);


  qDebug()  << "style:" << mySpinBox->style();

  QFont fontDebug = mySpinBox->font();

  qDebug() << "QFontInfo:" << QFontInfo(fontDebug).family();

  qDebug() << "fontDebug:" << fontDebug.toString();

  qDebug() << "styleSheet:" << mySpinBox->styleSheet();

  mySpinBox->show();

  return app.exec();


QT4 debug output:

style: QPlastiqueStyle(0xa188e0, name = "plastique")

QFontInfo: "Times New Roman"

fontDebug: "Serif,-1,25,30,75,0,0,0,0,0"

styleSheet: ""

QT5 debug output:

style: 0x109d050

QFontInfo: "Times New Roman"

fontDebug: "Serif,-1,25,30,75,0,0,0,0,0"

styleSheet: ""

I tried to remove user configuration (~/.config) but it did not help. I
tried to run application under other user account but it did not help. It
looks like there is some system-wide setting that cause this.

Do you have any idea how to identified where is problem?

Zdenko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121228/e6a64812/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QSpinbox-Qt5.png
Type: image/png
Size: 9701 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121228/e6a64812/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QSpinbox-Qt4.png
Type: image/png
Size: 9160 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121228/e6a64812/attachment-0001.png>


More information about the Interest mailing list