I have found a solution myself in the QT-Sourcecode of ButtonStyle.qml. I have to :
import QtQuick.Controls.Private 1.0
in myButtonStyle.qml and in the LabelSection I use The StyleHelpers.stylizeMnemonics, so my ButtonStyle.qml looks like:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Controls.Private 1.0
ButtonStyle {
id: myButtonStyle
background: Rectangle {
implicitWidth: 100
implicitHeight: 25
border.width: control.activeFocus ? 2 : 1
border.color: "#888"
radius: 4
gradient: Gradient {
GradientStop { position: 0 ; color: control.pressed ? appPalette.button_clicked_gradient_start : appPalette.button_gradient_start }
GradientStop { position: 1 ; color: control.pressed ? appPalette.button_clicked_gradient_stop : appPalette.button_gradient_stop }
}
}
label: Component{
id:labelCompoent
Row{
anchors.left: parent.left
anchors.leftMargin: (parent.width - (text.width + image.width))/2
anchors.top: parent.top
anchors.topMargin: 2
spacing: 0
Image{ id:image ;source: control.iconSource}
Label{
id: text
height: image.height
width:100
horizontalAlignment:Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: control.enabled ? appPalette.text_color : appPalette.text_color_disabled
text: StyleHelpers.stylizeMnemonics(control.text)
}
}
}
}