dev-wuyize
karlis 2023-03-22 22:47:37 +08:00
parent b739f4506b
commit ba4be72918
1 changed files with 2 additions and 2 deletions

View File

@ -43,11 +43,11 @@ void ElementPoolWidget::setElementList(std::vector<GraphicElement*> elements) {
QPainter* painter = new QPainter();
QImage* image = new QImage(QSize(iconWidth - 25, iconHeight - 25), QImage::Format_ARGB32);
image->fill(Qt::transparent);
pItem->setIcon(QIcon(QPixmap::fromImage(*image)));
pItem->setSizeHint(QSize(iconWidth, iconHeight));
painter->begin(image);
elements[index]->paintPreview(painter);
painter->end();
pItem->setIcon(QIcon(QPixmap::fromImage(*image)));
pItem->setSizeHint(QSize(iconWidth, iconHeight));
pictureList->insertItem(index, pItem);
}
if(elements.size() > 0)