2016-12-03 14:14:06 +00:00
|
|
|
#ifndef FGQCANVASIMAGE_H
|
|
|
|
#define FGQCANVASIMAGE_H
|
|
|
|
|
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
#include "fgcanvaselement.h"
|
|
|
|
|
|
|
|
class FGQCanvasImage : public FGCanvasElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FGQCanvasImage(FGCanvasGroup* pr, LocalProp* prop);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void doPaint(FGCanvasPaintContext* context) const override;
|
|
|
|
|
|
|
|
virtual void markStyleDirty() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool onChildAdded(LocalProp *prop) override;
|
|
|
|
|
|
|
|
void rebuildImage() const;
|
2016-12-18 23:52:16 +00:00
|
|
|
|
|
|
|
void markImageDirty();
|
2016-12-03 14:14:06 +00:00
|
|
|
private:
|
|
|
|
mutable bool _imageDirty;
|
|
|
|
mutable QPixmap _image;
|
|
|
|
QString _source;
|
2016-12-18 23:52:16 +00:00
|
|
|
mutable QSizeF _destSize;
|
2016-12-03 14:14:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FGQCANVASIMAGE_H
|