Qt 4.8
Classes | Functions
qtextodfwriter.cpp File Reference
#include <qglobal.h>
#include "qtextodfwriter_p.h"
#include <QImageWriter>
#include <QTextListFormat>
#include <QTextList>
#include <QBuffer>
#include <QUrl>
#include "qtextdocument_p.h"
#include "qtexttable.h"
#include "qtextcursor.h"
#include "qtextimagehandler_p.h"
#include "qzipwriter_p.h"
#include <QDebug>

Go to the source code of this file.

Classes

class  QOutputStrategy
 
class  QXmlStreamStrategy
 
class  QZipStreamStrategy
 

Functions

static QString bulletChar (QTextListFormat::Style style)
 
static QString pixelToPoint (qreal pixels)
 Convert pixels to postscript point units. More...
 

Function Documentation

◆ bulletChar()

static QString bulletChar ( QTextListFormat::Style  style)
static

Definition at line 163 of file qtextodfwriter.cpp.

Referenced by QTextOdfWriter::writeListFormat().

164 {
165  switch(style) {
167  return QChar(0x25cf); // bullet character
169  return QChar(0x25cb); // white circle
171  return QChar(0x25a1); // white square
173  return QString::fromLatin1("1");
175  return QString::fromLatin1("a");
177  return QString::fromLatin1("A");
179  return QString::fromLatin1("i");
181  return QString::fromLatin1("I");
182  default:
184  return QString();
185  }
186 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ pixelToPoint()

static QString pixelToPoint ( qreal  pixels)
static

Convert pixels to postscript point units.

Definition at line 65 of file qtextodfwriter.cpp.

Referenced by QTextOdfWriter::writeBlockFormat(), QTextOdfWriter::writeCharacterFormat(), QTextOdfWriter::writeFrameFormat(), QTextOdfWriter::writeInlineCharacter(), and QTextOdfWriter::writeTableCellFormat().

66 {
67  // we hardcode 96 DPI, we do the same in the ODF importer to have a perfect roundtrip.
68  return QString::number(pixels * 72 / 96) + QString::fromLatin1("pt");
69 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188