• PySide 模块
  • PySide.QtSvg
  • 内容表表

    上一话题

    QGraphicsSvgItem

    下一话题

    PySide.QtUiTools

    QSvgWidget

    概要

    函数

    详细描述

    PySide.QtSvg.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 PySide.QtGui.QLabel is used for displaying text and bitmap images.

    Since PySide.QtSvg.QSvgWidget 是子类化的 PySide.QtGui.QWidget , SVG drawings are rendered using the properties of the display. More control can be exercised over the rendering process with the PySide.QtSvg.QSvgRenderer class, as this can be used to paint onto other paint devices, such as PySide.QtGui.QImage and PySide.QtOpenGL.QGLWidget . The renderer used by the widget can be obtained with the PySide.QtSvg.QSvgWidget.renderer() 函数。

    PySide.QtSvg.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 PySide.QtSvg.QSvgWidget.load() functions provide two different ways to load an SVG file: they accept either the file name of an SVG file or a PySide.QtCore.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 PySide.QtGui.QWidget size hint. Subclass this class and reimplement PySide.QtSvg.QSvgWidget.sizeHint() if you need to customize this behavior.

    class PySide.QtSvg. QSvgWidget ( [ parent=None ] )
    class PySide.QtSvg. QSvgWidget ( file [ , parent=None ] )
    参数:

    Constructs a new SVG display widget with the given parent .

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

    PySide.QtSvg.QSvgWidget. load ( file )
    参数: file – unicode

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

    PySide.QtSvg.QSvgWidget. load ( contents )
    参数: contents PySide.QtCore.QByteArray

    Loads the specified SVG format contents and updates the widget.

    PySide.QtSvg.QSvgWidget. renderer ( )
    返回类型: PySide.QtSvg.QSvgRenderer

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