moved meta-data to sub-project

This commit is contained in:
mandlm 2018-05-18 20:36:48 +02:00
parent 639e1b21e2
commit 441a01bdc3
10 changed files with 43 additions and 12 deletions

View File

@ -9,18 +9,16 @@ set(CMAKE_AUTORCC ON)
qt5_wrap_ui(UI_HEADERS qt5_wrap_ui(UI_HEADERS
mainwindow.ui mainwindow.ui
MetaDataWidget.ui
) )
qt5_add_resources(UI_RESOURCES
mainwindow.qrc qt5_add_resources(UI_RESOURCES
mainwindow.qrc
) )
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
LogoTest.cpp LogoTest.cpp
DataModel.cpp DataModel.cpp
MetaDataModel.cpp
mainwindow.cpp mainwindow.cpp
MetaDataWidget.cpp
${UI_HEADERS} ${UI_HEADERS}
${UI_RESOURCES} ${UI_RESOURCES}
) )
@ -37,5 +35,8 @@ target_include_directories(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
PRIVATE PRIVATE
MetaData
Qt5::Widgets Qt5::Widgets
) )
add_subdirectory(MetaData)

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "MetaDataModel.h" #include "MetaData/MetaDataModel.h"
#include <QJsonObject> #include <QJsonObject>

View File

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.6)
project(MetaData LANGUAGES CXX)
find_package(Qt5Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
qt5_wrap_ui(UI_HEADERS
MetaDataWidget.ui
)
add_library(${PROJECT_NAME}
MetaDataModel.cpp
MetaDataWidget.cpp
${UI_HEADERS}
)
set_target_properties(${PROJECT_NAME}
PROPERTIES CXX_STANDARD 14
)
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Widgets
)

View File

@ -72,16 +72,16 @@ bool MetaDataModel::setData(
} }
break; break;
case 2: case 2:
if (value.toDate() != m_dateOfTest) if (value.toDate() != m_dateOfBirth)
{ {
m_dateOfTest = value.toDate(); m_dateOfBirth = value.toDate();
valueChanged = true; valueChanged = true;
} }
break; break;
case 3: case 3:
if (value.toDate() != m_dateOfBirth) if (value.toDate() != m_dateOfTest)
{ {
m_dateOfBirth = value.toDate(); m_dateOfTest = value.toDate();
valueChanged = true; valueChanged = true;
} }
break; break;

View File

@ -2,7 +2,6 @@
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "DataModel.h" #include "DataModel.h"
#include "MetaDataModel.h"
#include <QJsonObject> #include <QJsonObject>
#include <QJsonDocument> #include <QJsonDocument>

View File

@ -103,7 +103,7 @@
<customwidget> <customwidget>
<class>MetaDataWidget</class> <class>MetaDataWidget</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>MetaDataWidget.h</header> <header>MetaData/MetaDataWidget.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>