svgalibpaintdevice.cpp Example File qtopiacore/svgalib/svgalibpaintdevice.cpp
#include "svgalibpaintdevice.h"
#include "svgalibpaintengine.h"
#include <QApplication>
#include <QDesktopWidget>
SvgalibPaintDevice::SvgalibPaintDevice(QWidget *w)
: QCustomRasterPaintDevice(w)
{
pengine = new SvgalibPaintEngine;
}
SvgalibPaintDevice::~SvgalibPaintDevice()
{
delete pengine;
}
int SvgalibPaintDevice::metric(PaintDeviceMetric m) const
{
if (m == PdmWidth)
return QApplication::desktop()->screenGeometry().width();
else if (m == PdmHeight)
return QApplication::desktop()->screenGeometry().height();
return QCustomRasterPaintDevice::metric(m);
}
|