Kstars

kstarsdocument.cpp
1 /*
2  SPDX-FileCopyrightText: 2011 Rafał Kułaga <[email protected]>
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 }
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const const
bool writeOdt(const QString &fname)
Write contents of the document to Open Document Text file.
void clearContent()
Clears contents of the document.
bool write(const QTextDocument *document)
void setOutputFileName(const QString &fileName)
void print(QPrinter *printer)
Print contents of the document.
void setOutputFormat(QPrinter::OutputFormat format)
KStarsDocument()
Constructor.
void writePsPdf(const QString &fname)
Write contents of the document to the Postscript/PDF file.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Dec 7 2023 03:58:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.