I have a Qt application which remains on top of other windows. The mainwindow is frameless and transparent. To put it above other windows I have followed the following procedure.
SetForegroundWindow((HWND)winId());
Qt::WindowFlags flags = this->windowFlags();
flags = flags & ~Qt::WindowMinimizeButtonHint;
this->setWindowFlags(flags|Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint );
ui.setupUi(this);
This code snippet brings my Qt mainwindow on top of all windows and also above taskbar. The problem is that whenever any region of taskbar is clicked the region of mainwindow over the taskabr goes behind the taskbar. The taskbar comes to the front. The mainwindow still remains above all other window.It appears that the bottom region of my mainwindow has gone behind the taskbar.
How can I prevent the taskbar from pushing the region of mainwindow behind itself ? I want to keep my window above all windows and also above the taskbar.