NewButton.qml Example File
qmlsurfacelayers/qml/qmlsurfacelayers/NewButton.qml
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0
Item {
id: newbutton
property alias text: buttonText.text
property real fontSize: 12
signal clicked
implicitWidth: buttonText.implicitWidth + 5
implicitHeight: buttonText.implicitHeight * 2
Button {
id: buttonText
width: parent.width
height: parent.height
style: ButtonStyle {
label: Component {
Text {
text: buttonText.text
font.pointSize: fontSize
clip: true
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
}
}
}
onClicked: newbutton.clicked()
}
}