Re: [Interest] Reasons why deleteLater() might not work

2022-04-01 Thread Sérgio Martins via Interest
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);

Re: [Interest] Embedding a QTextBrowser in a QML application: QObject: Cannot create children for a parent that is in a different thread

2022-04-01 Thread Jeffrey Brendecke
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{

Re: [Interest] Reasons why deleteLater() might not work

2022-04-01 Thread Allan Sandfeld Jensen
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); >

[Interest] Reasons why deleteLater() might not work

2022-04-01 Thread Michael Jackson
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