Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to style Menu or MenuBar component
QtWS25 Last Chance

How to style Menu or MenuBar component

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sfabry
    wrote on last edited by
    #1

    I can't see any "style" property on those, neither I can see MenuStyle component.
    How do we style those ?

    What about StatusBar component ?
    I see a StatusBarStyle component : http://qt-project.org/doc/qt-5/qml-qtquick-controls-styles-statusbarstyle.html
    but no "style" property in StatusBar documentation : http://qt-project.org/doc/qt-5/qml-qtquick-controls-statusbar.html

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      We are adding those in 5.3.0 actually. StatusBar can already be styled by simply assigning a different item to it though:

      i.e statusBar: Rectangle {...}

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sfabry
        wrote on last edited by
        #3

        Great :)

        Yes statusbar it is working, it is just the style property that is missing StatusBar documentation.

        Another question, assume I have a whole software populate with lots of Button, CheckBox... components. Is there a way to style them all without editing each code to replace Button -> MyButton or to add the "style: MyButtonStyle" ?
        I search for something like an Application wide style, where you could define for example :
        @
        ApplicationStyle {
        buttonStyle: MyButtonStyle { ... }
        checkboxstyle: MyCheckboxStyle {...}
        ....
        }
        @
        and all Buttons through the application will fetch that style unless another style is specified.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jens
          wrote on last edited by
          #4

          Not yet. We are currently investigating how to make it easier to deploy themes. At the moment there is no real official way to do it. It is however possible to set the QT_QUICK_CONTROLS_STYLE environment variable to point to a subdirectory you provide containing a different set of default style delegates though.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sfabry
            wrote on last edited by
            #5

            What about styling a GroupBox ?
            Can't find GroupBoxStyle in Qt5.2 but there's some on the net:
            https://qt.gitorious.org/qt/qtquickcontrols/source/88e867cbeedd9063a08b9c401a8e56d0fb43d17b:src/styles/GroupBoxStyle.qml
            http://download.qt-project.org/ministro/android/qt5/objects/5.106-armeabi-v7a/qml/QtQuick/Controls/Styles/GroupBoxStyle.qml

            When is it planned ?
            Is it possible to write our own by inheriting Style ? (I see some private imports there...)

            Thanks

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved