![]() |
Home · All Classes · All Functions · | ![]() |
The QVersitWriter class provides an interface for writing a versit document such as a vCard to a text stream. More...
#include <QVersitWriter>
Inherits QObject.
QVersitWriter () | |
~QVersitWriter () | |
QIODevice * | device () const |
void | setDevice ( QIODevice * device ) |
void | setVersitDocument ( const QVersitDocument & versitDocument ) |
bool | startWriting () |
QVersitDocument | versitDocument () const |
bool | writeAll () |
void | writingDone () |
The QVersitWriter class provides an interface for writing a versit document such as a vCard to a text stream.
QVersitWriter converts a QVersitDocument into its textual representation. QVersitWriter supports writing to an abstract I/O device which can be for example a file or a memory buffer. The writing can be done synchronously or asynchronously.
// An example of writing a simple vCard to a memory buffer: QBuffer vCardBuffer; vCardBuffer.open(QBuffer::ReadWrite); QVersitWriter writer; writer.setDevice(&vCardBuffer); QVersitDocument document; QVersitProperty property; property.setName("N"); property.setValue("Citizen;John;Q;;"); document.addProperty(property); writer.setVersitDocument(document); if (writer.writeAll()) { // Use the vCardBuffer... }
See also QVersitDocument and QVersitProperty.
Constructs a new writer.
Frees the memory used by the writer. Waits until a pending asynchronous writing has been completed.
Returns the device used for writing.
See also setDevice().
Sets the device used for writing to device.
See also device().
Set the versit document to be written to versitDocument and selects the actual writer implementation based on the versit document type.
See also versitDocument().
Starts writing the output asynchronously. Returns false if the output device has not been set or opened or if there is another asynchronous write operation already pending. Signal writingDone() is emitted when the writing has finished.
Returns the current versit document.
See also setVersitDocument().
Writes the output synchronously. Returns false if the output device has not been set or opened or if there is an asynchronous write operation pending. Using this function may block the user thread for an undefined period. In most cases asynchronous startWriting() should be used instead.
The signal is emitted by the writer when the asynchronous writing has been completed.
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Mobility Project 1.0.0 (Technology Preview) |