|
|
|
@ -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) |
|
|
|
|