External WM_DESTROY issue
-
Hi! My application has
Log
window andTest
window (main window), when I close the app I get the following error:External WM_DESTROY received for QWidgetWindow(0x2c9235f1890, name="LogWindow") , parent: QWindow(0x0) , transient parent: QWidgetWindow(0x2c920b375a0, name="TestClassWindow")
Code:
Log *appLog; appLog = new Log(this); appLog->show();
I delete
Log
class object in the destructor.Test::~Test() { delete appLog; }
I can't use
setAttribute(Qt::WA_DeleteOnClose);
function because it will delete the collected log, and it won't be available when openLog
window again. How to fix this issue? Thanks in advance. -
Hi,
You create it with parent, which mean it gets deleted automatically with the parent. And your delete appLog then deletes it a second time.
-Michael.
-
Hi,
Did you check whether you have other cases of multiple deletion in your code ?
-
Yes. It was the only one. I think the problem is with
Qt 5.7.1
. I can't switch to the latest because it doesn't supportWin XP
.On
Qt 5.8
orQt 5.9
when deploying the app, it throws the following error:I can't find where in the
Qt
source files it calls theGetUserPrefferrdUILanguages
function? -
If you want to run on XP, stay with the latest Qt 5.6 release.