Kstars

kstarsdocument.cpp
1/*
2 SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "kstarsdocument.h"
8
9#include <QPrinter>
10#include <QTextDocument>
11#include <QTextDocumentWriter>
12
14{
15 m_Document.reset(new QTextDocument());
16}
17
19{
20 m_Document->clear();
21}
22
24{
25 m_Document->print(printer);
26}
27
29{
30 QTextDocumentWriter writer(fname);
31
32 return writer.write(m_Document.get());
33}
34
36{
38
39 printer.setOutputFileName(fname);
41 m_Document->print(&printer);
42}
void writePsPdf(const QString &fname)
Write contents of the document to the Postscript/PDF file.
KStarsDocument()
Constructor.
void clearContent()
Clears contents of the document.
bool writeOdt(const QString &fname)
Write contents of the document to Open Document Text file.
void print(QPrinter *printer)
Print contents of the document.
void setOutputFileName(const QString &fileName)
void setOutputFormat(OutputFormat format)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
bool write(const QTextDocument *document)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:15:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.