Qyoto  4.0.6
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations 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 ()
 
 
override void CreateProxy ()
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QPaintDevice
virtual void ReleaseDC (System.IntPtr hdc)
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.IQPaintDevice
void ReleaseDC (System.IntPtr hdc)
 

Protected Member Functions

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

Properties

QRect ViewBox [get, set]
 
 
override QPaintEngine PaintEngine [get]
 
 
- Properties inherited from QtGui.QPaintDevice
int ColorCount [get]
 
 
int Depth [get]
 
 
virtual int DevType [get]
 
virtual System.IntPtr GetDC [get]
 
int Height [get]
 
 
int HeightMM [get]
 
 
int LogicalDpiX [get]
 
 
int LogicalDpiY [get]
 
 
int NumColors [get]
 
 
virtual QPaintEngine PaintEngine [get]
 
 
bool PaintingActive [get]
 
 
int PhysicalDpiX [get]
 
 
int PhysicalDpiY [get]
 
 
int Width [get]
 
 
int WidthMM [get]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new ushort Painters [get, set]
 
- Properties inherited from QtGui.IQPaintDevice
System.Int32 ColorCount [get]
 
 
System.Int32 Depth [get]
 
 
System.Int32 DevType [get]
 
System.IntPtr GetDC [get]
 
System.Int32 Height [get]
 
 
System.Int32 HeightMM [get]
 
 
System.Int32 LogicalDpiX [get]
 
 
System.Int32 LogicalDpiY [get]
 
 
System.Int32 NumColors [get]
 
 
QPaintEngine PaintEngine [get]
 
 
System.Boolean PaintingActive [get]
 
 
System.Int32 PhysicalDpiX [get]
 
 
System.Int32 PhysicalDpiY [get]
 
 
System.Int32 Width [get]
 
 
System.Int32 WidthMM [get]
 
 

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.

Member Function Documentation

override void QtSvg.QSvgGenerator.CreateProxy ( )
virtual

Reimplemented from QtGui.QPaintDevice.

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

Reimplemented from QPaintDevice::metric().

Reimplemented from QtGui.QPaintDevice.

Property Documentation

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.

QRect QtSvg.QSvgGenerator.ViewBox
getset

Returns viewBoxF().toRect().

This function was introduced in Qt 4.5.