1
0
Fork 0
flightgear/utils/fgqcanvas/fgqcanvasimage.cpp
James Turner bd5a266e9f Qt-based remote canvas application.
Work-in-progress, currently performance is sub-optimal (software
rendering via QPainter API).
2016-12-17 14:24:28 +00:00

42 lines
726 B
C++

#include "fgqcanvasimage.h"
#include <QPainter>
#include <QDebug>
#include "fgcanvaspaintcontext.h"
#include "localprop.h"
FGQCanvasImage::FGQCanvasImage(FGCanvasGroup* pr, LocalProp* prop) :
FGCanvasElement(pr, prop)
{
}
void FGQCanvasImage::doPaint(FGCanvasPaintContext *context) const
{
if (_imageDirty) {
rebuildImage();
_imageDirty = false;
}
context->painter()->drawPixmap(0, 0, _image);
}
bool FGQCanvasImage::onChildAdded(LocalProp *prop)
{
if (FGCanvasElement::onChildAdded(prop)) {
return true;
}
qDebug() << "image saw child:" << prop->name();
return false;
}
void FGQCanvasImage::rebuildImage() const
{
}
void FGQCanvasImage::markStyleDirty()
{
}