In my main.cpp I set the font of the application like so:

Qt Code:
  1. //Font
  2. QString fontPath = ":/data/COUR.TTF";
  3. int id = QFontDatabase::addApplicationFont(fontPath);
  4. QString family = QFontDatabase::applicationFontFamilies(id).at(0);
  5. QFont default_font(family);
  6.  
  7. QApplication::setFont(default_font);
To copy to clipboard, switch view to plain text mode 
This works, mostly. For whatever reason all of the application that I can see correctly applies this font except for my most parent widget, QTabWidget.

I also have this snippet of code that is activated on a button press, inside a MainWindow function:

Qt Code:
  1. QApplication::setFont(QFontDialog::getFont(0, QApplication::font()));
To copy to clipboard, switch view to plain text mode 
When activated during runtime, this error is produced:

Qt Code:
  1. 2017-06-13 21:10:14.622 MYAPP[36930:4140590] Layout still needs update after calling -[QNSPanelContentsWrapper layout].
  2. QNSPanelContentsWrapper or one of its superclasses may have overridden -layout without calling super.
  3. Or, something may have dirtied layout in the middle of updating it. Both are programming errors in Cocoa Autolayout.
  4. The former is pretty likely to arise if some pre-Cocoa Autolayout class had a method called layout, but it should be fixed.
  5. (Edited a little for visual clarity)
To copy to clipboard, switch view to plain text mode 

I've looked at this bug report, which shows the exact same error and a similar-ish code, it may be relevant: https://bugreports.qt.io/browse/QTBUG-58699

Their code:

Qt Code:
  1. QColorDialog::getColor(QColor(1., 1., 1.), myWindow, "My Title", QColorDialog::DontUseNativeDialog);
To copy to clipboard, switch view to plain text mode 
That error is not produced by the MainWindow function if I remove the main.cpp settings, which makes me doubt its actually this bug. In addition, the MainWindow function correctly applies the font chosen to all but a few (seemingly) random widgets.

They (From the bug report) are on OSX 10.11.6, I am as well. They reported it for QT 5.8, I'm experiencing it with QT 5.9 and 5.8. If this is the case, this doesn't surprise me, as the bug report does not indicate it has been fixed. I can reproduce it on the QT Creator built debug version, and a statically built release version.

So my question boils down to these points:

1) Why does the main.cpp font code not work across all widgets?

2) Why does that MainWindow function not override the main.cpp settings?

3) Why does that MainWindow function (With the main.cpp part removed) not apply the settings to the entire application?

4) Are there better/easier ways to accomplish what I'm trying to do? (Set a font on application start, and provide a way for the user to customize it later)