Gui::PrefFontBox is not shown in FreeCAD preferences editor

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

Hello everyone,

I am trying to create preferences page for Reinforcement workbench.
The problem is, Gui::PrefFontBox is not shown in FreeCAD preferences editor. Here is the ui file I am trying to load using command:

Code: Select all

FreeCADGui.addPreferencePage(<path to ui file>, "TestWb")
Here is minimal example to reproduce issue:
test_PrefFontBox.ui
(1.86 KiB) Downloaded 78 times
And output on my system:
TestPrefFontBox.png
TestPrefFontBox.png (60.76 KiB) Viewed 1062 times

Any pointer in right direction will be really helpful.

My FreeCAD info:
OS: Kali GNU/Linux Rolling (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21329 (Git) AppImage
Build type: Release
Branch: master
Hash: 2330eef823b32ac412d839031cc174353a76b013
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/India (en_IN)


Thanks,
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by amrit3701 »

Suraj Dadral wrote: Wed Jun 03, 2020 6:20 am Hello everyone,

I am trying to create preferences page for Reinforcement workbench.
The problem is, Gui::PrefFontBox is not shown in FreeCAD preferences editor. Here is the ui file I am trying to load using command:
Hi Suraj, What is the output if you use QFontComboBox instead of Gui::PrefFontBox?
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

amrit3701 wrote: Wed Jun 03, 2020 9:22 am
Hi Suraj, What is the output if you use QFontComboBox instead of Gui::PrefFontBox?
Hi Amrit,

Using QFontComboBox, here is the output:
QFontBox.png
QFontBox.png (62.49 KiB) Viewed 1041 times
The output looks fine.
But, I don't think if we can use QFontComboBox to modify preferences using FreeCAD preferences editor?

Thanks,
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

wmayer wrote: Wed Jun 03, 2020 9:42 am git commit dafd10259
Thanks @wmayer for quick fix.
Will let you know soon after recompiling freecad.

Thanks,
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

Suraj Dadral wrote: Wed Jun 03, 2020 9:52 am
wmayer wrote: Wed Jun 03, 2020 9:42 am git commit dafd10259
Thanks @wmayer for quick fix.
Will let you know soon after recompiling freecad.
Now PrefFontBox is working fine.
Sample output:
TestPrefFontBoxSuccess.png
TestPrefFontBoxSuccess.png (60.26 KiB) Viewed 999 times
Thanks,
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

wmayer wrote: Wed Jun 03, 2020 9:42 am git commit dafd10259
There is one problem left is the preferences are not saved or loaded using Gui::PrefFontBox.
This file can be used to reproduce the issue.

FreeCAD info:
OS: Kali GNU/Linux Rolling (GNOME/gnome)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21382 (Git)
Build type: Unknown
Branch: master
Hash: dafd102591aa5b8c84a2fa8cf1b262f6e6b2c35e
Python version: 3.8.3
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/India (en_IN)

Thanks,
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Gui::PrefFontBox is not shown in FreeCAD preferences editor

Post by Suraj Dadral »

wmayer wrote: Wed Jun 03, 2020 3:53 pm git commit bbb082329
Thanks again @wmayer
Tested and now it works fine.

Thanks,
Post Reply