How to set my preferences panel ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
wmayer
Site Admin
Posts: 16852
Joined: Thu Feb 19, 2009 10:32 am

Re: How to set my preferences panel ?

Postby wmayer » Sun Apr 14, 2013 2:05 pm

1:if I wirte all the project in C++ with qt , then according to the .pro file , the customed widget will be compiled correctly . But now I just write .qrc file ,which contains a .ui file . Does it do any help that I copied FreeCAD_widgets.dll and FreeCAD_widgets.lib to $QTDIR/plugins/designer
The FreeCAD_widgets plugin is only needed by the Qt Designer. At runtime of FreeCAD we don't need this plugin because all the relevant widgets classes are built into the FreeCADGui library.
2:I convert the .qrc file to python with pyrcc4.exe , that is to say , I compile the .qrc file with python , does this mean that I should copy FreeCAD_widgets.dll and FreeCAD_widgets.lib to $PyQt4/plugins/designer ? If the answer is yes , the third question comes
The location of FreeCAD_widgets is totally irrelevant to pyrcc4 because this utility only creates a Python module that converts the content of the .ui file to Qt's resource format.
lainegates
Posts: 216
Joined: Tue Oct 02, 2012 7:29 am

Re: How to set my preferences panel ?

Postby lainegates » Sun Apr 14, 2013 4:45 pm

Thank you wmayer , the reply help confirm something .
At current time , I put FreeCAD_widgets plugin to $QTDIR/plugins/designer , and edit a .qrc file and .ui file in a seperate folder .
In 'promotion' of QtDesigner , header file and subclass name is needed , in Draft preference page 'userprefs-base.ui' , buttons belong to class 'Gui:PrefColorButton' , in my editing , I could see the 'Gui:PrefColorButton' option , but the 'Promote' button is unabled when I selected 'Gui:PrefColorButton' . Is this because I didn't put relevant header files in right place ? Then should I copy relevant header files ? If I don't need do this , how does QtDesigner know and use this class ?

btw , I have a irrelevant question , .ui file is a txt file without implement , QtDesigner doesn't need to know the structrue of classes , then what is the role of FreeCAD_widgets plugin to QtDesigner ?
wmayer
Site Admin
Posts: 16852
Joined: Thu Feb 19, 2009 10:32 am

Re: How to set my preferences panel ?

Postby wmayer » Sun Apr 28, 2013 8:21 am

In 'promotion' of QtDesigner , header file and subclass name is needed , in Draft preference page 'userprefs-base.ui' , buttons belong to class 'Gui:PrefColorButton' , in my editing , I could see the 'Gui:PrefColorButton' option , but the 'Promote' button is unabled when I selected 'Gui:PrefColorButton' . Is this because I didn't put relevant header files in right place ? Then should I copy relevant header files ? If I don't need do this , how does QtDesigner know and use this class ?
I don't know how the "Promoted widgets" function is supposed to work in QtDesigner but you don't need this if you have a working plugin. The plugin contains all the required information and put this into the .ui file. If you open the .ui file you'll find a section <customwidgets> where class name, base class and header file is listed.
btw , I have a irrelevant question , .ui file is a txt file without implement , QtDesigner doesn't need to know the structrue of classes , then what is the role of FreeCAD_widgets plugin to QtDesigner ?
This is to make FreeCAD widgets behave as built-in Qt widgets, i.e. you can choose them from the widget box and drag and drop them to the UI form.
lainegates
Posts: 216
Joined: Tue Oct 02, 2012 7:29 am

Re: How to set my preferences panel ?

Postby lainegates » Mon Apr 29, 2013 1:01 am

Thank you, wmayer.
I will try.
User avatar
shaise
Posts: 376
Joined: Thu Jun 11, 2015 8:11 am

Re: How to set my preferences panel ?

Postby shaise » Tue Jul 21, 2015 5:11 pm

Hi,

Does any one have a pre-compiled FreeCAD_widgets.dll I can use? (32 bit windows system)

shai
User avatar
uwestoehr
Posts: 2147
Joined: Sun Jan 27, 2019 3:21 am

Re: How to set my preferences panel ?

Postby uwestoehr » Sat Aug 15, 2020 1:53 am

shaise wrote:
Tue Jul 21, 2015 5:11 pm
Does any one have a pre-compiled FreeCAD_widgets.dll I can use? (32 bit windows system)
Yes: https://wiki.freecadweb.org/Compile_on_ ... ner_plugin
User avatar
shaise
Posts: 376
Joined: Thu Jun 11, 2015 8:11 am

Re: How to set my preferences panel ?

Postby shaise » Sat Aug 15, 2020 7:23 am

Thanks! Wow, this is a 5 year old request... :)