Max Frai
Max Frai

Reputation: 64276

Qt +hiding window after startup

I'm trying to hide window after its startup. I have own window-class which is inherited from QMainWindow. I rewrote showEvent like this:

void showEvent (QShowEvent *evt)
{
   if (firstShow)
   {
     hide();
     firstShow = false;
   }
   else
   {
      QMainWindow::showEvent(evt);
   }
}

But it doesn't work. firstShow is a boolean variable, which is true at start. Language: c++

Upvotes: 1

Views: 3093

Answers (1)

Troubadour
Troubadour

Reputation: 13421

I don't quite follow. Surely you just don't call show() on your main window in the first place?

Upvotes: 6

Related Questions