Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QPlainTextDocumentLayout Class

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument More...

 #include <QPlainTextDocumentLayout>

Inherits: QAbstractTextDocumentLayout.

This class was introduced in Qt 4.4.

Public Types

class PaintContext
class Selection

Properties

  • 1 property inherited from QObject

Public Functions

QAbstractTextDocumentLayout(QTextDocument * document)
QPlainTextDocumentLayout(QTextDocument * document)
~QPlainTextDocumentLayout()
QString anchorAt(const QPointF & position) const
virtual QRectF blockBoundingRect(const QTextBlock & block) const = 0
int cursorWidth() const
QTextDocument * document() const
virtual QSizeF documentSize() const = 0
virtual void draw(QPainter * painter, const PaintContext & context) = 0
void ensureBlockLayout(const QTextBlock & block) const
virtual QRectF frameBoundingRect(QTextFrame * frame) const = 0
QTextObjectInterface * handlerForObject(int objectType) const
virtual int hitTest(const QPointF & point, Qt::HitTestAccuracy accuracy) const = 0
virtual int pageCount() const = 0
QPaintDevice * paintDevice() const
void registerHandler(int objectType, QObject * component)
void requestUpdate()
void setCursorWidth(int width)
void setPaintDevice(QPaintDevice * device)

Reimplemented Public Functions

virtual QRectF blockBoundingRect(const QTextBlock & block) const
virtual QSizeF documentSize() const
virtual void draw(QPainter *, const PaintContext &)
virtual QRectF frameBoundingRect(QTextFrame *) const
virtual int hitTest(const QPointF &, Qt::HitTestAccuracy) const
virtual int pageCount() const
  • 31 public functions inherited from QObject

Signals

void documentSizeChanged(const QSizeF & newSize)
void pageCountChanged(int newPages)
void update(const QRectF & rect = QRectF( 0., 0., 1000000000., 1000000000. ))
void updateBlock(const QTextBlock & block)

Protected Functions

virtual void documentChanged(int position, int charsRemoved, int charsAdded) = 0
virtual void drawInlineObject(QPainter * painter, const QRectF & rect, QTextInlineObject object, int posInDocument, const QTextFormat & format)
QTextCharFormat format(int position)
virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat & format)
virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat & format)

Reimplemented Protected Functions

virtual void documentChanged(int from, int charsRemoved, int charsAdded)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject

Detailed Description

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument

A QPlainTextDocumentLayout is required for text documents that can be display or edited in a QPlainTextEdit. See QTextDocument::setDocumentLayout().

QPlainTextDocumentLayout uses the QAbstractTextDocumentLayout API that QTextDocument requires, but redefines it partially in order to support plain text better. For instances, it does not operate on vertical pixels, but on paragraphs (called blocks) instead. The height of a document is identical to the number of paragraphs it contains. The layout also doesn't support tables or nested frames, or any sort of advanced text layout that goes beyond a list of paragraphs with syntax highlighting.

Property Documentation

cursorWidth : int

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

Member Function Documentation

QPlainTextDocumentLayout::QPlainTextDocumentLayout(QTextDocument * document)

Constructs a plain text document layout for the text document.

QPlainTextDocumentLayout::~QPlainTextDocumentLayout()

Destructs a plain text document layout.

QRectF QPlainTextDocumentLayout::blockBoundingRect(const QTextBlock & block) const [virtual]

Reimplemented from QAbstractTextDocumentLayout::blockBoundingRect().

void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded) [virtual protected]

Reimplemented from QAbstractTextDocumentLayout::documentChanged().

QSizeF QPlainTextDocumentLayout::documentSize() const [virtual]

Reimplemented from QAbstractTextDocumentLayout::documentSize().

void QPlainTextDocumentLayout::draw(QPainter *, const PaintContext &) [virtual]

Reimplemented from QAbstractTextDocumentLayout::draw().

void QPlainTextDocumentLayout::ensureBlockLayout(const QTextBlock & block) const

Ensures that block has a valid layout

QRectF QPlainTextDocumentLayout::frameBoundingRect(QTextFrame *) const [virtual]

Reimplemented from QAbstractTextDocumentLayout::frameBoundingRect().

int QPlainTextDocumentLayout::hitTest(const QPointF &, Qt::HitTestAccuracy) const [virtual]

Reimplemented from QAbstractTextDocumentLayout::hitTest().

int QPlainTextDocumentLayout::pageCount() const [virtual]

Reimplemented from QAbstractTextDocumentLayout::pageCount().

void QPlainTextDocumentLayout::requestUpdate()

Requests a complete update on all views.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web