|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.svg.QSvgWidget
public class QSvgWidget
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QSvgWidget()
Equivalent to QSvgWidget(0). |
|
QSvgWidget(QWidget parent)
Constructs a new SVG display widget with the given parent. |
|
QSvgWidget(java.lang.String file)
Equivalent to QSvgWidget(file, 0). |
|
QSvgWidget(java.lang.String file,
QWidget parent)
Constructs a new SVG display widget with the given parent and loads the contents of the specified file. |
Method Summary | |
---|---|
static QSvgWidget |
fromNativePointer(QNativePointer nativePointer)
This function returns the QSvgWidget instance pointed to by nativePointer |
void |
load(QByteArray contents)
Loads the specified SVG format contents and updates the widget. |
void |
load(java.lang.String file)
Loads the contents of the specified SVG file and updates the widget. |
protected void |
paintEvent(QPaintEvent event)
This function is reimplemented for internal reasons. |
QSvgRenderer |
renderer()
Returns the renderer used to display the contents of the widget. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QSvgWidget()
Equivalent to QSvgWidget(0).
public QSvgWidget(QWidget parent)
Constructs a new SVG display widget with the given parent.
public QSvgWidget(java.lang.String file)
Equivalent to QSvgWidget(file, 0).
public QSvgWidget(java.lang.String file, QWidget parent)
Constructs a new SVG display widget with the given parent and loads the contents of the specified file.
Method Detail |
---|
public final void load(QByteArray contents)
Loads the specified SVG format contents and updates the widget.
public final void load(java.lang.String file)
Loads the contents of the specified SVG file and updates the widget.
public final QSvgRenderer renderer()
Returns the renderer used to display the contents of the widget.
protected void paintEvent(QPaintEvent event)
This function is reimplemented for internal reasons.
paintEvent
in class QWidget
public QSize sizeHint()
This function is reimplemented for internal reasons.
sizeHint
in class QWidget
public static QSvgWidget fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |