disable code that does not preload the font cache with Qt6
This commit is contained in:
parent
caf75721d4
commit
5a25804cec
@ -86,8 +86,28 @@ static bool pluginPath = initPluginPath();
|
|||||||
|
|
||||||
#if defined( ENSURE_FONTS )
|
#if defined( ENSURE_FONTS )
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void preloadFonts()
|
||||||
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
|
QElapsedTimer timer;
|
||||||
|
timer.start();
|
||||||
|
|
||||||
|
QFontDatabase(); // deprecated and doing nothing since Qt6
|
||||||
|
|
||||||
|
const auto elapsed = timer.elapsed();
|
||||||
|
|
||||||
|
if ( elapsed > 20 )
|
||||||
|
{
|
||||||
|
qWarning() << "Loading fonts needed" << elapsed << "ms"
|
||||||
|
<< "- usually because of creating a font cache.";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void initFonts()
|
static void initFonts()
|
||||||
{
|
{
|
||||||
@ -100,18 +120,7 @@ static bool pluginPath = initPluginPath();
|
|||||||
qputenv( env, STRING( FONTCONFIG_FILE ) );
|
qputenv( env, STRING( FONTCONFIG_FILE ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QElapsedTimer timer;
|
preloadFonts();
|
||||||
timer.start();
|
|
||||||
|
|
||||||
QFontDatabase();
|
|
||||||
|
|
||||||
const auto elapsed = timer.elapsed();
|
|
||||||
|
|
||||||
if ( elapsed > 20 )
|
|
||||||
{
|
|
||||||
qWarning() << "Loading fonts needed" << elapsed << "ms"
|
|
||||||
<< "- usually because of creating a font cache.";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The default initialization in QskSkin sets up its font table
|
The default initialization in QskSkin sets up its font table
|
||||||
|
Loading…
x
Reference in New Issue
Block a user