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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QTextFrame Class Reference

The QTextFrame class represents a frame in a QTextDocument. More...

 #include <QTextFrame>

Inherits: QTextObject.

Inherited by: QTextTable.

Note: All functions in this class are reentrant.

Public Types

class iterator
typedef Iterator

Public Functions

QTextFrame ( QTextDocument * document )
~QTextFrame ()
iterator begin () const
QList<QTextFrame *> childFrames () const
iterator end () const
QTextCursor firstCursorPosition () const
int firstPosition () const
QTextFrameFormat frameFormat () const
QTextCursor lastCursorPosition () const
int lastPosition () const
QTextFrame * parentFrame () const
void setFrameFormat ( const QTextFrameFormat & format )
  • 4 public functions inherited from QTextObject
  • 29 public functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 5 static public members inherited from QObject
  • 1 protected function inherited from QTextObject
  • 7 protected functions inherited from QObject

Detailed Description

The QTextFrame class represents a frame in a QTextDocument.

Text frames provide structure for the text in a document. They are used as generic containers for other document elements. Frames are usually created by using QTextCursor::insertFrame().

Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame beneath the root frame has a parent frame and a (possibly empty) list of child frames. The parent frame can be found with parentFrame(), and the childFrames() function provides a list of child frames.

Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the QTextFrame::iterator class is used to traverse both the blocks and child frames within a given frame. The first and last child elements in the frame can be found with begin() and end().

A frame also has a format (specified using QTextFrameFormat) which can be set with setFormat() and read with format().

Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the firstCursorPosition() and lastCursorPosition() functions for this. The frame's extent in the document can be found with firstPosition() and lastPosition().

You can iterate over a frame's contents using the QTextFrame::iterator class: this provides read-only access to its internal list of text blocks and child frames.

See also QTextCursor and QTextDocument.

Member Type Documentation

typedef QTextFrame::Iterator

Qt-style synonym for QTextFrame::iterator.

Member Function Documentation

QTextFrame::QTextFrame ( QTextDocument * document )

Creates a new empty frame for the text document.

QTextFrame::~QTextFrame ()

Destroys the frame, and removes it from the document's layout.

iterator QTextFrame::begin () const

Returns an iterator pointing to the first document element inside the frame. Please see the document STL-style-Iterators for more information.

See also end().

QList<QTextFrame *> QTextFrame::childFrames () const

Returns a (possibly empty) list of the frame's child frames.

See also parentFrame().

iterator QTextFrame::end () const

Returns an iterator pointing to the position past the last document element inside the frame. Please see the document STL-Style Iterators for more information.

See also begin().

QTextCursor QTextFrame::firstCursorPosition () const

Returns the first cursor position inside the frame.

See also lastCursorPosition(), firstPosition(), and lastPosition().

int QTextFrame::firstPosition () const

Returns the first document position inside the frame.

See also lastPosition(), firstCursorPosition(), and lastCursorPosition().

QTextFrameFormat QTextFrame::frameFormat () const

Returns the frame's format.

See also setFrameFormat().

QTextCursor QTextFrame::lastCursorPosition () const

Returns the last cursor position inside the frame.

See also firstCursorPosition(), firstPosition(), and lastPosition().

int QTextFrame::lastPosition () const

Returns the last document position inside the frame.

See also firstPosition(), firstCursorPosition(), and lastCursorPosition().

QTextFrame * QTextFrame::parentFrame () const

Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.

See also childFrames() and QTextDocument::rootFrame().

void QTextFrame::setFrameFormat ( const QTextFrameFormat & format )

Sets the frame's format.

See also frameFormat().

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la sp�cification pour la conception d'applications parall�les C++ utilisant le GPU 22
  2. Les d�veloppeurs ignorent-ils trop les failles d�couvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. RIM : � 13 % des d�veloppeurs ont gagn� plus de 100 000 $ sur l'AppWord �, Qt et open-source au menu du BlackBerry DevCon Europe 0
  4. � Quelque chose ne va vraiment pas avec les d�veloppeurs "modernes" �, un d�veloppeur � "l'ancienne" critique la multiplication des biblioth�ques 10
  5. BlackBerry 10 : premi�res images du prochain OS de RIM qui devrait int�grer des widgets et des tuiles inspir�es de Windows Phone 0
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil d�claratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveaut�s de C++11 Visual C++ doit-il rapidement int�grer ? Donnez-nous votre avis 10
Page suivante

Le Qt Quarterly au hasard

Logo

D�ployer dans le Bazaar

Qt Quarterly est la revue trimestrielle propos�e par Nokia et � destination des d�veloppeurs Qt. Ces articles d'une grande qualit� technique sont r�dig�s par des experts Qt. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 4.7
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