If the scroll area is visible when the widget is added, you must show() it explicitly.
or
Note that You must add the layout of widget before you call this function; if you add it later, the widget will not be visible - regardless of when you show() the scroll area. In this case, you can also not show() the widget later.
prev_widget = self.scrollArea.takeWidget()
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a6fef101-6378-4b3d-9bac-00c95936afd3n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0i%3DSB0GCsgYwF_0xL7GsQkTv%2B0A7g2iB3r8TQyLZV%2BWg%40mail.gmail.com.
oh that's weird. Did you try it via mayapy or directly via your python interpreter? I'll give it a try with python/qt outside of maya
anyway, your github link is pure gold, I can indeed see that the scrollArea apparently removed the widget ! I used reparenting a lot in the past, and it always worked well, but my setups were always pretty simple. Here, regardless of the (new) parent, setWidget will remove the previous one first.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAHChmQYstveOG3vqr%3Drg_w5quvEvJZxPq6%3DZ4FTeWz8us--XSw%40mail.gmail.com.
neat, works perfectly!w = self.nodesArea.takeWidget()
if w: # just in case the scrollArea was emptyw.setParent(self)
self.nodesArea.setWidget(node.node.gui)much more elegant and simple than what I had, thank you so much Justin!
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAHChmQZZSo50C%2BD%3D0PFNP1Jhep%2BVrzM5FbaWidC--VBavj%2BZbw%40mail.gmail.com.