Make widget in front of another widget
-
"example":http://www.freeimagehosting.net/55kxs
I want to make the QMainWindow behind of imageViewer(the one showing an image)
become in front of the imageViewer after the imageViewer show up, I call this slot@
activateWindow();
raise();
@imageViewer is a data member of QMainWindow, if it is possible, I would like to
make each other become the "front" widget after I activate them by mouse or keyboard, but raise()
wouldn't work. Do I choose a wrong function? -
@
void mainWindow::mousePressEvent(QMouseEvent *)
{::SetWindowPos(effectiveWinId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); ::SetWindowPos(effectiveWinId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); raise(); show(); activateWindow(); qDebug() << "mouse click";
}
@Tried another solution, wouldn't work either.