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 change the display text of the button ,in quick control ?
Qt 6.11 is out! See what's new in the release blog

How to change the display text of the button ,in quick control ?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.6k 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.
  • 7611534547 Offline
    7611534547 Offline
    761153454
    wrote on last edited by
    #1

    How to change the display button controls on the color of the text in the quick control. I see a color options in the design window in the properties toolbar controls in the button, but the revised, button text displayed on the color does not change, still black. Don't know which master can answer , how to change or by code

    Qt中国群 :218967017、218967042
    python中国群:133067664

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

      @import QtQuick 2.1
      import QtQuick.Controls 1.0
      import QtQuick.Controls.Styles 1.0
      import QtQuick.Window 2.0

      ApplicationWindow {
      title: qsTr("Hello World")
      width: 640
      height: 480

      Button {
      
          style: ButtonStyle {
              label: Text {
                  text: "A button"
                  color: "#FFFF0000"
              }
          }
      }
      

      }
      @

      1 Reply Last reply
      0
      • 7611534547 Offline
        7611534547 Offline
        761153454
        wrote on last edited by
        #3

        thank you.
        i think if you that ,this is better .use "Text"

        Button {
        id: button1
        x: 269
        y: 99
        width: 146
        height:43

        Text{
        text: "Button"
        style: Text.Outline
        font.pointSize: 13
        color:"red"
        anchors.centerIn: parent
        }

        }

        Qt中国群 :218967017、218967042
        python中国群:133067664

        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