From 8a6f7311ca6ab3e81aee784e3c01aea2e03c74c8 Mon Sep 17 00:00:00 2001 From: Syping Date: Sat, 15 Sep 2018 00:59:18 +0200 Subject: [PATCH] use Dialog instead of MessageBox --- src/luaengineapp/edit.lua | 18 +++++++++++++++++- src/luaenginegui/luaenginegui.pro | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/luaengineapp/edit.lua b/src/luaengineapp/edit.lua index 10c0fea..e1f24bf 100644 --- a/src/luaengineapp/edit.lua +++ b/src/luaengineapp/edit.lua @@ -109,9 +109,25 @@ function editorSaveFile(file) end function editorAboutBox() - showMessageBox(InfoMessageBox, "

LE Text Editor

A simple Text Editor made in Lua Engine", "About LE Text Editor", mainWindow) + local dialog = createDialog("About LE Text Editor", mainWindow) + local dialogLayout = createLayout(VerticalLayout, dialog) + local dialogLabel = createLabel("

LE Text Editor

A simple Text Editor made in Lua Engine", dialog) + layoutAddWidget(dialogLayout, dialogLabel) + local buttonLayout = createLayout(HorizontalLayout, dialogLayout) + createSpacerItem(SizePolicyExpanding, SizePolicyMinimum, buttonLayout) + local dialogButton = createPushButton("&OK", dialog) + layoutAddWidget(buttonLayout, dialogButton) + connect(dialogButton, "clicked()", "closeDialog") + setWidgetFixed(dialog) + executeWidget(dialog) + delete(dialog, DeleteInstant) end function editorClose() closeWidget(mainWindow) end + +function closeDialog(pushButton) + disconnect(pushButton, "clicked()") + closeWidget(getParent(pushButton)) +end diff --git a/src/luaenginegui/luaenginegui.pro b/src/luaenginegui/luaenginegui.pro index cd8b661..02b5791 100644 --- a/src/luaenginegui/luaenginegui.pro +++ b/src/luaenginegui/luaenginegui.pro @@ -15,7 +15,7 @@ #* limitations under the License. #*****************************************************************************/ -QT += core network gui widgets +QT += core gui widgets TARGET = luaenginegui TEMPLATE = lib CONFIG += c++11