Fast question
In a QT C++ project, there are 2 main windows (focus can be set indiferently to any of them), and a tool
window which shall be on top of the 2 main windows.
How to implement such feature?
Detailed question:
For one main window and one tool window, is quite easy to solve:
#include <QApplication>
#include <QWidget>
int main( int n, char* args[])
{
QApplication app(n, args);
QWidget mainWindow;
QWidget subWindow(&mainWindow);
subWindow.setWindowFlags(subWindow.windowFlags() | Qt::Tool);
mainWindow.show();
subWindow.show();
return app.exec();
}
I would like the same feature, but having 2 main window. Imagine a Video player in which the tool window provide "play/stop" control over both images:
You can raise()
the tool window above the others.
This may help: void QWidget::raise() documentation
Also, see the "Note" on that function.