Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

No text with ButtonStyle

$
0
0
Hi, In your ClientButtonStyle.qml file you set static text as “test”. If you want use text from button text you need use “control.text” and your file must looks like: import QtQuick 2.3 import QtQuick.Controls.Styles 1.2   ButtonStyle {     label: TimelineTextStyle {         text: control.text                     //This is correct         verticalAlignment: Text.AlignVCenter         horizontalAlignment: Text.AlignHCenter     }       background: Rectangle {         radius: 4         implicitHeight: 80           gradient: Gradient {             GradientStop { position: 0 ; color: control.pressed ? "#019875" : "#16A085" }             GradientStop { position: 1 ; color: control.pressed ? "#019875" : "#16A085" }         }     } }

Viewing all articles
Browse latest Browse all 4972

Trending Articles