Nominate our 2022 Qt Champions!

Qt Quick controls styling ToolBar, MenuBar and StatusBar

  • Hello,

    I just started to play around a bit with styling the qt quick controls and don't see any ToolBarStyle, any ideas how to style the toolbar and the other components that lacks a built in style?



  • The simple answer is that you can only style those components that provide a style at the moments. The others will come in a later version. This includes MenuBar which is tricky as it depends on the platform if it can even be styled or not (think mac os/ubuntu). But ToolBar and StatusBar are actually quite easy to work around. Both of them can be replaced by any item. Ie to create a custom toolbar all you have to do is:

    @toolBar: Rectangle {
    color: "red"
    height: 40
    width: parent.width

    StatusBar is similar. The only drawback is that you have to provide your own margins and the tool bar will not automatically adjust to content height but that should be easily solved by adding anchors or a layout.

Log in to reply