mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
If resourcePath contains a simple path to an image file, that image will be shown in design mode.
This commit is contained in:
parent
e9c917a052
commit
afa4bcb9bf
@ -340,6 +340,21 @@ void ImageItem::setImage(QImage value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage ImageItem::image(){
|
||||||
|
if (m_picture.isNull() && !resourcePath().isEmpty() && itemMode() == DesignMode){
|
||||||
|
QFileInfo fileInfo(m_resourcePath);
|
||||||
|
if (fileInfo.exists()){
|
||||||
|
return QImage(m_resourcePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m_picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItem::setResourcePath(const QString &value){
|
||||||
|
m_resourcePath=value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
ImageItem::Format ImageItem::format() const
|
ImageItem::Format ImageItem::format() const
|
||||||
{
|
{
|
||||||
return m_format;
|
return m_format;
|
||||||
|
@ -61,8 +61,8 @@ public:
|
|||||||
ImageItem(QObject *owner, QGraphicsItem *parent);
|
ImageItem(QObject *owner, QGraphicsItem *parent);
|
||||||
virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
void setImage(QImage value);
|
void setImage(QImage value);
|
||||||
QImage image(){return m_picture;}
|
QImage image();
|
||||||
void setResourcePath(const QString &value){m_resourcePath=value;}
|
void setResourcePath(const QString &value);
|
||||||
QString resourcePath() const;
|
QString resourcePath() const;
|
||||||
QString datasource() const;
|
QString datasource() const;
|
||||||
void setDatasource(const QString &datasource);
|
void setDatasource(const QString &datasource);
|
||||||
|
Loading…
Reference in New Issue
Block a user