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.
 
 
 
 
 

49 lines
857 B

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
import QtQuick.Controls.Styles 1.1
Rectangle {
id: buttonActionContainer
property string disableStateImg
property string enabledStateImg
property string buttonTooltip
property string buttonShortcut
signal clicked
function enabled(state)
{
buttonAction.enabled = state;
if (state)
debugImage.source = enabledStateImg;
else
debugImage.source = disableStateImg;
}
Button
{
anchors.fill: parent
id: debugImg
/* iconSource: enabledStateImg
*/ action: buttonAction
}
Image {
id: debugImage
source: enabledStateImg
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 15
height: 15
}
Action {
tooltip: buttonTooltip
id: buttonAction
shortcut: buttonShortcut
onTriggered: {
buttonActionContainer.clicked();
}
}
}