Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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



  • @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"
            }
        }
    }
    

    }
    @



  • 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
    }

    }


Log in to reply