nim_duilib/examples/proto_debuger/lua_bind.cpp
2023-01-22 00:01:26 +08:00

33 lines
638 B
C++

#include "base_form.h"
#include "lua_bind.h"
#include <iostream>
#include "global.h"
// 在qml界面中显示lua层处理过的数据
int LuaShowData(lua_State* vm) {
// 获取函数参数:从栈底取一个参数
const char* k = lua_tostring(vm, 1);
if (nullptr != k) {
//todo qml显示添加
}
std::cout << "LuaShowData" << k << std::endl;
auto current = gMainWindow->FindCurrentFormByLuaPointer(vm);
if (nullptr == current) {
return -1;
}
current->ShowDataInEdit(k);
return 0;
}
//
int LuaWriteUart(lua_State* vm) {
// 获取函数参数:从栈底取一个参数
const char* k = lua_tostring(vm, 1);
if (nullptr != k) {
//todo qml显示添加
}
return 0;
}