Commit dc7567a4 authored by Claudio Valerio's avatar Claudio Valerio

Merge branch 'Sankore-1.40' of github.com:Sankore/Sankore-3.1 into Sankore-1.40

parents 8105a531 d822dc73
...@@ -738,7 +738,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele ...@@ -738,7 +738,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele
} }
} }
UBGraphicsPixmapItem *pixItem = mCurrentScene->addPixmap(pix); UBGraphicsPixmapItem *pixItem = mCurrentScene->addPixmap(pix, NULL);
QTransform transform; QTransform transform;
QString textTransform = element.attribute(aTransform); QString textTransform = element.attribute(aTransform);
......
...@@ -816,7 +816,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString ...@@ -816,7 +816,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
img.loadFromData(pData); img.loadFromData(pData);
QPixmap pix = QPixmap::fromImage(img); QPixmap pix = QPixmap::fromImage(img);
UBGraphicsPixmapItem* pixItem = mActiveScene->addPixmap(pix, pPos, 1.); UBGraphicsPixmapItem* pixItem = mActiveScene->addPixmap(pix, NULL, pPos, 1.);
pixItem->setSourceUrl(sourceUrl); pixItem->setSourceUrl(sourceUrl);
if (isBackground) if (isBackground)
...@@ -1986,7 +1986,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint ...@@ -1986,7 +1986,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
// validate that the image is really an image, webkit does not fill properly the image mime data // validate that the image is really an image, webkit does not fill properly the image mime data
if (pix.width() != 0 && pix.height() != 0) if (pix.width() != 0 && pix.height() != 0)
{ {
mActiveScene->addPixmap(pix, pPos, 1.); mActiveScene->addPixmap(pix, NULL, pPos, 1.);
return; return;
} }
} }
......
...@@ -793,7 +793,7 @@ void UBBoardPaletteManager::addItemToCurrentPage() ...@@ -793,7 +793,7 @@ void UBBoardPaletteManager::addItemToCurrentPage()
UBApplication::boardController->downloadURL(mItemUrl); UBApplication::boardController->downloadURL(mItemUrl);
else else
{ {
UBGraphicsPixmapItem* item = UBApplication::boardController->activeScene()->addPixmap(mPixmap, mPos, mScaleFactor); UBGraphicsPixmapItem* item = UBApplication::boardController->activeScene()->addPixmap(mPixmap, NULL, mPos, mScaleFactor);
item->setSourceUrl(mItemUrl); item->setSourceUrl(mItemUrl);
item->setSelected(true); item->setSelected(true);
......
...@@ -505,7 +505,7 @@ void UBLibraryController::setItemAsBackground(UBLibElement* image) ...@@ -505,7 +505,7 @@ void UBLibraryController::setItemAsBackground(UBLibElement* image)
} }
else{ else{
QPixmap pix(image->path().toLocalFile()); QPixmap pix(image->path().toLocalFile());
UBGraphicsPixmapItem* boardItem = activeScene()->addPixmap(pix, QPointF(0, 0)); UBGraphicsPixmapItem* boardItem = activeScene()->addPixmap(pix, activeScene()->backgroundObject(), QPointF(0, 0));
activeScene()->setAsBackgroundObject(boardItem, true); activeScene()->setAsBackgroundObject(boardItem, true);
} }
} }
...@@ -679,7 +679,7 @@ void UBLibraryController::addImagesToCurrentPage(const QList<QUrl>& images) ...@@ -679,7 +679,7 @@ void UBLibraryController::addImagesToCurrentPage(const QList<QUrl>& images)
itemInScene = activeScene()->addSvg(url, pos); itemInScene = activeScene()->addSvg(url, pos);
} else { } else {
itemInScene = activeScene()->addPixmap(QPixmap( itemInScene = activeScene()->addPixmap(QPixmap(
url.toLocalFile()), pos); url.toLocalFile()), NULL, pos);
} }
} }
......
...@@ -263,7 +263,7 @@ int UBDocumentManager::addImageAsPageToDocument(const QStringList& filenames, UB ...@@ -263,7 +263,7 @@ int UBDocumentManager::addImageAsPageToDocument(const QStringList& filenames, UB
} }
else else
{ {
gi = scene->addPixmap(pix, QPointF(0, 0)); gi = scene->addPixmap(pix, NULL, QPointF(0, 0));
} }
} }
......
...@@ -1044,7 +1044,7 @@ void UBGraphicsScene::clearAnnotations() ...@@ -1044,7 +1044,7 @@ void UBGraphicsScene::clearAnnotations()
} }
UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation) UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphicsItem* replaceFor, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation)
{ {
UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem(); UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem();
...@@ -1061,7 +1061,7 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q ...@@ -1061,7 +1061,7 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q
addItem(pixmapItem); addItem(pixmapItem);
if (enableUndoRedoStack) { //should be deleted after scene own undo stack implemented if (enableUndoRedoStack) { //should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand* uc = new UBGraphicsItemUndoCommand(this, 0, pixmapItem); UBGraphicsItemUndoCommand* uc = new UBGraphicsItemUndoCommand(this, replaceFor, pixmapItem);
UBApplication::undoStack->push(uc); UBApplication::undoStack->push(uc);
} }
......
...@@ -279,7 +279,11 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem ...@@ -279,7 +279,11 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void deselectAllItems(); void deselectAllItems();
UBGraphicsPixmapItem* addPixmap(const QPixmap& pPixmap, const QPointF& pPos = QPointF(0,0), qreal scaleFactor = 1.0, bool pUseAnimation = false); UBGraphicsPixmapItem* addPixmap(const QPixmap& pPixmap,
QGraphicsItem* replaceFor,
const QPointF& pPos = QPointF(0,0),
qreal scaleFactor = 1.0,
bool pUseAnimation = false);
void textUndoCommandAdded(UBGraphicsTextItem *textItem); void textUndoCommandAdded(UBGraphicsTextItem *textItem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment