Change Qt font to native system default font

In my native Cocoa app (on OSX 10.10) the buttons look like this:

native OSX

In Qt (4.8.6) the buttons look like this:

Qt

As you can see, the font is different and the text is not vertically centered.

How can I use Qt for the system standard font and how can I vertically center the text in buttons? (The Qt font is the same (wrong) in all other widgets, so buttons are just an example.)


Through this , this and this :

I added this code which corrects it somewhat (it is now correctly centered), I think the font is different but still not correct.

#ifdef Q_OS_MACX
    // fix OSX 10.9 font
    // http://successfulsoftware.net/2013/10/23/fixing-qt-4-for-mac-os-x-10-9-mavericks/
    // https://bugreports.qt.io/browse/QTBUG-32789
    QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
    // fix OSX 10.10 font
    // https://bugreports.qt.io/browse/QTBUG-40833
    QFont::insertSubstitution(".Helvetica Neue DeskInterface", "Helvetica Neue");
#endif

      

It now looks like this:

qt-with-fix

I've also tried Qt 5.3.2, but there is no difference:

qt5

+3
qt macos


source to share


No one has answered this question yet

Check out similar questions:

566
How do I install or change the default Java (JDK) version on OS X?
7
Why is there a @ font-face difference in Windows and Mac OS X?
five
How to handle changing the system font between OS X 10.9 and 10.10
4
Can't sign app bundle using Qt frameworks on OS X 10.10
3
Rotating WA_TranslucentBackground disables window repainting
2
NSTextField vertically offsets text when using a custom font
1
QT QApplication: setFont () Questions
1
QMessageBoxes have very strange behavior on OSX
0
OSX10.8 Font size / anti-aliasing screwed when loading google map
0
QGridLayout does not change or redraw when hiding child widgets



All Articles
Loading...
X
Show
Funny
Dev
Pics