Pregunta

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top