Turning Zolko's theme in to a Preference Pack

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

chennes wrote: Thu Sep 08, 2022 6:27 pm Is this line failing (e.g. giving "None")?

Code: Select all

tv = Gui.getMainWindow().findChild(QtGui.QWidget,'Tree view')
It's probably the line after with addChildWidget and tv being None

Code: Select all

mw.addDockWidget(QtCore.Qt.LeftDockWidgetArea,tv)

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7f54fee59d60]
#1  0x7f54fff5b43f in QLayout::addChildWidget(QWidget*) from /lib/x86_64-linux-gnu/libQt5Widgets.so.5+0xf
#2  /lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x2b471f) [0x7f550008d71f]
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
chennes
Veteran
Posts: 3904
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by chennes »

Right, in your final distributed script you should make sure tv exists before using it -- I'm just making sure I understand the underlying problem, which is that findChild() isn't giving a valid result when it looks for 'Tree view' in a fresh FreeCAD install.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5544
Joined: Thu Apr 05, 2018 5:15 pm

Re: Turning Zolko's theme in to a Preference Pack

Post by adrianinsaval »

Is there any downside to having the tree view enabled but not shown by default in FreeCAD?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

adrianinsaval wrote: Sat Sep 10, 2022 1:00 pm Is there any downside to having the tree view enabled but not shown by default in FreeCAD?
I think I've read somewhere that Werner has changed the defaults sometime ago. Werner, could you please confirm and explain this choice ?

wmayer wrote: ping
try the Assembly4 workbench for FreCAD — tutorials here and here
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

Zolko wrote: Mon Sep 12, 2022 12:13 pm I think I've read somewhere that Werner has changed the defaults sometime ago. Werner, could you please confirm and explain this choice ?
In FreeCAD we already have the ComboView that includes a tree view and the property view. Having a second and separate tree view does not only look strange but also has a performance issue because all changes in the document structure or selection changes must be handled twice in the two tree instances.
User avatar
adrianinsaval
Veteran
Posts: 5544
Joined: Thu Apr 05, 2018 5:15 pm

Re: Turning Zolko's theme in to a Preference Pack

Post by adrianinsaval »

wmayer wrote: Mon Sep 12, 2022 2:05 pm has a performance issue because all changes in the document structure or selection changes must be handled twice in the two tree instances.
even if one is hidden by default?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

wmayer wrote: Mon Sep 12, 2022 2:05 pm In FreeCAD we already have the ComboView that includes a tree view and the property view.
I understand, but if you use this then the Task UI hides the TreeView, therefore if you want to select something in the tree while being in a task, you're toast. Yes, you can change the tab, but 1) the user needs to know that something important is hidden there and 2) it's so much extra clicks. As for the space on the screen, most people who do 3D CAD have large screens (or several large screens !) anyway.

For the sheer discoverability of FreeCAD (mostly for newcomers) I think that a separate TreeView and PropertyView is more appropriate. Experienced users who need all possible extra performance can later fine-tune their UI. A separate TreeView on the left is also what most (or all ?) other CAD software provide, it's a sort-of industry standard.
try the Assembly4 workbench for FreCAD — tutorials here and here
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

even if one is hidden by default?
Sure. The tree view is part of the Model-View-Controller pattern and it still handles changes made on the model. Only if the tree view doesn't exist it won't handle the changes.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Turning Zolko's theme in to a Preference Pack

Post by wmayer »

For the sheer discoverability of FreeCAD (mostly for newcomers) I think that a separate TreeView and PropertyView is more appropriate. Experienced users who need all possible extra performance can later fine-tune their UI. A separate TreeView on the left is also what most (or all ?) other CAD software provide, it's a sort-of industry standard.
The topic has already been discussed a few times and ideally it should be possible that we don't have the fix layout of the current combo view but allow it the user to split the tab widget(s) to make the tree, property and task view independent dock widgets.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Turning Zolko's theme in to a Preference Pack

Post by Zolko »

wmayer wrote: Mon Sep 12, 2022 3:21 pm Only if the tree view doesn't exist it won't handle the changes.
and if I use a separate Tree View and Property View, then I'll only have 1 tree instance, no ? So no performance hit, is that correct ?

tv.png
tv.png (31.19 KiB) Viewed 1201 times
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply