简体   繁体   中英

How to destroy derived from QWindow object immediately after constructor done?

I need to destroy derived from QWindow object immediately after constructor done if some conditions in constructor will be true.

There is member variable which I want to set in constructor and check in window initializing function. But I don't know which function or signal is suitable for this.

You can use QObject::deleteLater() to safely delete your object. Just call it in your constructor when the condition is true :

if(condition)
{
   this->deleteLater();
   return;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM