From dd6df86ceaa93b18be0ee599c002c6be0a4b45d6 Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Tue, 20 Apr 2021 00:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=9D=E5=AD=98lua?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protoDebuger/ProtoDebug.qml | 45 +++++++++++++++++++++++-------------- protoDebuger/sharedata.cpp | 21 ++++++++++++++++- protoDebuger/sharedata.h | 1 + 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/protoDebuger/ProtoDebug.qml b/protoDebuger/ProtoDebug.qml index 4f60b5a..5bbf40b 100644 --- a/protoDebuger/ProtoDebug.qml +++ b/protoDebuger/ProtoDebug.qml @@ -84,22 +84,37 @@ Item { Layout.leftMargin: 10 } - - - Button { - id: button - text: qsTr("更新lua脚本") - Layout.preferredHeight: 41 - Layout.preferredWidth: 116 + RowLayout{ Layout.columnSpan: 2 - Layout.leftMargin: parent.width/2 - 41 - Layout.bottomMargin: 10 + Button { + id: button2 + text: qsTr("保存lua脚本") + Layout.preferredHeight: 41 + Layout.preferredWidth: 116 + Layout.leftMargin: 15 + Layout.bottomMargin: 10 - onClicked: { - lua_script_text = lua_script.text - DataWrap.SaveLuaScript(lua_script_text) + onClicked: { + lua_script_text = lua_script.text + DataWrap.SaveLuaScript(lua_script_text) + + } + } + Button { + id: button + text: qsTr("更新lua脚本") + Layout.preferredHeight: 41 + Layout.preferredWidth: 116 + Layout.bottomMargin: 10 + + onClicked: { + lua_script_text = lua_script.text + DataWrap.UpdateLuaScript(lua_script_text) + } } } + + } } @@ -109,8 +124,4 @@ Item { } } -/*##^## -Designer { - D{i:2;anchors_height:600;anchors_width:800} -} -##^##*/ + diff --git a/protoDebuger/sharedata.cpp b/protoDebuger/sharedata.cpp index 5c3ea9b..9a57604 100644 --- a/protoDebuger/sharedata.cpp +++ b/protoDebuger/sharedata.cpp @@ -99,7 +99,7 @@ int ShareData::TestShowData() return 0; } -int ShareData::SaveLuaScript(QString str) +int ShareData::UpdateLuaScript(QString str) { qDebug()<