Debian Codegraph @

qt6/demos/metadata.cpp

raw
1 /*
2 * Copyright (C) 2008, Pino Toscano <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #include "metadata.h"
20
21 #include <poppler-qt6.h>
22
23 #include <QtWidgets/QTextEdit>
24
25 MetadataDock::MetadataDock(QWidget *parent) : AbstractInfoDock(parent)
26 {
27 m_edit = new QTextEdit(this);
28 setWidget(m_edit);
29 setWindowTitle(tr("Metadata"));
30 m_edit->setAcceptRichText(false);
31 m_edit->setReadOnly(true);
32 }
33
34 MetadataDock::~MetadataDock() = default;
35
36 void MetadataDock::fillInfo()
37 {
38 m_edit->setPlainText(document()->metadata());
39 }
40
41 void MetadataDock::documentClosed()
42 {
43 m_edit->clear();
44 AbstractInfoDock::documentClosed();
45 }