mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update the file
This commit is contained in:
parent
46a8688382
commit
af24b7d6f8
@ -13,21 +13,21 @@
|
||||
#include "xTools.h"
|
||||
#include "xToolsMainWindow.h"
|
||||
|
||||
template<typename T>
|
||||
template<typename UiT, typename MainWindowT, typename AppT>
|
||||
int xToolsExec(int argc, char* argv[], const QString& appName, bool usingCommonMainWindow = true)
|
||||
{
|
||||
sakDoSomethingBeforeAppCreated(argv, appName);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
AppT app(argc, argv);
|
||||
if (usingCommonMainWindow) {
|
||||
xToolsMainWindow* mainWindow = new xToolsMainWindow();
|
||||
T* centralWidget = new T(mainWindow);
|
||||
MainWindowT* mainWindow = new MainWindowT();
|
||||
UiT* centralWidget = new UiT(mainWindow);
|
||||
mainWindow->setWindowTitle(appName);
|
||||
mainWindow->setCentralWidget(centralWidget);
|
||||
mainWindow->show();
|
||||
mainWindow->resize(int(qreal(mainWindow->height()) * 1.732), mainWindow->height());
|
||||
} else {
|
||||
T* widget = new T();
|
||||
UiT* widget = new UiT();
|
||||
widget->show();
|
||||
widget->resize(int(qreal(widget->height()) * 1.732), widget->height());
|
||||
}
|
||||
@ -36,3 +36,9 @@ int xToolsExec(int argc, char* argv[], const QString& appName, bool usingCommonM
|
||||
sakDoSomethingAfterAppExited();
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int xToolsExec(int argc, char* argv[], const QString& appName, bool usingCommonMainWindow = true)
|
||||
{
|
||||
return xToolsExec<T, xToolsMainWindow, QApplication>(argc, argv, appName, usingCommonMainWindow);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user