|
|
@ -98,15 +98,18 @@ QVariant UBGraphicsSvgItem::itemChange(GraphicsItemChange change, const QVariant |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsSvgItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
void UBGraphicsSvgItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (Delegate()->mousePressEvent(event)) |
|
|
|
QMimeData* pMime = new QMimeData(); |
|
|
|
{ |
|
|
|
QPixmap pixmap = toPixmapItem()->pixmap(); |
|
|
|
//NOOP
|
|
|
|
pMime->setImageData(pixmap.toImage()); |
|
|
|
} |
|
|
|
Delegate()->setMimeData(pMime); |
|
|
|
else |
|
|
|
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); |
|
|
|
QGraphicsSvgItem::mousePressEvent(event); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsSvgItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
void UBGraphicsSvgItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) |
|
|
|