moved meta-data to a separate widget

This commit is contained in:
Michael Mandl 2018-05-17 20:04:42 +02:00
parent e50a77bb40
commit 726e51b8b5
5 changed files with 143 additions and 0 deletions

View file

@ -8,6 +8,7 @@ set(CMAKE_AUTOMOC ON)
qt5_wrap_ui(UI_HEADERS
mainwindow.ui
MetaDataWidget.ui
)
add_executable(${PROJECT_NAME}
@ -15,6 +16,7 @@ add_executable(${PROJECT_NAME}
DataModel.cpp
MetaDataModel.cpp
mainwindow.cpp
MetaDataWidget.cpp
${UI_HEADERS}
)
@ -24,6 +26,7 @@ set_target_properties(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)

14
source/MetaDataWidget.cpp Normal file
View file

@ -0,0 +1,14 @@
#include "MetaDataWidget.h"
#include "ui_MetaDataWidget.h"
MetaDataWidget::MetaDataWidget(QWidget *parent)
: QWidget(parent), ui(new Ui::MetaDataWidget)
{
ui->setupUi(this);
}
MetaDataWidget::~MetaDataWidget()
{
delete ui;
}

19
source/MetaDataWidget.h Normal file
View file

@ -0,0 +1,19 @@
#pragma once
#include <QWidget>
namespace Ui {
class MetaDataWidget;
};
class MetaDataWidget : public QWidget
{
Q_OBJECT
private:
Ui::MetaDataWidget *ui;
public:
MetaDataWidget(QWidget *parent = nullptr);
~MetaDataWidget();
};

77
source/MetaDataWidget.ui Normal file
View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MetaDataWidget</class>
<widget class="QWidget" name="MetaDataWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>269</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="upperArea" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="dateOfTestLabel">
<property name="text">
<string>Untersuchungsdatum</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="participantLineEdit"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="dateOfBirthLabel">
<property name="text">
<string>Geburtsdatum</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="participantLabel">
<property name="text">
<string>Name, Vorname</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="instructorLineEdit"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="instructorLabel">
<property name="text">
<string>Untersucher(in)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDateEdit" name="dateOfTestDateEdit"/>
</item>
<item row="2" column="3">
<widget class="QDateEdit" name="dateOfBirthDateEdit"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="remarksLabel">
<property name="text">
<string>Bemerkungen</string>
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="remarksPlainTextEdit"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -71,6 +71,28 @@
<item>
<widget class="QPlainTextEdit" name="plainTextEdit"/>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="MetaDataTab">
<attribute name="title">
<string>Allgemein</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="MetaDataWidget" name="metaDataWidget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
@ -119,6 +141,14 @@
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>MetaDataWidget</class>
<extends>QWidget</extends>
<header>MetaDataWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>