TG-PlatformPlus/qml/Instruction/common/ScriptButton.qml

32 lines
593 B
QML

import QtQuick 2.0
import QtQuick.Controls
BaseCommon
{
width: 100
height: 25
Button
{
anchors.fill: parent
text: title
// 默认脚本 base64
Component.onCompleted:{
value = aJsText
}
onClicked:
{
var _value = codeDialog.showEditor(Qt.atob(value))
var regExp = /\t/g;
value = Qt.btoa(_value.replace(regExp, ' '))
}
}
function setValue(_value)
{
if(_value == "")
_value = aJsText
value = _value
}
}