Moving child widgets between QTabWidgets?

Matic Kukovec kukovecmatic at hotmail.com
Wed Jan 18 17:04:28 GMT 2023


What are you talking about. setParent(None) does not delete the underlying widget. You delete the widget using widget.deleteLater().
You are right! That is weird, I could swear that when I used setParent(None) in the past it deletes the underlying widget. Maybe only if it was not bound to any other object?

Anyway, thanks Charles 👍

________________________________
From: Charles <peacech at gmail.com>
Sent: Wednesday, January 18, 2023 5:50 PM
To: Matic Kukovec <kukovecmatic at hotmail.com>
Subject: Re: Moving child widgets between QTabWidgets?

On Wed, Jan 18, 2023 at 11:34 PM Matic Kukovec <kukovecmatic at hotmail.com<mailto:kukovecmatic at hotmail.com>> wrote:
removeTab() does not reparent the widget, you need to call setParent(None) after removeTab.
That is exactly what I do not want, as setParent(None) will delete the underlying widget. I want it moved to the other tabwidget.


What are you talking about. setParent(None) does not delete the underlying widget. You delete the widget using widget.deleteLater().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230118/618ebfe2/attachment.htm>


More information about the PyQt mailing list