FCInfo Macro

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
Vincent B
Veteran
Posts: 4739
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: FCInfo Macro

Post by Vincent B »

mario52 wrote: Sat Jun 16, 2018 5:10 pm just cause HighDP, here the solution by UR_
Its working, but its a shame to not run Freecad in Hi Res.
Ca marche, mais c'est dommage de ne pas avoir Freecad en haute résolution. :roll:
mario52
Veteran
Posts: 4696
Joined: Wed May 16, 2012 2:13 pm

Re: FCInfo Macro

Post by mario52 »

hi
GlouGlou wrote: Sat Jun 16, 2018 5:25 pm Its working, but its a shame to not run Freecad in Hi Res.
Ca marche, mais c'est dommage de ne pas avoir Freecad en haute résolution
yes because of a macro (Qt)

oui a cause d'une macro (Qt), je vais encore chercher

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: FCInfo Macro

Post by easyw-fc »

mario52 wrote: Sat Jun 16, 2018 8:02 pm yes because of a macro (Qt)
this is an annoying issue also with my macros... I moved almost everything on buttons without a text caption, but in many cases it is not possible to avoid text, and there the issue will raise...
We would need a way to adapt the text size to the room available in the text container...
Please post here if you find a way to solve this :D
Maurice
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: FCInfo Macro

Post by ulrich1a »

easyw-fc wrote: Sat Jun 16, 2018 8:29 pm We would need a way to adapt the text size to the room available in the text container...
Please post here if you find a way to solve this :D
I found the following two webpage regarding the topic: https://www.charlesodale.com/setting-qt ... alization/

So does it help to fix the fontsize with a statement like the following, where "w" is the widget?

Code: Select all

font = w.font()
font.setPixelSize(12)
w.setFont(font)
This would go the other way around and should fix the fontsize to the current layout. I do not have a high resolution display, so I can not test.

Ulrich
mario52
Veteran
Posts: 4696
Joined: Wed May 16, 2012 2:13 pm

Re: FCInfo Macro

Post by mario52 »

hi

in my macro i use

Code: Select all

        self.fontGlobal_08 = QtGui.QFont()
        self.fontGlobal_08.setFamily("Arial")
        self.fontGlobal_08.setPointSize(8.0)    # line 1124
testing request modify setPointSize(8.0) in setPixelSize(11) (line 1124) and restore the HighDPI display to see

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Vincent B
Veteran
Posts: 4739
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: FCInfo Macro

Post by Vincent B »

After change, this is what i got. :roll:
My res is 1680x1050
Attachments
Capture.JPG
Capture.JPG (44.84 KiB) Viewed 2452 times
User avatar
Vincent B
Veteran
Posts: 4739
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: FCInfo Macro

Post by Vincent B »

easyw-fc wrote: Sat Jun 16, 2018 8:29 pm this is an annoying issue also with my macros...
Can use it anyway.
Attachments
Capture.JPG
Capture.JPG (55.54 KiB) Viewed 2449 times
mario52
Veteran
Posts: 4696
Joined: Wed May 16, 2012 2:13 pm

Re: FCInfo Macro

Post by mario52 »

hi

my result with setPointSize(8) and PPP 150% (manual adjustment: "Paramètres avancés de mise à l'échelle")

Macro_And_HighDPI_PointSize.png
Macro_And_HighDPI_PointSize.png (80.89 KiB) Viewed 2426 times

here with setPixelSize(11) and PPP 150% (manual adjustment) the title is large (same above, can be remove the bold text !!) and in the lineEdit is good

Macro_And_HighDPI_Pixel.png
Macro_And_HighDPI_Pixel.png (94.52 KiB) Viewed 2426 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
mario52
Veteran
Posts: 4696
Joined: Wed May 16, 2012 2:13 pm

Re: FCInfo Macro

Post by mario52 »

hi

want to test this version (without bold and with setPixelSize(11))

unzip the file
FCInfo_For_Testng_PPP.zip
(28.58 KiB) Downloaded 55 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: FCInfo Macro

Post by UR_ »

Comparison of widget sizes
on a 2736 x 1824 pixel display
Windows user defined scaling 175%

screenshot FCInfo.png
screenshot FCInfo.png (69.85 KiB) Viewed 2396 times

As you can see, reducing font size doesn't solve the problem.
This only reverts settings, user defined while installing windows.
Better read out user defined scaling and insert this factor to all code lines containing hardcoded pixel values. Therefore dialog is scaled up and font will fit.
Post Reply