Customize Titlebar

  • Hey guys,
    I want to customize my titlebar of my qmainwindow. For example change color and change the appearence of the buttons.
    As far as I know the only way to accomplish that is to make the qmainwindow frameless and fake my own titlebar.
    The problem is that I want to start the window maximized. When I do this I'm not able to access the Taskbar of windows 7/8 anymore. I tried many possible window flag combinations but none of them seem to work.
    Any suggestions? Thanks!

  • Moderators

    It's not that simple and this topic was discussed in the forum many times. When you disable the window manager provided frame you basically disable all the frame related features OS does for you and you need to "fake" these too. This includes mouse/touch/keyboard input, resize, aero snap/shake, minimize/maximize and window positioning.

    There's no portable way to do that and you need to handle these in the nativeEvent() and play with OS api (WinAPI in case of Windows).
    See "this post": to see some code required, although note that the code presented there is very far from complete.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.