Commit 76636f73 authored by Craig Watson's avatar Craig Watson

Fix video loading from file

- Added an overload for setMatrix in UBGraphicsMediaItem, to propagate
  matrix changes to the child videoItem
- Upon loading a video, the child videoItem is now added correctly, and
  set to the right position
parent c220bf47
......@@ -31,6 +31,7 @@
#include <QtXml>
#include <QGraphicsTextItem>
#include <QDomElement>
#include <QGraphicsVideoItem>
#include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsPixmapItem.h"
......@@ -652,6 +653,10 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
videoItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
mScene->addItem(videoItem);
mScene->addItem(videoItem->videoItem());
// Update the child QGraphicsVideoItem's transformation matrix
videoItem->setMatrix(videoItem->matrix());
videoItem->show();
......
......@@ -353,6 +353,13 @@ void UBGraphicsMediaItem::setPos(qreal x, qreal y)
setPos(QPointF(x, y));
}
void UBGraphicsMediaItem::setMatrix(const QMatrix &matrix, bool combine)
{
QGraphicsItem::setMatrix(matrix, combine);
if (mVideoItem)
mVideoItem->setMatrix(matrix, combine);
}
void UBGraphicsMediaItem::setTransform(const QTransform &matrix, bool combine)
{
......
......@@ -110,6 +110,7 @@ public:
virtual void setPos(const QPointF &pos);
virtual void setPos(qreal x, qreal y);
virtual void setMatrix(const QMatrix &matrix, bool combine = false);
virtual void setTransform(const QTransform &matrix, bool combine = false);
virtual void resize(qreal w, qreal h);
virtual void resize(const QSizeF & pSize);
......
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