On 2022-04-01 14:17, Michael Jackson wrote:
I have a bit of code where in I am removing a QWidget from the UI and
it needs to be truly cleaned up as its parent QObject is also being
cleaned up. I thought I did the appropriate:
layout->removeWidget(widget);
widget->setParent(nullptr);
widget->de
Thanks to all for your comments!
I took a closer look given what Shawn wrote and looked at it through a debugger.
// main.cpp
#include
#include
int main( int argc, char* argv[] )
{
QApplication app{ argc, argv };
QQmlApplicationEngine engine;
const QUrl url{ u"qrc://main.qml"_q
On Freitag, 1. April 2022 15:17:59 CEST Michael Jackson wrote:
> I have a bit of code where in I am removing a QWidget from the UI and it
> needs to be truly cleaned up as its parent QObject is also being cleaned
> up. I thought I did the appropriate:
>
> layout->removeWidget(widget);
> widget->se
I have a bit of code where in I am removing a QWidget from the UI and it needs
to be truly cleaned up as its parent QObject is also being cleaned up. I
thought I did the appropriate:
layout->removeWidget(widget);
widget->setParent(nullptr);
widget->deleteLater();
I put a "std::cout <<... " in