QTextureGlyph Runtime Errors
Unsolved
General and Desktop
-
Hi,
Currently developing desktop application using QWidgets, deep in our code our base components are customized so we have some few paintEvent override, not sure if its related (most likely it is). I've been dealing this error and looking into stacktrace and breakpoint does not really make sense to me. I've check online and nothing really helped... GPT provided some DPI controls, it only made it happen less often, but it still happens.This is the GPT code:
#ifdef Q_OS_WIN // bypasses QTextureGlyphCache error might caused by high dpi scaling // Get the primary screen QScreen *lPrimaryScreen = QGuiApplication::primaryScreen(); if ( lPrimaryScreen ) { // Get the screen geometry (resolution) QRect lScreenGeometry = lPrimaryScreen->geometry(); int lWidth = lScreenGeometry.width(); int lHeight = lScreenGeometry.height(); if ( lWidth <= 1980 || lHeight <= 1080 ) { // if screen is 1080p or below QCoreApplication::setAttribute( Qt::AA_DisableHighDpiScaling ); } else { QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling ); QCoreApplication::setAttribute( Qt::AA_UseHighDpiPixmaps ); } } else { qDebug() << "No primary screen detected."; } #endif
Any thoughts on how to further debug this??
Thanks. -
Hi and welcome to devnet,
One thing that looks wrong is your if condition. 1080p is 1920x1080.
One thing you should try is the latest version of Qt 6. Improvements have happened on the High DPI side.