diff --git a/.gitmodules b/.gitmodules index cc8dc5d..51c0358 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "cmake/cmlib"] path = cmake/cmlib - url = ../../root/cmlib + url = ../../f1x1t/cmlib diff --git a/CMakeLists.txt b/CMakeLists.txt index c2d5b4b..d4d8c0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/cmlib) else() message(FATAL_ERROR "CMake library directory not exists") endif() +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find) include(CMLibCommon) diff --git a/l10n/cmex_app_ru_RU.ts b/l10n/cmex_app_ru_RU.ts index 69caf47..df3b2cd 100644 --- a/l10n/cmex_app_ru_RU.ts +++ b/l10n/cmex_app_ru_RU.ts @@ -1,30 +1,38 @@ + + MyMainWindow + + + Main Window + Главное окно + + QObject - + Compiler version: Версия компилятора: - + Project version: Версия проекта: - + Build type: Тип сборки: - + libcmex function call: Вызов функции из libcmex: - + libcmext function call: Вызов функции из libcmext: diff --git a/src/cmex/CMakeLists.txt b/src/cmex/CMakeLists.txt index 609ac1b..7b914b6 100644 --- a/src/cmex/CMakeLists.txt +++ b/src/cmex/CMakeLists.txt @@ -4,16 +4,25 @@ set(current_target cmex_app) # Список файлов исходных текстов set(current_target_sources main.cpp + my_main_window.cpp + ) + +set(current_target_uis + my_main_window.ui ) # Цель для создания исполняемого файла -add_executable(${current_target} ${current_target_sources}) +add_executable(${current_target} ${current_target_sources} ${current_target_uis}) common_target_properties(${current_target}) # Qt5 qt_translation(TARGET ${current_target} TS_DIR ${CMAKE_SOURCE_DIR}/l10n LANGUAGES ru_RU) target_include_directories(${current_target} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS}) +target_include_directories(${current_target} SYSTEM PUBLIC ${Qt5Gui_INCLUDE_DIRS}) +target_include_directories(${current_target} SYSTEM PUBLIC ${Qt5Widgets_INCLUDE_DIRS}) target_link_libraries(${current_target} Qt5::Core) +target_link_libraries(${current_target} Qt5::Gui) +target_link_libraries(${current_target} Qt5::Widgets) # Зависимость от библиотеки из текущего проекта add_dependencies(${current_target} cmex) diff --git a/src/cmex/main.cpp b/src/cmex/main.cpp index 42956eb..03a893d 100644 --- a/src/cmex/main.cpp +++ b/src/cmex/main.cpp @@ -2,13 +2,15 @@ #include "config.hpp" #include +#include #include #include #include "cmex.hpp" +#include "my_main_window.hpp" int main(int argc, char **argv) { - QCoreApplication app(argc, argv); + QApplication app(argc, argv); QTranslator translator; if (translator.load(QLocale(), "cmex_app", QLatin1String("_"), QLatin1String(":/qm"))) @@ -20,6 +22,9 @@ int main(int argc, char **argv) { 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; // Функция из внешней библиотеки - return 0; + + MyMainWindow* mmw = new MyMainWindow(); + mmw->show(); + return app.exec(); } diff --git a/src/cmex/my_main_window.cpp b/src/cmex/my_main_window.cpp new file mode 100644 index 0000000..b595fde --- /dev/null +++ b/src/cmex/my_main_window.cpp @@ -0,0 +1,10 @@ +#include "my_main_window.hpp" + +MyMainWindow::MyMainWindow(QWidget* parent) { + +} + +MyMainWindow::~MyMainWindow() { + +} + diff --git a/src/cmex/my_main_window.hpp b/src/cmex/my_main_window.hpp new file mode 100644 index 0000000..3b0e193 --- /dev/null +++ b/src/cmex/my_main_window.hpp @@ -0,0 +1,15 @@ +#ifndef CMEX_MY_MAIN_WINDOW_HPP_ +#define CMEX_MY_MAIN_WINDOW_HPP_ + +#include +#include "ui_my_main_window.h" + +class MyMainWindow : public QWidget, private Ui::MyMainWindow { + Q_OBJECT + public: + MyMainWindow(QWidget* parent = 0); + virtual ~MyMainWindow(); +}; + +#endif /* CMEX_MY_MAIN_WINDOW_HPP_ */ + diff --git a/src/cmex/my_main_window.ui b/src/cmex/my_main_window.ui new file mode 100644 index 0000000..80f2409 --- /dev/null +++ b/src/cmex/my_main_window.ui @@ -0,0 +1,20 @@ + + + MyMainWindow + + + + 0 + 0 + 678 + 415 + + + + Main Window + + + + + +