[SOLVED] Internal C++ object (PySide.QtGui.QWidget) already deleted

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by triplus »

Hi mario.

Indeed when all this conditions are true:
  • Using TabBar
  • Having Draft workbench set as default start-up workbench
  • Changing Draft interface mode from default Taskview to Toolbar
When FreeCAD is started strange things start to happen. ;)

Will look into it over the weekend. For now you can avoid the issue by not using TabBar or not having Draft workbench set as default start-up workbench or by not setting Draft interface mode to Toolbar mode.
mario52
Veteran
Posts: 4692
Joined: Wed May 16, 2012 2:13 pm

Re: Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by mario52 »

hi
one little bug discovery
triplus wrote:Changing Draft interface mode from default Taskview to Toolbar
i work with this method (Taskview) and all work fine

haa l'informatique !

thanks
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by triplus »

Hi mario.

Thanks for discovering this and reporting it. It is hard to test all possible combinations and here FreeCAD (TabBar) users can provide valuable feedback.
mario52 wrote:hi
one little bug discovery
triplus wrote:Changing Draft interface mode from default Taskview to Toolbar
i work with this method (Taskview) and all work fine

haa l'informatique !

thanks
mario
I took a quick look yesterday and it seems using a timer to trigger TabBar on start is clashing with Draft start process. I can't be 100% sure on why as i likely won't investigate this further but in DraftGui code some timers and some special dock widget creation code is used. If i remove timer to trigger TabBar on start the problem seems to go away. Therefore i will try to change the way TabBar is started and that should allow you to use TabBar + Draft/Arch workbench set as start-up module + having Draft interface mode changed from default Taskview to Toolbar. I can't do it over the weekend as other work emerged. Hopefully this will be sorted out around next weekend. Will report here once that happens.
mario52
Veteran
Posts: 4692
Joined: Wed May 16, 2012 2:13 pm

Re: [SOLVED] Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by mario52 »

hi
you have right
i comment the section timer

Code: Select all


guiUp

#timer = QtCore.QTimer()
#timer.setSingleShot(True)
#timer.timeout.connect(guiUp)
#timer.start(1000)
#FreeCAD.timer = timer
and all work fine Taskview and Toolbar
good job not bug just interference between two codes
but tabbar is empty
TabBar02.png
TabBar02.png (1.26 KiB) Viewed 1185 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [SOLVED] Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by triplus »

mario52 wrote:but tabbar is empty
Yes that is why it will take some time as simply removing timer isn't enough. I will have to slightly change other sections in the code to adapt them to this new condition. And after that some testing will need to be done... Therefore realistically i won't have the time to do it this weekend.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [SOLVED] Internal C++ object (PySide.QtGui.QWidget) already deleted

Post by triplus »

Hi mario.

Today i had more time to look into the reported issue. You can test the changes:

https://github.com/triplus/TabBar

P.S. Creating dock widgets (DraftGui) from Python early in the start-up process and iterating over them from TabBar don't play along nicely. Therefore i changed the TabBar logic to be more explicit when finding TabBar related dock widget and that hopefully fixed the problem you were experiencing.
Post Reply