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. Qt Quick controls styling
Qt 6.11 is out! See what's new in the release blog

Qt Quick controls styling

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.7k Views 1 Watching
  • 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.
  • Z Offline
    Z Offline
    Zeiko
    wrote on last edited by
    #1

    Anyone have any example of how to style a qt quick controls application similar to this:

    http://blog.qt.digia.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-21-at-2.51.45-PM3.png
    http://blog.qt.digia.com/blog/2013/06/21/overview-of-the-new-features-in-qt-quick/

    I've tried to change the background of the toolbar by doing this:

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

    }

    It works but there must be some better way of doing it right?
    The margins also gets wrong and has to be adjusted.

    /Zeiko

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

      Actually you can remove the ToolBar definition as it does not add anything to the code above. Any item can be a tool bar or status bar but as you pointed out you are responsible for applying the inner margins yourself.

      toolBar: Rectangle { width: parent.width height: 40 color: “red” }

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zeiko
        wrote on last edited by
        #3

        Thanks it works good, however I'm having some difficulties styling the menubar.

        I've tried
        menuBar: MenuBar {
        style: Rectangle {

            }
        }
        

        with the following error: Unable to assign QQuickRectangle to Style_QMLTYPE_0

        Any ideas? :)

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

          No as you can imagine a MenuBar takes a lot more to style than just a rectangle and it cannot yet be styled through the public API.

          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