[Interest] QML Styled button and text issue

Jason H scorp1us at yahoo.com
Wed May 14 04:33:59 CEST 2014


Text does not show up when used as:


///MyButton.QML
import QtQuick 2.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1

Button {
 style: ButtonStyle {
  background: Rectangle {
   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{
   font.pixelSize:	30
  }
 }

}
}

 

///// Used as:
   MyButton {
    id: submit
    width: parent.width
    height: 90
    text: "Submit"
   }
/////

Does not show "Submit" Is there a way to define a Styled button component and just reassign the text?




More information about the Interest mailing list