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  · 

Supported HTML Subset

The following table lists the HTML tags supported by Qt's rich text engine:

TagDescriptionComment
aAnchor or linkSupports the href and name attributes.
addressAddress
bBold
bigLarger font
blockquoteIndented paragraph
bodyDocument bodySupports the bgcolor attribute, which can be a Qt color name or a #RRGGBB color specification.
brLine break
centerCentered paragraph
citeInline citationSame as i.
codeCodeSame as tt.
ddDefinition data
dfnDefinitionSame as i.
divDocument divisionSupports the standard block attributes.
dlDefinition listSupports the standard block attributes.
dtDefinition termSupports the standard block attributes.
emEmphasizedSame as i.
fontFont size, family, and/or colorSupports the following attributes: size, face, and color (Qt color names or #RRGGBB).
h1Level 1 headingSupports the standard block attributes.
h2Level 2 headingSupports the standard block attributes.
h3Level 3 headingSupports the standard block attributes.
h4Level 4 headingSupports the standard block attributes.
h5Level 5 headingSupports the standard block attributes.
h6Level 6 headingSupports the standard block attributes.
headDocument header
hrHorizontal lineSupports the width attribute, which can be specified as an absolute or relative (%) value.
htmlHTML document
iItalic
imgImageSupports the src, source (for Qt 3 compatibility), width, and height attributes.
kbdUser-entered text
metaMeta-informationIf a text encoding is specified using the meta tag, it is picked up by Qt::codecForHtml(). Likewise, if an encoding is specified to QTextDocument::toHtml(), the encoding is stored using a meta tag, for example:
 <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
liList item
nobrNon-breakable text
olOrdered listSupports the standard list attributes.
pParagraphLeft-aligned by default. Supports the standard block attributes.
prePreformated text
qtQt rich-text documentSynonym for html. Provided for compatibility with earlier versions of Qt.
sStrikethrough
sampSample codeSame as tt.
smallSmall font
spanGrouped elements
strongStrongSame as b.
subSubscript
supSuperscript
tableTableSupports the following attributes: border, bgcolor (Qt color names or #RRGGBB), cellspacing, cellpadding, width (absolute or relative), and height.
tbodyTable bodyDoes nothing.
tdTable data cellSupports the standard table cell attributes.
tfootTable footerDoes nothing.
thTable header cellSupports the standard table cell attributes.
theadTable headerIf the thead tag is specified, it is used when printing tables that span multiple pages.
titleDocument titleThe value specified using the title tag is available through QTextDocument::metaInformation().
trTable rowSupports the bgcolor attribute, which can be a Qt color name or a #RRGGBB color specification.
ttTypewrite font
uUnderlined
ulUnordered listSupports the standard list attributes.
varVariableSame as i.

Block Attributes

The following attributes are supported by the div, dl, dt, h1, h2, h3, h4, h5, h6, p tags:

  • align (left, right, center, justify)
  • dir (ltr, rtl)

List Attributes

The following attribute is supported by the ol and ul tags:

  • type (1, a, A, square, disc, circle)

Table Cell Attributes

The following attributes are supported by the td and th tags:

  • width (absolute, relative, or no-value)
  • bgcolor (Qt color names or #RRGGBB)
  • colspan
  • rowspan

CSS Properties

The following table lists the CSS properties supported by Qt's rich text engine:

PropertyValuesDescription
background-color<color>Background color for elements
background-image<uri>Background image for elements
color<color>Text foreground color
font-family<family name>Font family name
font-size[ small | medium | large | x-large | xx-large ] | <size>pt | <size>pxFont size relative to the document font, or specified in points or pixels
font-style[ normal | italic | oblique ]
font-weight[ normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ]Specifies the font weight used for text, where normal and bold are mapped to the corresponding QFont weights. Numeric values are 8 times the equivalent QFont weight values.
text-decorationnone | [ underline || overline || line-through ]Additional text effects
font[ [ <'font-style'> || <'font-weight'> ]? <'font-size'> <'font-family'> ]Font shorthand property
text-indent<length>pxFirst line text indentation in pixels
white-spacenormal | pre | nowrap | pre-wrapDeclares how whitespace in HTML is handled.
margin-top<length>pxTop paragraph margin in pixels
margin-bottom<length>pxBottom paragraph margin in pixels
margin-left<length>pxLeft paragraph margin in pixels
margin-right<length>pxRight paragraph margin in pixels
vertical-alignbaseline | sub | superVertical text alignment
background[ <'background-color'> || <'background-image'> ]Background shorthand property
page-break-before[ auto | always ]Make it possible to enforce a page break before the paragraph/table
page-break-after[ auto | always ]Make it possible to enforce a page break after the paragraph/table

Supported CSS Selectors

All CSS 2.1 selector classes are supported except pseudo-class selectors such as :first-child, :visited and :hover.

[Previous: Common Rich Text Editing Tasks] [Contents]

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 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. 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
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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.2
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