Hide headers in combo view

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
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Hide headers in combo view

Post by ngocminhdao88 »

Hi,

i want to hide the headers in my combo view. Also in the treeview, i only want to have one column.

Is there a setting or a way for me to do this?
Attachments
hide_headers.png
hide_headers.png (37.22 KiB) Viewed 1434 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Hide headers in combo view

Post by openBrain »

Code: Select all

from PySide2 import QtWidgets

cvtv = Gui.getMainWindow().findChild(QtWidgets.QDockWidget, 'Combo View').findChildren(QtWidgets.QTreeView)
pttv = Gui.getMainWindow().findChild(QtWidgets.QDockWidget, 'Combo View').findChild(QtWidgets.QTabWidget, 'propertyTab').findChildren(QtWidgets.QTreeView)

for tv in cvtv:
    tv.setHeaderHidden(True)
    if not tv in pttv:
        tv.setColumnHidden(1, True)
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Re: Hide headers in combo view

Post by ngocminhdao88 »

Thank you openBrain for the quick answer.

With your script i can hide the both headers.

However the header in tree view stays hidden all the time but the one in properties view doesn't not. By selecting any item in tree view or any elements in 3D view, the header in properties view shows up again.

Is there a way to make it persistent?
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Hide headers in combo view

Post by openBrain »

I don't have this behavior. Please post your full FC version information.
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Re: Hide headers in combo view

Post by ngocminhdao88 »

Sure, here is my FreeCAD info:

Code: Select all

OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2021.531.24301 +3702 (Git)
Build type: Release
Branch: LinkDaily
Hash: 4ad819f55a108b7e8bddb134d0de39218e662aa4
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Hide headers in combo view

Post by openBrain »

ngocminhdao88 wrote: Wed Jun 23, 2021 11:07 am Sure, here is my FreeCAD info:
Looks to me as it is @realthunder's fork. I absolutely don't know what he can have modified that brings this behavior.
My script works fine on the vanilla version. ;)
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Re: Hide headers in combo view

Post by ngocminhdao88 »

@openBrain:
Thanks for the confirmation on FreeCAD vanilla version. I will ping realthunder about this.

realthunder wrote:ping
@realthunder:
Can you please take a look, why the header of properties view keeps showing up?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Hide headers in combo view

Post by realthunder »

ngocminhdao88 wrote: Wed Jun 23, 2021 12:53 pm Can you please take a look, why the header of properties view keeps showing up?
There are options in Preference -> Display -> UI -> Tree view to 'Hide header' and 'Hide extra column', among others. I didn't put options to hide property header though, because its column is configured as user resizable by default. Hiding the header disables column resizing. I can add extra options for that.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Re: Hide headers in combo view

Post by ngocminhdao88 »

@realthunder:
Thanks in advance :D
Post Reply