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. [SOLVED] QtQuick Controls, TabView title color and Button text color
QtWS25 Last Chance

[SOLVED] QtQuick Controls, TabView title color and Button text color

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 1.5k 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.
  • E Offline
    E Offline
    Ever
    wrote on last edited by
    #1

    Hello QT-Project community,

    I am doing some testing with QtQuick controls.
    In my research I have question about:

    1. TabView, how to set solor on title property
    2. Button, how to set color on button text

    The roots of education are bitter, but the fruit is sweet.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vincent007
      wrote on last edited by
      #2

      read "this thread":http://qt-project.org/forums/viewthread/31257/

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Ever
        wrote on last edited by
        #3

        Thank you for help Vincent.
        Thread is useful.

        The roots of education are bitter, but the fruit is sweet.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dasun
          wrote on last edited by
          #4

          Edit your title and add [solved] to it :)

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Ever
            wrote on last edited by
            #5

            Here is sum for this thread:

            Button component can be edited using style property.

            Example:

            @import QtQuick.Controls.Styles 1.0

            Button {
            x: 100
            y: 100
            width: 50
            height: 20
            style: ButtonStyle {
            background: Rectangle {
            implicitWidth: 100
            implicitHeight: 25
            border.width: control.activeFocus ? 2 : 1
            border.color: "#888"
            radius: 10
            gradient: Gradient {
            GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
            GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
            }
            }
            label: Text {
            horizontalAlignment: Text.AlignHCenter
            verticalAlignment: Text.AlignVCenter
            text: "Ok"
            color: "#9e90a3"
            }
            }
            }@

            The roots of education are bitter, but the fruit is sweet.

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

              Entirely correct. Also note that at least for button, you could also do it like this:

              @
              Button {
              width: 100
              Label {
              anchors.centerIn: parent
              text: "hello"
              color: "red"
              }
              }
              @

              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