created the thumbnail on dnd from the board

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 646684e57a
commit c1423f9b94
  1. 17
      src/domain/UBGraphicsSvgItem.cpp

@ -98,15 +98,18 @@ 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);
}
}
void UBGraphicsSvgItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)

Loading…
Cancel
Save