[SOLVED]how to set the Combo View to "Model" from Python

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20202
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [SOLVED]how to set the Combo View to "Model" from Python

Post by wmayer »

In addition, I'm wondering if "Model" tab and "Tasks" tab can be hidden in combo view.
Yes, it can. It's the same recipe as shown with the code snippet from 2014
mea08kw
Posts: 82
Joined: Sun Oct 09, 2022 6:22 am

Re: [SOLVED]how to set the Combo View to "Model" from Python

Post by mea08kw »

wmayer wrote: Wed Feb 08, 2023 12:51 pm
In addition, I'm wondering if "Model" tab and "Tasks" tab can be hidden in combo view.
Yes, it can. It's the same recipe as shown with the code snippet from 2014

Code: Select all

	mw = Gui.getMainWindow()
        dw=mw.findChildren(QtGui.QDockWidget)
        for i in dw:
            if i.objectName() == "Combo View":
                tab = i.findChild(QtGui.QTabWidget)
                num = tab.count()
                if num ==2:
                    tab.removeTab(0)
                else:
                    pass
Made it. Here is the code I built. May be interest of other users.

Thanks.
Post Reply