material editor

A forum to discuss the implementation of a good Materials system in FreeCAD
User avatar
bernd
Posts: 5720
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: material editor

Postby bernd » Wed Jun 13, 2018 8:17 pm

thanks guys for the links. I will add some comment in the code where to find the property definition.
damian
Posts: 481
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Thu Jun 14, 2018 7:14 am

Good morning:
yorik wrote:
Mon Jun 11, 2018 3:36 pm
Yeah the model view thing in Qt is not simple...
yorik wrote: Basically you need to use a QTreeView instead of a QTreeWidget, and make a model yourself, which is the "entity" whick keeps/organizes the data of a tree widget, and give it a custom QStyledItemDelegate which handles the actions when you want to edit an item of the tree
In this link, https://github.com/caceres/FreeCAD/commits/mat, there is a draft about the migration to model/view.

I've read all the threads and posted documentation. I'll read again.

Thank you.
damian
Posts: 481
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Mon Jun 18, 2018 11:35 am

yorik wrote:
Mon Jun 11, 2018 3:36 pm
That is easy for the "fixed" properties (we know their type), but when the user adds custom properties, I'm not sure. Ideally there should be a way to specify the property type. Maybe we need one more column that says the type?
Good morning:
The last weekend I've been dealing with a very similar model with properties. I'm experimenting with a property's definition like
[Name, Type, Value, Units, Constraints, Comments ...]
Perhaps the end user must be allowed to define all characteristics of the custom properties
The next months I'll be working intensively with models ...