You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
793 B

10 years ago
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
import QtQuick.Controls.Styles 1.1
Rectangle {
id: buttonActionContainer
10 years ago
property string disableStateImg
property string enabledStateImg
property string buttonTooltip
10 years ago
property string buttonShortcut
10 years ago
signal clicked
10 years ago
function enabled(state)
{
buttonAction.enabled = state;
if (state)
debugImg.iconSource = enabledStateImg;
else
debugImg.iconSource = disableStateImg;
}
Button
10 years ago
{
10 years ago
anchors.fill: parent
id: debugImg
iconSource: enabledStateImg
action: buttonAction
width: buttonActionContainer.width - 3
height: buttonActionContainer.height
}
Action {
tooltip: buttonTooltip
id: buttonAction
10 years ago
shortcut: buttonShortcut
onTriggered: {
buttonActionContainer.clicked();
}
}
10 years ago
}