Introduce a way to extract QPixmap from ImageLayoutElement

Probably should be a part of MessageLayoutElement interface, but good
for now
This commit is contained in:
rexim 2019-05-17 20:25:15 +07:00
parent d2645b03f8
commit d4a6defed6
2 changed files with 7 additions and 0 deletions

View file

@ -168,6 +168,11 @@ int ImageLayoutElement::getXFromIndex(int index)
}
}
boost::optional<QPixmap> ImageLayoutElement::pixmap() const
{
return this->image_->pixmap();
}
//
// TEXT
//

View file

@ -62,6 +62,8 @@ public:
ImageLayoutElement(MessageElement &creator, ImagePtr image,
const QSize &size);
boost::optional<QPixmap> pixmap() const;
protected:
void addCopyTextToString(QString &str, int from = 0,
int to = INT_MAX) const override;