Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QSvgWidget Class

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

Header:#include <QSvgWidget>
Since: Qt 4.1
Inherits:QWidget

Public Functions

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

Reimplemented Public Functions

virtual QSizesizeHint() const

Public Slots

voidload(const QString & file)
voidload(const QByteArray & contents)
  • 19 public slots inherited fromQWidget
  • 1 public slot inherited fromQObject

Reimplemented Protected Functions

virtual voidpaintEvent(QPaintEvent * event)
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Additional Inherited Members

  • 58 properties inherited fromQWidget
  • 1 property inherited fromQObject
  • 1 signal inherited fromQWidget
  • 1 signal inherited fromQObject
  • 4 static public members inherited fromQWidget
  • 7 static public members inherited fromQObject
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice
  • 1 protected slot inherited fromQWidget

Detailed Description

TheQSvgWidget 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 asQLabel is used for displaying text and bitmap images.

SinceQSvgWidget is a subclass ofQWidget, SVG drawings are rendered using the properties of the display. More control can be exercised over the rendering process with theQSvgRenderer class, as this can be used to paint onto other paint devices, such asQImage andQGLWidget. The renderer used by the widget can be obtained with therenderer() function.

EachQSvgWidget 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. Theload() functions provide two different ways to load an SVG file: they accept either the file name of an SVG file or aQByteArray 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 defaultQWidget size hint. Subclass this class and reimplementsizeHint() if you need to customize this behavior.

See alsoQSvgRenderer,QtSvg Module, andQPicture.

Member Function Documentation

QSvgWidget::QSvgWidget(QWidget * parent = 0)

Constructs a new SVG display widget with the givenparent.

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

Constructs a new SVG display widget with the givenparent and loads the contents of the specifiedfile.

QSvgWidget::~QSvgWidget()

Destroys the widget.

[slot]void QSvgWidget::load(constQString & file)

Loads the contents of the specified SVGfile and updates the widget.

[slot]void QSvgWidget::load(constQByteArray & contents)

Loads the specified SVG formatcontents and updates the widget.

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

Reimplemented fromQWidget::paintEvent().

QSvgRenderer * QSvgWidget::renderer() const

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

[virtual]QSize QSvgWidget::sizeHint() const

Reimplemented fromQWidget::sizeHint().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp