Test Crash Because Of Fontfamilyalias
Unsolved
General and Desktop
-
Hi,
I have a Qt test suite which reads some sort of configuration from a qml file in
initTestCase()
.
Unfortunately when loading the qml file into aQQmlComponent
I get0xc0000005
when trying to resolve the fontFamilyAlias "Roboto" inQFontDatabasePrivate::resolveFontFamilyAlias
.void TestSuite::initTestCase() { // Create QCoreApplication TestUtil::QtAppInstance::instance(); // Create QQmlEngine m_engine.reset(new QQmlEngine()); // Load config file m_qmlFile.reset(new QQmlComponent(m_engine.get(), QUrl("pathToQml))); <--- ERROR m_pAObj.reset(m_qmlFile->create()); }
I have other test suites where I do not read that qml file and it works fine.
I do use that fontpack in my application like this
main.cppqint32 fontId = QFontDatabase::addApplicationFont( ":/font/RobotoCondensed-VariableFont_wght.ttf"); QStringList fontList = QFontDatabase::applicationFontFamilies(fontId); QString family = fontList.first(); QGuiApplication::setFont(QFont(family));
So, why does my test know anything about that font?
-
You should use a debugger to see where it really crashes and if you can reproduce it, create a minimal, compilable example so we can also take a look on it.