0

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?

Darkgaze
  • 2,280
  • 6
  • 36
  • 59

1 Answers1

2

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

evilruff
  • 3,947
  • 1
  • 15
  • 27
  • COol! Works so well. Thanks. – Darkgaze Apr 18 '13 at 09:56
  • But wondering about the MacOSX problems... if you know something please tell me. I´ll try in Mac too. – Darkgaze Apr 18 '13 at 09:56
  • 1
    Well what I am trying to achieve in my code is to make QT solution for falling down modal dialog popups (similar to what MacOSX has). For Windows it's pretty good solvable with a code I posted + some a bit tricky code for smooth animation. On make this code will create a dialog but it will not be able to get a focus, so it will appear normally without border, but will have very weird behaviour. Since an application I am working on is completely cross platform solution I will get back to this issue around next week. As soon as I have a proper answer I will publish it. – evilruff Apr 18 '13 at 10:07
  • Please tell me when you do it! Thanks a lot! i´ll be listening – Darkgaze Apr 19 '13 at 11:15