Ensure that QGuiApplication is inited before using QFontDatabase
Change-Id: I494c4fdfa49139316efac0f68f8d463c02056372 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
parent
b9ec3e895f
commit
8bc026ddcc
@ -1227,6 +1227,9 @@ QString QFontDatabase::styleString(const QFontInfo &fontInfo)
|
|||||||
*/
|
*/
|
||||||
QFontDatabase::QFontDatabase()
|
QFontDatabase::QFontDatabase()
|
||||||
{
|
{
|
||||||
|
if (!qApp || !QGuiApplicationPrivate::platformIntegration())
|
||||||
|
qFatal("QFontDatabase: Must construct a QGuiApplication before accessing QFontDatabase");
|
||||||
|
|
||||||
QMutexLocker locker(fontDatabaseMutex());
|
QMutexLocker locker(fontDatabaseMutex());
|
||||||
createDatabase();
|
createDatabase();
|
||||||
d = privateDb();
|
d = privateDb();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user