Details
-
Bug
-
Resolution: Duplicate
-
P5: Not important
-
4.6.3, 5.0.0
-
None
Description
Nokia says: "this switch required destroy window and recreate window again". But it is not true!!! Below code make this thing flawlessly. So why gorgeous Qt library makie such simple thing very unintuitive and worst than others libraries? Did you ever seen window which suddenly hide and show when you switch "always on top"??? If you did, I strongy recomended don't use such program.
#include <windows.h> void MainWindow::alwaysOnTopSwitch(bool aChecked) { #ifdef Q_OS_WIN //#include <windows.h> if(aChecked) SetWindowPos(winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); else SetWindowPos(winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); #else if(aChecked) { setWindowFlags(windowFlags() | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint); show(); } else { this->setWindowFlags(windowFlags() ^ (Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint)); show(); } #endif
Attachments
Issue Links
- duplicates
-
QTBUG-30359 WindowStaysOnTopHint buggy on windows
- Closed