1

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.

Nejat
  • 31,784
  • 12
  • 106
  • 138
Ufx
  • 2,595
  • 12
  • 44
  • 83

1 Answers1

1

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;
}
Nejat
  • 31,784
  • 12
  • 106
  • 138