4

I developed a QGIS plugin by designing the interface with QT Designer.

The inferface appears correctly on my computer (left image).

However, on some computers, I encounter size problems, especially font size (right image).

I noticed that the problem was encountered when in the windows settings "scaling and layout", the variable "change the size of text, applications and other items" was set to 125% instead of 100% on my computer.

enter image description here

I have read a few things about the use of layout and the declaration of the environment variable QT_AUTO_SCREEN_SCALE_FACTOR =1.

Is there a trick to avoid this kind of problem?

3
  • 2
    I haven't used Qt but this might answer your question: charlesodale.com/…. EDIT: Just reread the link i posted. It seems that the best solution is mentioned in the comments of the blogpost. Running QApplication::setAttribute(Qt::AA_Use96Dpi); before instantiating your QApplication object should be the best solution
    – Dataform
    May 14, 2020 at 7:49
  • Thanks for your answer, I didn't try it, but I'd read that trick. Maybe the interface will appear correctly at runtime but in QT Designer it will not appear correctly. I'll try what you edited. May 14, 2020 at 7:53
  • Sorry for the double comment. I still have the problem. May 14, 2020 at 8:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.