main в файл main_app.cpp

This commit is contained in:
Andrei Astafev 2019-02-21 13:54:02 +03:00
parent ea78d461a2
commit 50168f4990
7 changed files with 45 additions and 68 deletions

@ -1 +1 @@
Subproject commit e7b0f44ef9cf7a10dc044a3f809de5708769df06
Subproject commit 428dc84cfd3eda09bf615539f5f2b84e71bb5cb2

@ -1 +1 @@
Subproject commit 275d3f01ce0f1d6c7255ccb890412e6efd501e57
Subproject commit a0a786f59030e6074dd85229df0506734f08e849

View File

@ -1,40 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>MyMainWindow</name>
<message>
<location filename="../src/cmex/my_main_window.ui" line="14"/>
<source>Main Window</source>
<translation>Главное окно</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../src/cmex/main.cpp" line="20"/>
<source>Compiler version: </source>
<translation>Версия компилятора: </translation>
</message>
<message>
<location filename="../src/cmex/main.cpp" line="21"/>
<source>Project version: </source>
<translation>Версия проекта: </translation>
</message>
<message>
<location filename="../src/cmex/main.cpp" line="22"/>
<source>Build type: </source>
<translation>Тип сборки: </translation>
</message>
<message>
<location filename="../src/cmex/main.cpp" line="23"/>
<source>libcmex function call: </source>
<translation>Вызов функции из libcmex: </translation>
</message>
<message>
<location filename="../src/cmex/main.cpp" line="24"/>
<source>libcmext function call: </source>
<translation>Вызов функции из libcmext: </translation>
</message>
</context>
</TS>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU"></TS>

View File

@ -4,6 +4,7 @@ set(current_target cmex_app)
# Список файлов исходных текстов
set(current_target_sources
main.cpp
main_app.cpp
my_main_window.cpp
)

View File

@ -1,30 +1,6 @@
#include "compiler_features.hpp"
#include "config.hpp"
#include "main_app.hpp"
#include <QtCore>
#include <QtWidgets>
#include <iostream>
#include <cmext/cmext.hpp>
#include "cmex.hpp"
#include "my_main_window.hpp"
int main(int argc, char **argv) {
QApplication app(argc, argv);
QTranslator translator;
if (translator.load(QLocale(), "cmex_app", QLatin1String("_"), QLatin1String(":/qm")))
{
app.installTranslator(&translator);
}
std::cout << QObject::tr("Compiler version: ").toStdString() << CMEX_COMPILER_VERSION_MAJOR << std::endl; // Значение из compiler_features.hpp
std::cout << QObject::tr("Project version: ").toStdString() << CMEX_VERSION_STR << std::endl; // Значение из config.hpp
std::cout << QObject::tr("Build type: ").toStdString() << BUILD_TYPE << std::endl; // Значение из config.hpp
std::cout << QObject::tr("libcmex function call: ").toStdString() << cmex_init(4) << std::endl; // Функция из внутренней библиотеки
std::cout << QObject::tr("libcmext function call: ").toStdString() << cmext_init(9) << std::endl; // Функция из внешней библиотеки
MyMainWindow* mmw = new MyMainWindow();
mmw->show();
return app.exec();
int main(int argc, char *argv[]) {
return main_app(argc, argv);
}

30
src/cmex/main_app.cpp Normal file
View File

@ -0,0 +1,30 @@
#include "compiler_features.hpp"
#include "config.hpp"
#include <QtCore>
#include <QtWidgets>
#include <iostream>
#include <cmext/cmext.hpp>
#include "cmex.hpp"
#include "my_main_window.hpp"
int main_app(int argc, char *argv[]) {
QApplication app(argc, argv);
QTranslator translator;
if (translator.load(QLocale(), "cmex_app", QLatin1String("_"), QLatin1String(":/qm")))
{
app.installTranslator(&translator);
}
std::cout << QObject::tr("Compiler version: ").toStdString() << CMEX_COMPILER_VERSION_MAJOR << std::endl; // Значение из compiler_features.hpp
std::cout << QObject::tr("Project version: ").toStdString() << CMEX_VERSION_STR << std::endl; // Значение из config.hpp
std::cout << QObject::tr("Build type: ").toStdString() << BUILD_TYPE << std::endl; // Значение из config.hpp
std::cout << QObject::tr("libcmex function call: ").toStdString() << cmex_init(4) << std::endl; // Функция из внутренней библиотеки
std::cout << QObject::tr("libcmext function call: ").toStdString() << cmext_init(9) << std::endl; // Функция из внешней библиотеки
MyMainWindow* mmw = new MyMainWindow();
mmw->show();
return app.exec();
}

7
src/cmex/main_app.hpp Normal file
View File

@ -0,0 +1,7 @@
#ifndef CMEX_MAIN_APP_HPP_
#define CMEX_MAIN_APP_HPP_
int main_app(int argc, char *argv[]);
#endif /* CMEX_MAIN_APP_HPP_ */