|
|
|
@ -74,31 +74,32 @@ QString UBImportImage::importFileFilter() |
|
|
|
|
return filter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QList<UBGraphicsItem*> UBImportImage::import(const QUuid& uuid, const QString& filePath) |
|
|
|
|
{ |
|
|
|
|
QList<UBGraphicsItem*> result; |
|
|
|
|
|
|
|
|
|
QPixmap pix(filePath); |
|
|
|
|
if (pix.isNull()) |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
QList<UBGraphicsItem*> UBImportImage::import(const QUuid& uuid, const QString& filePath) |
|
|
|
|
{ |
|
|
|
|
Q_UNUSED(uuid); |
|
|
|
|
QList<UBGraphicsItem*> result; |
|
|
|
|
|
|
|
|
|
QPixmap pix(filePath); |
|
|
|
|
if (pix.isNull()) |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem(); |
|
|
|
|
pixmapItem->setPixmap(pix); |
|
|
|
|
result << pixmapItem; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsItem* item) |
|
|
|
|
{ |
|
|
|
|
UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item; |
|
|
|
|
|
|
|
|
|
UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0)); |
|
|
|
|
scene->setAsBackgroundObject(sceneItem, true); |
|
|
|
|
|
|
|
|
|
// Only stored pixmap, should be deleted now
|
|
|
|
|
delete pixmapItem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
result << pixmapItem; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsItem* item) |
|
|
|
|
{ |
|
|
|
|
UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item; |
|
|
|
|
|
|
|
|
|
UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0)); |
|
|
|
|
scene->setAsBackgroundObject(sceneItem, true); |
|
|
|
|
|
|
|
|
|
// Only stored pixmap, should be deleted now
|
|
|
|
|
delete pixmapItem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const QString& UBImportImage::folderToCopy() |
|
|
|
|
{ |
|
|
|
|
static QString f(""); |
|
|
|
|