mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2024-12-22 11:55:29 +01:00
Merge branch 'master' of gitlab.com:Syping/luaengineapp
This commit is contained in:
commit
47fbb8c2a9
3 changed files with 16 additions and 7 deletions
|
@ -46,7 +46,7 @@ function main()
|
|||
layoutAddWidget(mainLayout, pushButton1)
|
||||
connect(pushButton1, "clicked()", "showDialog")
|
||||
|
||||
setWidgetFixedSize(mainWindow)
|
||||
setWidgetFixed(mainWindow)
|
||||
showWidget(mainWindow, ShowNormal)
|
||||
return GuiExecuted
|
||||
end
|
||||
|
@ -71,7 +71,7 @@ function showDialog(pushButton)
|
|||
local dialogButton = createPushButton("Close", dialog)
|
||||
layoutAddWidget(buttonLayout, dialogButton)
|
||||
connect(dialogButton, "clicked()", "closeDialog")
|
||||
setWidgetFixedSize(dialog)
|
||||
setWidgetFixed(dialog)
|
||||
executeWidget(dialog)
|
||||
delete(dialog, DeleteInstant)
|
||||
end
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
#ifdef _WIN32
|
||||
QApplication::setStyle(new LuaEngineStyle());
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if QT_VERSION >= 0x050400
|
||||
|
@ -45,14 +47,16 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
QFile *luaEngineStyleFile = new QFile(":/luaenginestyle/luaenginestyle.qss");
|
||||
if (luaEngineStyleFile->open(QFile::ReadOnly))
|
||||
{
|
||||
a.setStyleSheet(QString::fromUtf8(luaEngineStyleFile->readAll()));
|
||||
}
|
||||
delete luaEngineStyleFile;
|
||||
#endif
|
||||
|
||||
QFile luaScript(":/lua/edit.lua");
|
||||
QFile luaScript(":/lua/app.lua");
|
||||
|
||||
LuaEngineGui luaEngineGui;
|
||||
luaEngineGui.executeLuaScript(&luaScript);
|
||||
|
@ -79,9 +83,6 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -173,7 +173,11 @@ int LuaEngineGui::showFileDialog(lua_State *L_p)
|
|||
}
|
||||
}
|
||||
QFileDialog fileDialog(parent);
|
||||
#if QT_VERSION >= 0x050900
|
||||
fileDialog.setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
#else
|
||||
fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint);
|
||||
#endif
|
||||
fileDialog.setWindowTitle(dialogTitle);
|
||||
fileDialog.setAcceptMode(fileAcceptMode);
|
||||
fileDialog.setNameFilter(fileFormats);
|
||||
|
@ -531,7 +535,11 @@ int LuaEngineGui::createDialog(lua_State *L_p)
|
|||
}
|
||||
}
|
||||
QDialog *dialog = new QDialog(parent);
|
||||
#if QT_VERSION >= 0x050900
|
||||
dialog->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||
#else
|
||||
dialog->setWindowFlags(dialog->windowFlags()^Qt::WindowContextHelpButtonHint);
|
||||
#endif
|
||||
dialog->setObjectName(nameForPointer(dialog));
|
||||
dialog->setWindowTitle(windowTitle);
|
||||
pushPointer(L_p, dialog);
|
||||
|
|
Loading…
Reference in a new issue