implemented V2/SVK test
This commit is contained in:
parent
5f9356a7f7
commit
b8c869ff39
16 changed files with 432 additions and 29 deletions
|
@ -44,6 +44,7 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
Plural
|
Plural
|
||||||
Genus
|
Genus
|
||||||
AkkusativDativ
|
AkkusativDativ
|
||||||
|
V2Svk
|
||||||
ResultWidget
|
ResultWidget
|
||||||
Qt5::Widgets
|
Qt5::Widgets
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,6 +11,7 @@ DataModel::DataModel(QObject *parent)
|
||||||
, m_results(this)
|
, m_results(this)
|
||||||
, m_akkusativ(this)
|
, m_akkusativ(this)
|
||||||
, m_dativ(this)
|
, m_dativ(this)
|
||||||
|
, m_v2Svk(this)
|
||||||
{
|
{
|
||||||
connect(&m_plural, &PluralModel::dataChanged, this,
|
connect(&m_plural, &PluralModel::dataChanged, this,
|
||||||
&DataModel::pluralModelChanged);
|
&DataModel::pluralModelChanged);
|
||||||
|
@ -24,6 +25,8 @@ DataModel::DataModel(QObject *parent)
|
||||||
&DataModel::akkusativModelChanged);
|
&DataModel::akkusativModelChanged);
|
||||||
connect(&m_dativ, &DativModel::dataChanged, this,
|
connect(&m_dativ, &DativModel::dataChanged, this,
|
||||||
&DataModel::dativModelChanged);
|
&DataModel::dativModelChanged);
|
||||||
|
connect(&m_v2Svk, &V2SvkModel::dataChanged, this,
|
||||||
|
&DataModel::v2SvkModelChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataModel::write(QJsonObject &target) const
|
void DataModel::write(QJsonObject &target) const
|
||||||
|
@ -34,6 +37,7 @@ void DataModel::write(QJsonObject &target) const
|
||||||
write(m_plural, target, "Plural");
|
write(m_plural, target, "Plural");
|
||||||
write(m_akkusativ, target, "Akkusativ");
|
write(m_akkusativ, target, "Akkusativ");
|
||||||
write(m_dativ, target, "Dativ");
|
write(m_dativ, target, "Dativ");
|
||||||
|
write(m_v2Svk, target, "V2Svk");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataModel::read(const QJsonObject &source)
|
void DataModel::read(const QJsonObject &source)
|
||||||
|
@ -44,6 +48,7 @@ void DataModel::read(const QJsonObject &source)
|
||||||
read(m_plural, source, "Plural");
|
read(m_plural, source, "Plural");
|
||||||
read(m_akkusativ, source, "Akkusativ");
|
read(m_akkusativ, source, "Akkusativ");
|
||||||
read(m_dativ, source, "Dativ");
|
read(m_dativ, source, "Dativ");
|
||||||
|
read(m_v2Svk, source, "V2Svk");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataModel::pluralModelChanged()
|
void DataModel::pluralModelChanged()
|
||||||
|
@ -75,3 +80,9 @@ void DataModel::dativModelChanged()
|
||||||
{
|
{
|
||||||
m_results.setDativResult(m_dativ.getPoints());
|
m_results.setDativResult(m_dativ.getPoints());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DataModel::v2SvkModelChanged()
|
||||||
|
{
|
||||||
|
m_results.setV2Result(m_v2Svk.getV2Points());
|
||||||
|
m_results.setSvkResult(m_v2Svk.getSvkPoints());
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "PluralModel.h"
|
#include "PluralModel.h"
|
||||||
#include "AkkusativModel.h"
|
#include "AkkusativModel.h"
|
||||||
#include "DativModel.h"
|
#include "DativModel.h"
|
||||||
|
#include "V2SvkModel.h"
|
||||||
|
|
||||||
#include "ResultModel.h"
|
#include "ResultModel.h"
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ public:
|
||||||
PluralModel m_plural;
|
PluralModel m_plural;
|
||||||
AkkusativModel m_akkusativ;
|
AkkusativModel m_akkusativ;
|
||||||
DativModel m_dativ;
|
DativModel m_dativ;
|
||||||
|
V2SvkModel m_v2Svk;
|
||||||
|
|
||||||
ResultModel m_results;
|
ResultModel m_results;
|
||||||
|
|
||||||
|
@ -59,4 +61,5 @@ private slots:
|
||||||
void verbEndModelChanged();
|
void verbEndModelChanged();
|
||||||
void akkusativModelChanged();
|
void akkusativModelChanged();
|
||||||
void dativModelChanged();
|
void dativModelChanged();
|
||||||
|
void v2SvkModelChanged();
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include "VerbEndPR.h"
|
#include "VerbEndPR.h"
|
||||||
#include "AkkusativPR.h"
|
#include "AkkusativPR.h"
|
||||||
#include "DativPR.h"
|
#include "DativPR.h"
|
||||||
|
#include "V2PR.h"
|
||||||
|
#include "SvkPR.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
@ -166,3 +168,23 @@ void ResultModel::setDativResult(unsigned int points)
|
||||||
emit dataChanged(index(0, 6), index(4, 6));
|
emit dataChanged(index(0, 6), index(4, 6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResultModel::setV2Result(unsigned int points)
|
||||||
|
{
|
||||||
|
if (m_results[0].points() != points)
|
||||||
|
{
|
||||||
|
m_results[0].setPoints(points);
|
||||||
|
m_results[0].setPR(V2PR().lookup(m_age, points));
|
||||||
|
emit dataChanged(index(0, 0), index(4, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResultModel::setSvkResult(unsigned int points)
|
||||||
|
{
|
||||||
|
if (m_results[1].points() != points)
|
||||||
|
{
|
||||||
|
m_results[1].setPoints(points);
|
||||||
|
m_results[1].setPR(SvkPR().lookup(m_age, points));
|
||||||
|
emit dataChanged(index(0, 1), index(4, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -68,4 +68,6 @@ public:
|
||||||
void setVerbEndResult(unsigned int points);
|
void setVerbEndResult(unsigned int points);
|
||||||
void setAkkusativResult(unsigned int points);
|
void setAkkusativResult(unsigned int points);
|
||||||
void setDativResult(unsigned int points);
|
void setDativResult(unsigned int points);
|
||||||
|
void setV2Result(unsigned int points);
|
||||||
|
void setSvkResult(unsigned int points);
|
||||||
};
|
};
|
||||||
|
|
65
source/ResultWidget/SvkPR.h
Normal file
65
source/ResultWidget/SvkPR.h
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "PRMap.h"
|
||||||
|
|
||||||
|
class SvkPR : public PRMap
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SvkPR()
|
||||||
|
{
|
||||||
|
// clang-format off
|
||||||
|
m_ages = {
|
||||||
|
{ 4, 0 },
|
||||||
|
{ 5, 0 },
|
||||||
|
{ 6, 0 },
|
||||||
|
{ 9, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
m_PRs = {
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 1, 0 },
|
||||||
|
{ 3, 1, 0 },
|
||||||
|
{ 4, 1, 1 },
|
||||||
|
{ 4, 1, 1 },
|
||||||
|
{ 7, 2, 1 },
|
||||||
|
{ 8, 3, 3 },
|
||||||
|
{ 8, 5, 3 },
|
||||||
|
{ 9, 5, 3 },
|
||||||
|
{ 12, 6, 4 },
|
||||||
|
{ 17, 6, 4 },
|
||||||
|
{ 18, 7, 5 },
|
||||||
|
{ 21, 7, 6 },
|
||||||
|
{ 21, 8, 7 },
|
||||||
|
{ 24, 10, 7 },
|
||||||
|
{ 28, 11, 7 },
|
||||||
|
{ 32, 12, 9 },
|
||||||
|
{ 34, 14, 9 },
|
||||||
|
{ 37, 19, 11 },
|
||||||
|
{ 42, 25, 13 },
|
||||||
|
{ 51, 28, 16 },
|
||||||
|
{ 53, 31, 19 },
|
||||||
|
{ 59, 38, 25 },
|
||||||
|
{ 71, 50, 36 },
|
||||||
|
{ 100, 100, 100 }
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
}
|
||||||
|
};
|
68
source/ResultWidget/V2PR.h
Normal file
68
source/ResultWidget/V2PR.h
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "PRMap.h"
|
||||||
|
|
||||||
|
class V2PR : public PRMap
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
V2PR()
|
||||||
|
{
|
||||||
|
// clang-format off
|
||||||
|
m_ages = {
|
||||||
|
{ 4, 0 },
|
||||||
|
{ 5, 0 },
|
||||||
|
{ 6, 0 },
|
||||||
|
{ 9, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
m_PRs = {
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 1, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 0, 0 },
|
||||||
|
{ 2, 1, 0 },
|
||||||
|
{ 2, 1, 0 },
|
||||||
|
{ 2, 1, 0 },
|
||||||
|
{ 2, 1, 0 },
|
||||||
|
{ 3, 1, 0 },
|
||||||
|
{ 3, 1, 0 },
|
||||||
|
{ 3, 1, 1 },
|
||||||
|
{ 3, 1, 1 },
|
||||||
|
{ 3, 1, 1 },
|
||||||
|
{ 4, 1, 1 },
|
||||||
|
{ 5, 2, 1 },
|
||||||
|
{ 7, 2, 1 },
|
||||||
|
{ 8, 2, 1 },
|
||||||
|
{ 9, 3, 2 },
|
||||||
|
{ 14, 5, 4 },
|
||||||
|
{ 17, 6, 4 },
|
||||||
|
{ 18, 7, 5 },
|
||||||
|
{ 21, 9, 5 },
|
||||||
|
{ 21, 10, 6 },
|
||||||
|
{ 22, 10, 6 },
|
||||||
|
{ 24, 11, 7 },
|
||||||
|
{ 25, 11, 8 },
|
||||||
|
{ 27, 14, 9 },
|
||||||
|
{ 29, 14, 10 },
|
||||||
|
{ 32, 16, 10 },
|
||||||
|
{ 37, 19, 12 },
|
||||||
|
{ 42, 22, 13 },
|
||||||
|
{ 47, 26, 15 },
|
||||||
|
{ 52, 29, 19 },
|
||||||
|
{ 55, 32, 21 },
|
||||||
|
{ 60, 41, 27 },
|
||||||
|
{ 69, 52, 37 },
|
||||||
|
{ 100, 100, 100 }
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
}
|
||||||
|
};
|
|
@ -4,3 +4,4 @@ add_subdirectory(VerbEnd)
|
||||||
add_subdirectory(Genus)
|
add_subdirectory(Genus)
|
||||||
add_subdirectory(Plural)
|
add_subdirectory(Plural)
|
||||||
add_subdirectory(AkkusativDativ)
|
add_subdirectory(AkkusativDativ)
|
||||||
|
add_subdirectory(V2Svk)
|
||||||
|
|
36
source/SubTests/V2Svk/CMakeLists.txt
Normal file
36
source/SubTests/V2Svk/CMakeLists.txt
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
cmake_minimum_required(VERSION 3.6)
|
||||||
|
|
||||||
|
project(V2Svk LANGUAGES CXX)
|
||||||
|
|
||||||
|
find_package(Qt5Widgets REQUIRED)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
|
qt5_wrap_ui(UI_HEADERS
|
||||||
|
V2SvkWidget.ui
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME}
|
||||||
|
V2SvkWidget.cpp
|
||||||
|
V2SvkModel.cpp
|
||||||
|
${UI_HEADERS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_target_properties(${PROJECT_NAME}
|
||||||
|
PROPERTIES CXX_STANDARD 14
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PUBLIC
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME}
|
||||||
|
PRIVATE
|
||||||
|
CheckableItem
|
||||||
|
CheckableTest
|
||||||
|
CheckableTestModel
|
||||||
|
Qt5::Widgets
|
||||||
|
)
|
77
source/SubTests/V2Svk/V2SvkModel.cpp
Normal file
77
source/SubTests/V2Svk/V2SvkModel.cpp
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
#include "V2SvkModel.h"
|
||||||
|
|
||||||
|
V2SvkModel::V2SvkModel(QObject *parent)
|
||||||
|
: CheckableTestModel(parent)
|
||||||
|
{
|
||||||
|
m_tests = {
|
||||||
|
{ "W-Frage",
|
||||||
|
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||||
|
"Gans" , "Gans", "Gans", "Gans"} },
|
||||||
|
{ "Verbtrennung",
|
||||||
|
{ "", "Affe", "", "", "", "", "", "Schwein", "" , "", "Gans", ""} },
|
||||||
|
{ "SVK: /-st/",
|
||||||
|
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||||
|
"Gans" , "Gans", "Gans", "Gans"} },
|
||||||
|
|
||||||
|
{ "Objekt-Topikalisierung",
|
||||||
|
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||||
|
"Gans" , "Gans", "Gans", "Gans"} },
|
||||||
|
{ "SVK: Stamm",
|
||||||
|
{ "Affe", "Affe", "Affe", "Affe", "Schwein", "Schwein", "Schwein", "Schwein",
|
||||||
|
"Gans" , "Gans", "Gans", "Gans"} },
|
||||||
|
|
||||||
|
{ "Temporaladverb Präsens",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
{ "SKV: /-e/ o. Stamm",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
|
||||||
|
{ "Temporaladverb Perfekt",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
{ "Verbtrennung",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
{ "SVK: /-e/ o. Stamm",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
{ "Partizip",
|
||||||
|
{ "Affe", "Affe", "Schwein", "Schwein", "Gans", "Gans" } },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int V2SvkModel::getV2Points()
|
||||||
|
{
|
||||||
|
size_t points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : { 0, 1, 3, 5, 7, 8 })
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int V2SvkModel::getSvkPoints()
|
||||||
|
{
|
||||||
|
size_t points = 0;
|
||||||
|
|
||||||
|
for (auto testIndex : { 2, 4, 6, 9, 10 })
|
||||||
|
{
|
||||||
|
const auto &test = m_tests.at(testIndex);
|
||||||
|
|
||||||
|
for (const auto &item : test.items())
|
||||||
|
{
|
||||||
|
if (item.isChecked())
|
||||||
|
{
|
||||||
|
points++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
14
source/SubTests/V2Svk/V2SvkModel.h
Normal file
14
source/SubTests/V2Svk/V2SvkModel.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CheckableTestModel.h"
|
||||||
|
|
||||||
|
class V2SvkModel : public CheckableTestModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
V2SvkModel(QObject *parent);
|
||||||
|
|
||||||
|
unsigned int getV2Points();
|
||||||
|
unsigned int getSvkPoints();
|
||||||
|
};
|
21
source/SubTests/V2Svk/V2SvkWidget.cpp
Normal file
21
source/SubTests/V2Svk/V2SvkWidget.cpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#include "V2SvkWidget.h"
|
||||||
|
#include "ui_V2SvkWidget.h"
|
||||||
|
|
||||||
|
#include "V2SvkModel.h"
|
||||||
|
|
||||||
|
V2SvkWidget::V2SvkWidget(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
|
, ui(new Ui::V2SvkWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
V2SvkWidget::~V2SvkWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void V2SvkWidget::setV2SvkModel(V2SvkModel *model)
|
||||||
|
{
|
||||||
|
ui->v2SvkTableView->setModel(model);
|
||||||
|
}
|
23
source/SubTests/V2Svk/V2SvkWidget.h
Normal file
23
source/SubTests/V2Svk/V2SvkWidget.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class V2SvkModel;
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class V2SvkWidget;
|
||||||
|
};
|
||||||
|
|
||||||
|
class V2SvkWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::V2SvkWidget *ui;
|
||||||
|
|
||||||
|
public:
|
||||||
|
V2SvkWidget(QWidget *parent = nullptr);
|
||||||
|
~V2SvkWidget();
|
||||||
|
|
||||||
|
void setV2SvkModel(V2SvkModel *model);
|
||||||
|
};
|
24
source/SubTests/V2Svk/V2SvkWidget.ui
Normal file
24
source/SubTests/V2Svk/V2SvkWidget.ui
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>V2SvkWidget</class>
|
||||||
|
<widget class="QWidget" name="V2SvkWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="v2SvkTableView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -17,8 +17,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
|
|
||||||
connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newFile()));
|
connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newFile()));
|
||||||
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openFile()));
|
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openFile()));
|
||||||
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveFile()));
|
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveFile()));
|
||||||
connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(saveFileAs()));
|
connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(saveFileAs()));
|
||||||
|
|
||||||
newFile();
|
newFile();
|
||||||
}
|
}
|
||||||
|
@ -33,20 +33,21 @@ void MainWindow::newFile()
|
||||||
m_dataModel = std::make_unique<DataModel>(this);
|
m_dataModel = std::make_unique<DataModel>(this);
|
||||||
ui->metaDataWidget->setModel(&m_dataModel->m_metaData);
|
ui->metaDataWidget->setModel(&m_dataModel->m_metaData);
|
||||||
ui->verbEndWidget->setModel(&m_dataModel->m_verbEnd);
|
ui->verbEndWidget->setModel(&m_dataModel->m_verbEnd);
|
||||||
ui->genusWidget->setModel(&m_dataModel->m_genus);
|
ui->genusWidget->setModel(&m_dataModel->m_genus);
|
||||||
ui->pluralWidget->setModel(&m_dataModel->m_plural);
|
ui->pluralWidget->setModel(&m_dataModel->m_plural);
|
||||||
ui->akkusativDativWidget->setAkkusativModel(&m_dataModel->m_akkusativ);
|
ui->akkusativDativWidget->setAkkusativModel(&m_dataModel->m_akkusativ);
|
||||||
ui->akkusativDativWidget->setDativModel(&m_dataModel->m_dativ);
|
ui->akkusativDativWidget->setDativModel(&m_dataModel->m_dativ);
|
||||||
|
ui->v2SvkWidget->setV2SvkModel(&m_dataModel->m_v2Svk);
|
||||||
|
|
||||||
ui->resultWidget->setModel(&m_dataModel->m_results);
|
ui->resultWidget->setModel(&m_dataModel->m_results);
|
||||||
|
|
||||||
m_filename = "";
|
m_filename = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::openFile()
|
void MainWindow::openFile()
|
||||||
{
|
{
|
||||||
QString filename = QFileDialog::getOpenFileName(this, "Open file",
|
QString filename = QFileDialog::getOpenFileName(
|
||||||
"", "ESGRAF 4-8 (*.esgraf48)");
|
this, "Open file", "", "ESGRAF 4-8 (*.esgraf48)");
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -64,46 +65,46 @@ void MainWindow::openFile()
|
||||||
|
|
||||||
m_dataModel->read(loadDoc.object());
|
m_dataModel->read(loadDoc.object());
|
||||||
|
|
||||||
m_filename = filename;
|
m_filename = filename;
|
||||||
|
|
||||||
ui->metaDataWidget->toFirst();
|
ui->metaDataWidget->toFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveFile()
|
void MainWindow::saveFile()
|
||||||
{
|
{
|
||||||
if (m_filename.isEmpty())
|
if (m_filename.isEmpty())
|
||||||
{
|
{
|
||||||
saveFileAs();
|
saveFileAs();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saveFile(m_filename);
|
saveFile(m_filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveFileAs()
|
void MainWindow::saveFileAs()
|
||||||
{
|
{
|
||||||
QString filename = QFileDialog::getSaveFileName(this, "Save file", "",
|
QString filename = QFileDialog::getSaveFileName(
|
||||||
"ESGRAF 4-8 (*.esgraf48)");
|
this, "Save file", "", "ESGRAF 4-8 (*.esgraf48)");
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveFile(filename);
|
saveFile(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveFile(const QString &filename)
|
void MainWindow::saveFile(const QString &filename)
|
||||||
{
|
{
|
||||||
QJsonObject saveData;
|
QJsonObject saveData;
|
||||||
m_dataModel->write(saveData);
|
m_dataModel->write(saveData);
|
||||||
|
|
||||||
QJsonDocument saveDoc(saveData);
|
QJsonDocument saveDoc(saveData);
|
||||||
|
|
||||||
QFile saveFile(filename);
|
QFile saveFile(filename);
|
||||||
saveFile.open(QFile::WriteOnly);
|
saveFile.open(QFile::WriteOnly);
|
||||||
saveFile.write(saveDoc.toJson());
|
saveFile.write(saveDoc.toJson());
|
||||||
saveFile.close();
|
saveFile.close();
|
||||||
|
|
||||||
m_filename = filename;
|
m_filename = filename;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="testTabWidget">
|
<widget class="QTabWidget" name="testTabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>3</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="MetaDataTab">
|
<widget class="QWidget" name="MetaDataTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -30,6 +30,16 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="v2SvkTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Subtest 1: V2/SVK</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="V2SvkWidget" name="v2SvkWidget" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="VerbEndTab">
|
<widget class="QWidget" name="VerbEndTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Subtest 2: Verbendstellungsregel (VE)</string>
|
<string>Subtest 2: Verbendstellungsregel (VE)</string>
|
||||||
|
@ -74,6 +84,24 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="resultTabWidget">
|
<widget class="QTabWidget" name="resultTabWidget">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>220</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>220</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -100,7 +128,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1125</width>
|
<width>1125</width>
|
||||||
<height>17</height>
|
<height>19</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
@ -227,6 +255,12 @@
|
||||||
<header>AkkusativDativWidget.h</header>
|
<header>AkkusativDativWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>V2SvkWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header location="global">V2SvkWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="mainwindow.qrc"/>
|
<include location="mainwindow.qrc"/>
|
||||||
|
|
Loading…
Reference in a new issue