diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-03-02 17:57:16 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2019-03-02 17:57:16 +0200 |
commit | 03cb04bd435ddc5a637166d3188c45bb7391d6a0 (patch) | |
tree | 59b5b1f7748a62160c74a58afac12e7b8a9b30a1 /src/infowidget | |
download | cpdf-master.tar.xz |
Diffstat (limited to 'src/infowidget')
-rw-r--r-- | src/infowidget/infowidget.cpp | 42 | ||||
-rw-r--r-- | src/infowidget/infowidget.h | 35 | ||||
-rw-r--r-- | src/infowidget/infowidget.ui | 119 |
3 files changed, 196 insertions, 0 deletions
diff --git a/src/infowidget/infowidget.cpp b/src/infowidget/infowidget.cpp new file mode 100644 index 0000000..9541b29 --- /dev/null +++ b/src/infowidget/infowidget.cpp @@ -0,0 +1,42 @@ +#include "infowidget.h" +#include "ui_infowidget.h" + +InfoForm::InfoForm(QWidget *parent) + : QWidget(parent) + , ui(new Ui::InfoForm) +{ + ui->setupUi(this); +} + +InfoForm::~InfoForm() +{ + delete ui; +} + +void InfoForm::setMetadata(Metadata which, const QString &value) +{ + switch(which) { + case InfoForm::Title: + ui->title->setText(value); + return; + case InfoForm::Subject: + ui->subject->setText(value); + return; + case InfoForm::Author: + ui->author->setText(value); + return; + case InfoForm::Creator: + ui->creator->setText(value); + return; + case InfoForm::CreationDate: + ui->creationDate->setText(value); + return; + case InfoForm::ModificationDate: + ui->modificationDate->setText(value); + return; + case InfoForm::Producer: + ui->producer->setText(value); + return; + } +} + diff --git a/src/infowidget/infowidget.h b/src/infowidget/infowidget.h new file mode 100644 index 0000000..d419901 --- /dev/null +++ b/src/infowidget/infowidget.h @@ -0,0 +1,35 @@ +#ifndef CPDF_INFOWIDGET_H +#define CPDF_INFOWIDGET_H + +#include <QWidget> + +namespace Ui { + class InfoForm; +} + +class InfoForm : public QWidget +{ + Q_OBJECT + +public: + enum Metadata { + Title, + Subject, + Author, + Creator, + CreationDate, + ModificationDate, + Producer + }; + + explicit InfoForm(QWidget *parent = nullptr); + ~InfoForm(); + +public slots: + void setMetadata(Metadata which, const QString &value); + +private: + Ui::InfoForm *ui = nullptr; +}; + +#endif // CPDF_INFOWIDGET_H diff --git a/src/infowidget/infowidget.ui b/src/infowidget/infowidget.ui new file mode 100644 index 0000000..e22c0fa --- /dev/null +++ b/src/infowidget/infowidget.ui @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>InfoForm</class> + <widget class="QWidget" name="InfoForm"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>320</width> + <height>180</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="title_label"> + <property name="text"> + <string>Title</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="title"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="subject_label"> + <property name="text"> + <string>Subject</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="author_label"> + <property name="text"> + <string>Author</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="creator_label"> + <property name="text"> + <string>Creator</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="creationDate_label"> + <property name="text"> + <string>Creation date</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="modificationDate_label"> + <property name="text"> + <string>Modification date</string> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="producer_label"> + <property name="text"> + <string>Producer</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="subject"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="author"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="creator"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="creationDate"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="modificationDate"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="producer"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> |