5#include <QtCore/qfile.h>
6#include <QtCore/qbytearray.h>
7#include <QtCore/qfileinfo.h>
8#include <QtCore/qtextstream.h>
9#include <QtCore/qdebug.h>
15#if QT_CONFIG(textmarkdownwriter)
220#ifndef QT_NO_TEXTODFWRITER
227#if QT_CONFIG(textmarkdownwriter)
230 qWarning(
"QTextDocumentWriter::write: the device can not be opened for writing");
239#ifndef QT_NO_TEXTHTMLPARSER
242 qWarning(
"QTextDocumentWriter::write: the device cannot be opened for writing");
252 qWarning(
"QTextDocumentWriter::write: the device cannot be opened for writing");
255 d->
device->
write(document->toPlainText().toUtf8());
269 if (fragment.d ==
nullptr)
295 answer <<
"plaintext";
297#ifndef QT_NO_TEXTHTMLPARSER
300#ifndef QT_NO_TEXTODFWRITER
303#if QT_CONFIG(textmarkdownwriter)
304 answer <<
"markdown";
307 std::sort(answer.
begin(), answer.
end());
IOBluetoothDevice * device
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
QByteArray toLower() const &
\inmodule QtCore \reentrant
QString suffix() const
Returns the suffix (extension) of the file.
QString fileName() const override
Returns the name set by setFileName() or to the QFile constructors.
\inmodule QtCore \reentrant
virtual bool open(QIODeviceBase::OpenMode mode)
Opens the device and sets its OpenMode to mode.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
bool isWritable() const
Returns true if data can be written to the device; otherwise returns false.
virtual void close()
First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
QString toLower() const &
QTextDocumentWriterPrivate(QTextDocumentWriter *qq)
The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to ...
void setFormat(const QByteArray &format)
Sets the format used to write documents to the format specified.
QString fileName() const
If the currently assigned device is a QFile, or if setFileName() has been called, this function retur...
QByteArray format() const
Returns the format used for writing documents.
bool write(const QTextDocument *document)
Writes the given document to the assigned device or file and returns true if successful; otherwise re...
void setDevice(QIODevice *device)
Sets the writer's device to the device specified.
static QList< QByteArray > supportedDocumentFormats()
Returns the list of document formats supported by QTextDocumentWriter.
void setFileName(const QString &fileName)
Sets the name of the file to be written to fileName.
QTextDocumentWriter()
Constructs an empty QTextDocumentWriter object.
~QTextDocumentWriter()
Destroys the QTextDocumentWriter object.
QIODevice * device() const
Returns the device currently assigned, or \nullptr if no device has been assigned.
\reentrant \inmodule QtGui
bool writeAll(const QTextDocument *document)
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q