Yes, I think this is normal for a Mac, at least I have it in a Qt app too (Mac only).
I used the following workaround:
void MainUI::closeEvent (QCloseEvent *event) { if (m_closing) { event->accept(); return; } if( DeviceUnplugged == false) { ExitDialog = new DialogExit; ExitDialog->exec(); if(ExitDialog->result() == QDialog::Accepted) { m_device.CloseDevice(); m_closing = true; event->accept(); } else { event->ignore(); } } }
By default, the boolean variable m_ closing should be initialized to false , of course, in your class. Thus, the second time nothing will be done (processing will be skipped). It worked for me.
source share