QCustomPlot Discussion and Comments

Blurry tick label after porting to Qt6.2.4Return to overview

Hi,

I recently ported my project to Qt 6.2.4 from Qt5.15. With the patch I found on this forum, my application works correct on Linux. But I have an issue with my windows build. OpenGL is disabled.

It appears that the tick labels become blurry when a display is configured with 125 % scaling in Windows.
I have compiled the sample code from the tutorial section and I still get the same result. You can see the result here: https://postimg.cc/GHGTSWYJ

Does anyone else have had this issue? Or maybe a fix?

try setPlottingHint and disable phCacheLabels

I noticed the same problem, but unfortunately I do not know how to fix it.

Hopefully new release will fix this issue.


Disabling cacheLabels has no effect. I have also tested with Qt 6.3.1

customPlot->setPlottingHint(QCP::phCacheLabels, false);

try setting this:
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);

if i remember correctly it was enough to fix it in my case.

Thanks abcd for the suggestion, but it didn't work for me.

But I did fix my blurry tick labels. I found following bug in a Qt application: https://phabricator.kde.org/D20171

I have added a slot for the screenChanged signal and in this slot I update the device pixel ratio (setBufferDevicePixelRatio) of qcustomplot. This fixes my issue during runtime when moving the window from one screen to the other, but it didn't work at startup.

For some strange reason, devicePixelRatio() returns the wrong value in the qcustomplot constructor. So this causes the blurry tick labels. The fix for this issue is to call the new slot in the constructor of MainWindow.

Greetz