From 03cb04bd435ddc5a637166d3188c45bb7391d6a0 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 2 Mar 2019 17:57:16 +0200 Subject: Initial commit --- src/infowidget/infowidget.cpp | 42 +++++++++++++++ src/infowidget/infowidget.h | 35 +++++++++++++ src/infowidget/infowidget.ui | 119 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+) create mode 100644 src/infowidget/infowidget.cpp create mode 100644 src/infowidget/infowidget.h create mode 100644 src/infowidget/infowidget.ui (limited to 'src/infowidget') 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 + +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 @@ + + + InfoForm + + + + 0 + 0 + 320 + 180 + + + + Form + + + + + + Title + + + + + + + + + + + + + + Subject + + + + + + + Author + + + + + + + Creator + + + + + + + Creation date + + + + + + + Modification date + + + + + + + Producer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1