Commit c1423f9b authored by Claudio Valerio's avatar Claudio Valerio

created the thumbnail on dnd from the board

parent 646684e5
......@@ -98,14 +98,17 @@ QVariant UBGraphicsSvgItem::itemChange(GraphicsItemChange change, const QVariant
void UBGraphicsSvgItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (Delegate()->mousePressEvent(event))
{
//NOOP
}
else
{
QMimeData* pMime = new QMimeData();
QPixmap pixmap = toPixmapItem()->pixmap();
pMime->setImageData(pixmap.toImage());
Delegate()->setMimeData(pMime);
qreal k = (qreal)pixmap.width() / 100.0;
QSize newSize((int)(pixmap.width() / k), (int)(pixmap.height() / k));
Delegate()->setDragPixmap(pixmap.scaled(newSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
if (!Delegate()->mousePressEvent(event))
QGraphicsSvgItem::mousePressEvent(event);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment