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  · 

QTextFrameFormat Class Reference
[QtGui module]

The QTextFrameFormat class provides formatting information for frames in a QTextDocument. More...

 #include <QTextFrameFormat>

Inherits QTextFormat.

Inherited by QTextTableFormat.

Note: All the functions in this class are reentrant.

Public Types

  • enum BorderStyle { BorderStyle_None, BorderStyle_Dotted, BorderStyle_Dashed, BorderStyle_Solid, ..., BorderStyle_Outset }
  • enum Position { InFlow, FloatLeft, FloatRight }

Public Functions


Detailed Description

The QTextFrameFormat class provides formatting information for frames in a QTextDocument.

A text frame groups together one or more blocks of text, providing a layer of structure larger than the paragraph. The format of a frame specifies how it is rendered and positioned on the screen. It does not directly specify the behavior of the text formatting within, but provides constraints on the layout of its children.

The frame format defines the width() and height() of the frame on the screen. Each frame can have a border() that surrounds its contents with a rectangular box. The border is surrounded by a margin() around the frame, and the contents of the frame are kept separate from the border by the frame's padding(). This scheme is similar to the box model used by Cascading Style Sheets for HTML pages.

The position() of a frame is set using setPosition() and determines how it is located relative to the surrounding text.

The validity of a QTextFrameFormat object can be determined with the isValid() function.

See also QTextFrame and QTextBlockFormat.


Member Type Documentation

enum QTextFrameFormat::BorderStyle

ConstantValue
QTextFrameFormat::BorderStyle_None0
QTextFrameFormat::BorderStyle_Dotted1
QTextFrameFormat::BorderStyle_Dashed2
QTextFrameFormat::BorderStyle_Solid3
QTextFrameFormat::BorderStyle_Double4
QTextFrameFormat::BorderStyle_DotDash5
QTextFrameFormat::BorderStyle_DotDotDash6
QTextFrameFormat::BorderStyle_Groove7
QTextFrameFormat::BorderStyle_Ridge8
QTextFrameFormat::BorderStyle_Inset9
QTextFrameFormat::BorderStyle_Outset10

This enum was introduced in Qt 4.3.

enum QTextFrameFormat::Position

ConstantValue
QTextFrameFormat::InFlow0
QTextFrameFormat::FloatLeft1
QTextFrameFormat::FloatRight2


Member Function Documentation

QTextFrameFormat::QTextFrameFormat ()

Constructs a text frame format object with the default properties.

qreal QTextFrameFormat::border () const

Returns the width of the border in pixels.

See also setBorder().

QBrush QTextFrameFormat::borderBrush () const

Returns the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also setBorderBrush().

BorderStyle QTextFrameFormat::borderStyle () const

Returns the style of the frame's border.

This function was introduced in Qt 4.3.

See also setBorderStyle().

qreal QTextFrameFormat::bottomMargin () const

Returns the width of the frame's bottom margin in pixels.

This function was introduced in Qt 4.3.

See also setBottomMargin().

QTextLength QTextFrameFormat::height () const

Returns the height of the frame's border rectangle.

See also setHeight().

bool QTextFrameFormat::isValid () const

Returns true if the format description is valid; otherwise returns false.

qreal QTextFrameFormat::leftMargin () const

Returns the width of the frame's left margin in pixels.

This function was introduced in Qt 4.3.

See also setLeftMargin().

qreal QTextFrameFormat::margin () const

Returns the width of the frame's external margin in pixels.

See also setMargin().

qreal QTextFrameFormat::padding () const

Returns the width of the frame's internal padding in pixels.

See also setPadding().

PageBreakFlags QTextFrameFormat::pageBreakPolicy () const

Returns the currently set page break policy for the frame/table. The default is QTextFormat::PageBreak_Auto.

This function was introduced in Qt 4.2.

See also setPageBreakPolicy().

Position QTextFrameFormat::position () const

Returns the positioning policy for frames with this frame format.

See also setPosition().

qreal QTextFrameFormat::rightMargin () const

Returns the width of the frame's right margin in pixels.

This function was introduced in Qt 4.3.

See also setRightMargin().

void QTextFrameFormat::setBorder ( qreal width )

Sets the width (in pixels) of the frame's border.

See also border().

void QTextFrameFormat::setBorderBrush ( const QBrush & brush )

Sets the brush used for the frame's border.

This function was introduced in Qt 4.3.

See also borderBrush().

void QTextFrameFormat::setBorderStyle ( BorderStyle style )

Sets the style of the frame's border.

This function was introduced in Qt 4.3.

See also borderStyle().

void QTextFrameFormat::setBottomMargin ( qreal margin )

Sets the frame's bottom margin in pixels.

This function was introduced in Qt 4.3.

See also bottomMargin().

void QTextFrameFormat::setHeight ( const QTextLength & height )

Sets the frame's height.

See also height().

void QTextFrameFormat::setHeight ( qreal height )

This is an overloaded function.

Sets the frame's height.

void QTextFrameFormat::setLeftMargin ( qreal margin )

Sets the frame's left margin in pixels.

This function was introduced in Qt 4.3.

See also leftMargin().

void QTextFrameFormat::setMargin ( qreal margin )

Sets the frame's margin in pixels. This method also sets the left, right, top and bottom margins of the frame to the same value. The individual margins override the general margin.

See also margin().

void QTextFrameFormat::setPadding ( qreal width )

Sets the width of the frame's internal padding in pixels.

See also padding().

void QTextFrameFormat::setPageBreakPolicy ( PageBreakFlags policy )

Sets the page break policy for the frame/table to policy.

This function was introduced in Qt 4.2.

See also pageBreakPolicy().

void QTextFrameFormat::setPosition ( Position policy )

Sets the policy for positioning frames with this frame format.

See also position().

void QTextFrameFormat::setRightMargin ( qreal margin )

Sets the frame's right margin in pixels.

This function was introduced in Qt 4.3.

See also rightMargin().

void QTextFrameFormat::setTopMargin ( qreal margin )

Sets the frame's top margin in pixels.

This function was introduced in Qt 4.3.

See also topMargin().

void QTextFrameFormat::setWidth ( const QTextLength & width )

Sets the frame's border rectangle's width.

See also width() and QTextLength.

void QTextFrameFormat::setWidth ( qreal width )

This is an overloaded function.

Convenience method that sets the width of the frame's border rectangle's width to the specified fixed width.

qreal QTextFrameFormat::topMargin () const

Returns the width of the frame's top margin in pixels.

This function was introduced in Qt 4.3.

See also setTopMargin().

QTextLength QTextFrameFormat::width () const

Returns the width of the frame's border rectangle.

See also setWidth() and QTextLength.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 44
  2. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. 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
  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. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. 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.5
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