As creation of a font is time consuming, create one application font instance

p4#: 21338
This commit is contained in:
Magne Sjaastad
2013-04-19 08:02:36 +02:00
parent fc84fce67f
commit b5b9a736e2
8 changed files with 42 additions and 27 deletions

View File

@@ -135,6 +135,10 @@ RiaApplication::RiaApplication(int& argc, char** argv)
//m_startupDefaultDirectory += "/My Documents/";
#endif
setDefaultFileDialogDirectory("MULTICASEIMPORT", "/");
// The creation of a font is time consuming, so make sure you really need your own font
// instead of using the application font
m_standardFont = new cvf::FixedAtlasFont(cvf::FixedAtlasFont::STANDARD);
}
@@ -1422,3 +1426,16 @@ bool RiaApplication::addEclipseCases(const QStringList& fileNames)
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Font* RiaApplication::standardFont()
{
CVF_ASSERT(m_standardFont.notNull());
// The creation of a font is time consuming, so make sure you really need your own font
// instead of using the application font
return m_standardFont.p();
}