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  · 

QSvgWidget Class Reference

The QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files. More...

 #include <QSvgWidget>

Inherits: QWidget.

This class was introduced in Qt 4.1.

Public Functions

QSvgWidget ( QWidget * parent = 0 )
QSvgWidget ( const QString & file, QWidget * parent = 0 )
~QSvgWidget ()
QSvgRenderer * renderer () const

Reimplemented Public Functions

virtual QSize sizeHint () const
  • 221 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 13 public functions inherited from QPaintDevice

Public Slots

void load ( const QString & file )
void load ( const QByteArray & contents )
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Reimplemented Protected Functions

virtual void paintEvent ( QPaintEvent * event )
  • 37 protected functions inherited from QWidget
  • 8 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice

Additional Inherited Members

  • 58 properties inherited from QWidget
  • 1 property inherited from QObject
  • 1 signal inherited from QWidget
  • 1 signal inherited from QObject
  • 4 static public members inherited from QWidget
  • 7 static public members inherited from QObject
  • 37 protected functions inherited from QWidget
  • 8 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

The QSvgWidget class provides a widget that is used to display the contents of Scalable Vector Graphics (SVG) files.

This class enables developers to display SVG drawings alongside standard widgets, and is used in much the same way as QLabel is used for displaying text and bitmap images.

Since QSvgWidget is a subclass of QWidget, SVG drawings are rendered using the properties of the display. More control can be exercised over the rendering process with the QSvgRenderer class, as this can be used to paint onto other paint devices, such as QImage and QGLWidget. The renderer used by the widget can be obtained with the renderer() function.

Each QSvgWidget can be constructed with the file name of a SVG file, or they can be constructed without a specific file to render and one can be supplied later. The load() functions provide two different ways to load an SVG file: they accept either the file name of an SVG file or a QByteArray containing the serialized XML representation of an SVG file.

By default, the widget provides a size hint to reflect the size of the drawing that it displays. If no data has been loaded, the widget provides the default QWidget size hint. Subclass this class and reimplement sizeHint() if you need to customize this behavior.

See also QSvgRenderer, QtSvg Module, and QPicture.

Member Function Documentation

QSvgWidget::QSvgWidget ( QWidget * parent = 0 )

Constructs a new SVG display widget with the given parent.

QSvgWidget::QSvgWidget ( const QString & file, QWidget * parent = 0 )

Constructs a new SVG display widget with the given parent and loads the contents of the specified file.

QSvgWidget::~QSvgWidget ()

Destroys the widget.

void QSvgWidget::load ( const QString & file ) [slot]

Loads the contents of the specified SVG file and updates the widget.

void QSvgWidget::load ( const QByteArray & contents ) [slot]

Loads the specified SVG format contents and updates the widget.

void QSvgWidget::paintEvent ( QPaintEvent * event ) [virtual protected]

Reimplemented from QWidget::paintEvent().

QSvgRenderer * QSvgWidget::renderer () const

Returns the renderer used to display the contents of the widget.

QSize QSvgWidget::sizeHint () const [virtual]

Reimplemented from QWidget::sizeHint().

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.8
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