bmkorkut
bmkorkut

Reputation: 616

Disable main window's title context menu

I am developing a windowed application with Qt, C++ on embedded Linux. Using QApplication type of QApplication::GUIServer

I am trying to disable the context menu that pops up when user right clicks on application title area, the one that gives the options to resize, move, close, etc. the application.

I already tried setting ContextMenuPolicy to PreventContextMenu on main window and giving a custom context menu handler to main window.

Thanks in advance.

Upvotes: 3

Views: 2194

Answers (3)

Rinat Gadelshin
Rinat Gadelshin

Reputation: 61

Try this: setWindowFlags( Qt::FramelessWindowHint | Qt::WindowTitleHint );

Upvotes: 0

Chris Browet
Chris Browet

Reputation: 4276

This is a system menu, normally handled by your Windows Manager. All QT can do is to hint the Window Manager to enable/disable some of its features.

You should check QWidget::setWindowFlags ( Qt::WindowFlags type ), maybe the Qt::WindowSystemMenuHint flag.

Upvotes: 0

Silas Parker
Silas Parker

Reputation: 8157

You may not be able to disable this menu as this is provided by the window manager, not the application.

The only option may be to request the title bar is removed with windowFlags.

Upvotes: 2

Related Questions