|
|
@ -853,7 +853,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() |
|
|
|
UBGraphicsAppleWidgetItem* appleWidgetItem = graphicsAppleWidgetFromSvg(); |
|
|
|
UBGraphicsAppleWidgetItem* appleWidgetItem = graphicsAppleWidgetFromSvg(); |
|
|
|
if (appleWidgetItem) |
|
|
|
if (appleWidgetItem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
appleWidgetItem->setFlag(QGraphicsItem::ItemIsMovable, true); |
|
|
|
// appleWidgetItem->setFlag(QGraphicsItem::ItemIsMovable, true);
|
|
|
|
appleWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
appleWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
|
|
|
|
|
|
|
|
appleWidgetItem->resize(foreignObjectWidth, foreignObjectHeight); |
|
|
|
appleWidgetItem->resize(foreignObjectWidth, foreignObjectHeight); |
|
|
@ -877,7 +877,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() |
|
|
|
|
|
|
|
|
|
|
|
if (w3cWidgetItem) |
|
|
|
if (w3cWidgetItem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
w3cWidgetItem->setFlag(QGraphicsItem::ItemIsMovable, true); |
|
|
|
// w3cWidgetItem->setFlag(QGraphicsItem::ItemIsMovable, true);
|
|
|
|
w3cWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
w3cWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
|
|
|
|
|
|
|
|
w3cWidgetItem->resize(foreignObjectWidth, foreignObjectHeight); |
|
|
|
w3cWidgetItem->resize(foreignObjectWidth, foreignObjectHeight); |
|
|
@ -1000,27 +1000,27 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() |
|
|
|
UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() |
|
|
|
UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBGraphicsGroupContainerItem *group = new UBGraphicsGroupContainerItem(); |
|
|
|
UBGraphicsGroupContainerItem *group = new UBGraphicsGroupContainerItem(); |
|
|
|
QMultiMap<QString, UBGraphicsPolygonItem *> strokesGroupsContainer;
|
|
|
|
QMultiMap<QString, UBGraphicsPolygonItem *> strokesGroupsContainer; |
|
|
|
QList<QGraphicsItem *> groupContainer;
|
|
|
|
QList<QGraphicsItem *> groupContainer; |
|
|
|
QString currentStrokeIdentifier; |
|
|
|
QString currentStrokeIdentifier; |
|
|
|
|
|
|
|
|
|
|
|
QUuid groupUuid = QUuid(mXmlReader.attributes().value(aId).toString()); |
|
|
|
QUuid groupUuid = QUuid(mXmlReader.attributes().value(aId).toString()); |
|
|
|
|
|
|
|
|
|
|
|
mXmlReader.readNext(); |
|
|
|
mXmlReader.readNext(); |
|
|
|
while (!mXmlReader.atEnd())
|
|
|
|
while (!mXmlReader.atEnd()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (mXmlReader.isEndElement()) { |
|
|
|
if (mXmlReader.isEndElement()) { |
|
|
|
mXmlReader.readNext(); |
|
|
|
mXmlReader.readNext(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else if (mXmlReader.isStartElement()) |
|
|
|
} else if (mXmlReader.isStartElement()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (mXmlReader.name() == tGroup)
|
|
|
|
if (mXmlReader.name() == tGroup) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "came across the group id is" << mXmlReader.attributes().value(aId); |
|
|
|
qDebug() << "came across the group id is" << mXmlReader.attributes().value(aId); |
|
|
|
UBGraphicsGroupContainerItem *curGroup = readGroup(); |
|
|
|
UBGraphicsGroupContainerItem *curGroup = readGroup(); |
|
|
|
if (curGroup)
|
|
|
|
if (curGroup) |
|
|
|
groupContainer.append(curGroup); |
|
|
|
groupContainer.append(curGroup); |
|
|
|
}
|
|
|
|
} |
|
|
|
else if (mXmlReader.name() == tElement) |
|
|
|
else if (mXmlReader.name() == tElement) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString id = mXmlReader.attributes().value(aId).toString(); |
|
|
|
QString id = mXmlReader.attributes().value(aId).toString(); |
|
|
@ -1460,7 +1460,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) |
|
|
|
QVector<tIDataStorage*> dataStorageItems; |
|
|
|
QVector<tIDataStorage*> dataStorageItems; |
|
|
|
|
|
|
|
|
|
|
|
if(elements.value("teacherGuide")) |
|
|
|
if(elements.value("teacherGuide")) |
|
|
|
dataStorageItems = elements.value("teacherGuide")->save(pageIndex); |
|
|
|
dataStorageItems = elements.value("teacherGuide")->save(pageIndex); |
|
|
|
foreach(tIDataStorage* eachItem, dataStorageItems){ |
|
|
|
foreach(tIDataStorage* eachItem, dataStorageItems){ |
|
|
|
if(eachItem->type == eElementType_START){ |
|
|
|
if(eachItem->type == eElementType_START){ |
|
|
|
mXmlWriter.writeStartElement(eachItem->name); |
|
|
|
mXmlWriter.writeStartElement(eachItem->name); |
|
|
@ -2294,7 +2294,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::videoItemToLinkedVideo(UBGraphicsMed |
|
|
|
videoFileHref = UBFileSystemUtils::removeLocalFilePrefix(videoFileHref); |
|
|
|
videoFileHref = UBFileSystemUtils::removeLocalFilePrefix(videoFileHref); |
|
|
|
if(videoFileHref.startsWith(mDocumentPath)) |
|
|
|
if(videoFileHref.startsWith(mDocumentPath)) |
|
|
|
videoFileHref = videoFileHref.replace(mDocumentPath + "/",""); |
|
|
|
videoFileHref = videoFileHref.replace(mDocumentPath + "/",""); |
|
|
|
|
|
|
|
|
|
|
|
mXmlWriter.writeAttribute(nsXLink, "href", videoFileHref); |
|
|
|
mXmlWriter.writeAttribute(nsXLink, "href", videoFileHref); |
|
|
|
mXmlWriter.writeEndElement(); |
|
|
|
mXmlWriter.writeEndElement(); |
|
|
|
} |
|
|
|
} |
|
|
|