QGuiApplication::font(): assert that a GUI app instance exists

Task-number: QTBUG-28306
Change-Id: Ia5b01265e7f88fdd8c2738ef03b14e83829625b0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
J-P Nurmi 2012-11-30 16:01:14 +01:00 committed by The Qt Project
parent 40e6b1d0b8
commit e93a69349f

View File

@ -2293,6 +2293,7 @@ void QGuiApplication::setPalette(const QPalette &pal)
*/
QFont QGuiApplication::font()
{
Q_ASSERT_X(QGuiApplicationPrivate::self, "QGuiApplication::font()", "no QGuiApplication instance");
QMutexLocker locker(&applicationFontMutex);
initFontUnlocked();
return *QGuiApplicationPrivate::app_font;