Fixed type testing of media items (qgraphicsitem_cast couldn't tell the difference between audio and video items)

preferencesAboutTextFull
Craig Watson 8 years ago
parent 3a7c2945c3
commit 17312e88ab
  1. 2
      src/core/UB.h
  2. 10
      src/domain/UBGraphicsMediaItem.h

@ -151,6 +151,8 @@ struct UBGraphicsItemType
SvgItemType,
DelegateButtonType,
MediaItemType,
VideoItemType,
AudioItemType,
PDFItemType,
TextItemType,
CurtainItemType,

@ -160,6 +160,11 @@ class UBGraphicsAudioItem: public UBGraphicsMediaItem
Q_OBJECT
public:
enum { Type = UBGraphicsItemType::AudioItemType};
virtual int type() const
{
return Type;
}
UBGraphicsAudioItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0);
mediaType getMediaType() const { return mediaType_Audio; }
@ -172,6 +177,11 @@ class UBGraphicsVideoItem: public UBGraphicsMediaItem
Q_OBJECT
public:
enum { Type = UBGraphicsItemType::VideoItemType};
virtual int type() const
{
return Type;
}
UBGraphicsVideoItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0);

Loading…
Cancel
Save