harbour-seaprint/src/imageitem.h
Anton Thomasson 0efd96c072 Make the icon an attribute on the printer object
This allows retrying based on actual size and using cURL for getting
the icon to avoid old Qt network code.
2022-02-19 17:48:51 +01:00

31 lines
554 B
C++

#ifndef IMAGEITEM_H
#define IMAGEITEM_H
#include <QQuickPaintedItem>
#include <QPainter>
#include <QImage>
class ImageItem : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QImage image READ getImage WRITE setImage NOTIFY imageChanged)
Q_PROPERTY(bool valid READ isValid NOTIFY imageChanged)
public:
ImageItem();
void paint(QPainter *painter);
signals:
void imageChanged();
private:
QImage getImage() const;
void setImage(const QImage &image);
bool isValid() const;
QImage _image;
};
#endif // IMAGEITEM_H