Question

My problem: A QT 4 C++ application, to run on Linux, needs to lock down all sorts of routine GUI functionality. Specifically, I want to remove as much of the functionality of the title bar as I can.

I was able to do most of that using setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);

But there remains a drop-down menu from the upper-left corner of the title bar. Most of the functions inside are disabled (no min, max or close), but the "always on top" check-box is enabled.

Can I disable the "Always On Top" check-box through QT or do I need to find an OS workaround?

Was it helpful?

Solution

The window title is handled by the window manager. Qt cannot change the title of the window directly. It can only use different hints and native API to ask the window manager to do what you want (remove specific buttons etc.). The window manager can decline your request. So the only 100% working solution is to use Qt::FramelessWindowHint and draw your own window decorations by hand.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top