|
|
@ -65,8 +65,9 @@ void UBGraphicsPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
QMimeData* pMime = new QMimeData(); |
|
|
|
QMimeData* pMime = new QMimeData(); |
|
|
|
pMime->setImageData(pixmap().toImage()); |
|
|
|
pMime->setImageData(pixmap().toImage()); |
|
|
|
mDelegate->setMimeData(pMime); |
|
|
|
mDelegate->setMimeData(pMime); |
|
|
|
int k = pixmap().width() / 100; |
|
|
|
qreal k = (qreal)pixmap().width() / 100.0; |
|
|
|
QSize newSize(pixmap().width() / k, pixmap().height() / k); |
|
|
|
|
|
|
|
|
|
|
|
QSize newSize((int)(pixmap().width() / k), (int)(pixmap().height() / k)); |
|
|
|
|
|
|
|
|
|
|
|
mDelegate->setDragPixmap(pixmap().scaled(newSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); |
|
|
|
mDelegate->setDragPixmap(pixmap().scaled(newSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); |
|
|
|
|
|
|
|
|
|
|
|