[Qt-interest] How to remove the default menu on the left side of the title bar?
Andreas Pakulat
apaku at gmx.de
Wed Feb 15 13:35:34 CET 2012
On 15.02.12 17:52:42, Anisha Kaul wrote:
> Greetz,
>
> The following code removes minimize, maximize, and close buttons.
> The default menu on the left is still there. How to get rid of that?
>
> ---------------------------------------------------
> Qt :: WindowFlags flags = 0;
>
> // Makes the Pomodoro stay on the top of all windows.
> flags |= Qt :: WindowStaysOnTopHint;
>
> // Removes minimize, maximize, and close buttons.
> flags |= Qt :: WindowTitleHint | Qt :: CustomizeWindowHint;
>
> window->setWindowFlags (flags);
> window->setWindowTitle ("Failing to plan is planning to fail");
> ---------------------------------------------------
>
> I want the title bar to be there, but just want the menu to be removed.
> Default menu contains: Minimize, Maximize, Move etc options.
Then write a window manager that does this. All these flags are only
hints for the window-manager, the window-manager can choose to ignore
them. The developers of the window-manager might not want to allow the
menu to ever be hidden.
Qt cannot control the window manager titlebar, if you want that in your
app, then tell the window manager to not draw and title/border for your
window and draw it yourself.
Andreas
More information about the Qt-interest-old
mailing list