PDA

View Full Version : Make frameless tool window stay on top of the application



ainne810329
13th January 2012, 14:11
Here are my initial intentions:
1. Independent window has a customized title bar;
2. Multiple this type windows are opened from a main window and they can be overlapped by each other freely;
3. they stay on top of their parent window (the main window);
4. they don't have taskbar entries;

Now I made a combination of Qt::Tool | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint and set these windows with no parent window. The first 3 requirements are met but the 4th one isn't. And it gives me another big problem:
If one window is closed, all the other windows disappear until the mouse is pressed on the main window.

Does anyone can help with this problem? I have been struggling with this problem for weeks.

Spitfire
13th January 2012, 16:38
I may be missing something, but wouldn't all your requirements have been solved by using MDI (http://developer.qt.nokia.com/doc/qt-4.8/mainwindows-mdi.html)?

ainne810329
16th January 2012, 08:17
I may be missing something, but wouldn't all your requirements have been solved by using MDI (http://developer.qt.nokia.com/doc/qt-4.8/mainwindows-mdi.html)?

I have investigated the QMdiSubWindow and I found that the QMdiSubWindow still can't have a custom title bar as I want and it also gives an normal border around the window. So I guess this class isn't my option.

pkj
16th January 2012, 11:37
Qt has no control over title bar. This i think is the realm of window-manager. You can perhaps have a frameless window in the MDI, and have the widget made in a way that it resembles your title bar at the top. May be this GPL project code (http://qt-apps.org/content/show.php?action=content&content=67309) can help you a bit.