質問

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?

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top