Frage

Modality of a QDialog doesn´t work when disabling all frame using the CustomizeWindowHint on setWindowFlags...

QDialog dialog(getMainW());
dialog.setObjectName("dialog");
dialog.setWindowFlags( Qt::CustomizeWindowHint );
dialog.setWindowModality(Qt::ApplicationModal);

When i comment the third line, it doesn´t work at all. I get focus on the rest. How can i make it work?

Or how to remove the buttons and frame without doing this?

War es hilfreich?

Lösung

this code works for sure on Windows7/x32/Qt 5.*

 setWindowFlags( Qt::SplashScreen | Qt::FramelessWindowHint );

you don't need to do anything about WindowModality.

there are issues in MacOSX, but hadn't time yet to look deep into them

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top