Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
QtSvg.QSvgGenerator Class Reference

The QSvgGenerator class provides a paint device that is used to create SVG drawings. More...

Inheritance diagram for QtSvg.QSvgGenerator:
Collaboration diagram for QtSvg.QSvgGenerator:

Public Member Functions

 QSvgGenerator ()
  More...
 
override void CreateProxy ()
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPaintDevice
virtual System.IntPtr GetDC ()
 
virtual void ReleaseDC (System.IntPtr hdc)
 
new void Dispose ()
 

Protected Member Functions

 QSvgGenerator (System.Type dummy)
 
override int Metric (QPaintDevice.PaintDeviceMetric metric)
  More...
 
- Protected Member Functions inherited from QtGui.QPaintDevice
 QPaintDevice (System.Type dummy)
 
 QPaintDevice ()
  More...
 

Properties

override QPaintEngine PaintEngine [get]
  More...
 
new string Description [get, set]
  More...
 
new string FileName [get, set]
  More...
 
new QIODevice OutputDevice [get, set]
  More...
 
new int Resolution [get, set]
  More...
 
new QSize Size [get, set]
  More...
 
new string Title [get, set]
  More...
 
new QRect ViewBox [get, set]
  More...
 
new QRectF ViewBoxF [get, set]
  More...
 
- Properties inherited from QtGui.QPaintDevice
int ColorCount [get]
  More...
 
int Depth [get]
  More...
 
virtual int DevType [get]
 
int Height [get]
  More...
 
int HeightMM [get]
  More...
 
int LogicalDpiX [get]
  More...
 
int LogicalDpiY [get]
  More...
 
int NumColors [get]
  More...
 
virtual QPaintEngine PaintEngine [get]
  More...
 
bool PaintingActive [get]
  More...
 
int PhysicalDpiX [get]
  More...
 
int PhysicalDpiY [get]
  More...
 
int Width [get]
  More...
 
int WidthMM [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new ushort Painters [get, set]
 
- Properties inherited from QtGui.IQPaintDevice
System.Int32 ColorCount [get]
  More...
 
System.Int32 Depth [get]
  More...
 
System.Int32 DevType [get]
 
System.Int32 Height [get]
  More...
 
System.Int32 HeightMM [get]
  More...
 
System.Int32 LogicalDpiX [get]
  More...
 
System.Int32 LogicalDpiY [get]
  More...
 
System.Int32 NumColors [get]
  More...
 
QPaintEngine PaintEngine [get]
  More...
 
System.Boolean PaintingActive [get]
  More...
 
System.Int32 PhysicalDpiX [get]
  More...
 
System.Int32 PhysicalDpiY [get]
  More...
 
System.Int32 Width [get]
  More...
 
System.Int32 WidthMM [get]
  More...
 

Additional Inherited Members

- Public Types inherited from QtGui.QPaintDevice
enum  PaintDeviceMetric {
  PdmDepth = 6, PdmDpiX = 7, PdmDpiY = 8, PdmHeight = 2,
  PdmHeightMM = 4, PdmNumColors = 5, PdmPhysicalDpiX = 9, PdmPhysicalDpiY = 10,
  PdmWidth = 1, PdmWidthMM = 3
}
  More...
 
- Protected Attributes inherited from QtGui.QPaintDevice
SmokeInvocation interceptor
 

Detailed Description

The QSvgGenerator class provides a paint device that is used to create SVG drawings.

This paint device represents a Scalable Vector Graphics (SVG) drawing. Like QPrinter, it is designed as a write-only device that generates output in a specific format.

To write an SVG file, you first need to configure the output by setting the fileName or outputDevice properties. It is usually necessary to specify the size of the drawing by setting the size property, and in some cases where the drawing will be included in another, the viewBox property also needs to be set.

QSvgGenerator generator;

generator.setFileName(path);

generator.setSize(QSize(200, 200));

generator.setViewBox(QRect(0, 0, 200, 200));

generator.setTitle(tr("SVG Generator Example Drawing"));

generator.setDescription(tr("An SVG drawing created by the SVG Generator "

"Example provided with Qt."));

Other meta-data can be specified by setting the title, description and resolution properties.

As with other QPaintDevice subclasses, a QPainter object is used to paint onto an instance of this class:

QPainter painter;

painter.begin(&generator);

...

painter.end();

Painting is performed in the same way as for any other paint device. However, it is necessary to use the QPainter::begin() and end() to explicitly begin and end painting on the device.

The SVG Generator Example shows how the same painting commands can be used for painting a widget and writing an SVG file.

See also QSvgRenderer, QSvgWidget, and About SVG.

Constructor & Destructor Documentation

QtSvg.QSvgGenerator.QSvgGenerator ( System.Type  dummy)
protected
QtSvg.QSvgGenerator.QSvgGenerator ( )

Constructs a new generator.

Here is the call graph for this function:

Member Function Documentation

override void QtSvg.QSvgGenerator.CreateProxy ( )
virtual

Reimplemented from QtGui.QPaintDevice.

Here is the caller graph for this function:

new void QtSvg.QSvgGenerator.Dispose ( )
override int QtSvg.QSvgGenerator.Metric ( QPaintDevice.PaintDeviceMetric  metric)
protectedvirtual

Reimplemented from QPaintDevice::metric().

Reimplemented from QtGui.QPaintDevice.

Property Documentation

new string QtSvg.QSvgGenerator.Description
getset

This property holds the description of the generated SVG drawing.

This property was introduced in Qt 4.5.

new string QtSvg.QSvgGenerator.FileName
getset

This property holds the target filename for the generated SVG drawing.

This property was introduced in Qt 4.5.

new QIODevice QtSvg.QSvgGenerator.OutputDevice
getset

This property holds the output device for the generated SVG drawing.

If both output device and file name are specified, the output device will have precedence.

This property was introduced in Qt 4.5.

override QPaintEngine QtSvg.QSvgGenerator.PaintEngine
get

Reimplemented from QPaintDevice::paintEngine().

Returns the paint engine used to render graphics to be converted to SVG format information.

new int QtSvg.QSvgGenerator.Resolution
getset

This property holds the resolution of the generated output.

The resolution is specified in dots per inch, and is used to calculate the physical size of an SVG drawing.

This property was introduced in Qt 4.5.

new QSize QtSvg.QSvgGenerator.Size
getset

This property holds the size of the generated SVG drawing.

By default this property is set to QSize(-1, -1), which indicates that the generator should not output the width and height attributes of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

This property was introduced in Qt 4.5.

new string QtSvg.QSvgGenerator.Title
getset

This property holds the title of the generated SVG drawing.

This property was introduced in Qt 4.5.

new QRect QtSvg.QSvgGenerator.ViewBox
getset

This property holds the viewBox of the generated SVG drawing.

By default this property is set to QRect(0, 0, -1, -1), which indicates that the generator should not output the viewBox attribute of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

This property was introduced in Qt 4.5.

new QRectF QtSvg.QSvgGenerator.ViewBoxF
getset

This property holds the viewBox of the generated SVG drawing.

By default this property is set to QRect(0, 0, -1, -1), which indicates that the generator should not output the viewBox attribute of the <svg> element.

Note: It is not possible to change this property while a QPainter is active on the generator.

This property was introduced in Qt 4.5.