I'm sure this is probably related to how events are handled but what is going on is I have a custom titlebar and class that reacts to double clicks allowing the qmainwindow to maximize when double click message is picked up and then go to a normal state when double clicked again. That works as intended. The problem is when I move or reposition the window by dragging via mouse the first double click is ignored. It takes another double click event to set the window back to a normal state. Here is some code:

Qt Code:
  1. void myApp::tmaxout()
  2. {
  3.  
  4. qDebug() << "Getting the size message";
  5. qDebug("%i",windowState());
  6.  
  7.  
  8. setWindowState(windowState() ^ Qt::WindowMaximized);
  9.  
  10.  
  11. if (windowState() == 0)
  12. {
  13. ui->centralWidget->setStyleSheet("QWidget#centralWidget { border: 12px solid black; border-radius:24px;}");
  14. }
  15. else
  16. {
  17. ui->centralWidget->setStyleSheet("QWidget#centralWidget {border: 12px solid black;}");
  18. // setAttribute(Qt::WA_NativeWindow);
  19. };
To copy to clipboard, switch view to plain text mode 

My tmaxout method is a private slot that gets called by my custom titlebar class by emiting a custom signal that I have verified in QDebug after the doubleclick is sent out. So no problem passing messages.

Thanks