Skip to content

Commit

Permalink
register Packet as a meta type
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed May 26, 2015
1 parent 15558fd commit 5157476
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 27,13 @@
#define AVPACKET_REF AV_MODULE_CHECK(LIBAVCODEC, 55, 34, 1 ,39, 101)

namespace QtAV {
namespace {
static const struct RegisterMetaTypes {
inline RegisterMetaTypes() {
qRegisterMetaType<QtAV::Packet>();
}
} _registerMetaTypes;
} //namespace

class PacketPrivate : public QSharedData
{
Expand Down
3 changes: 2 additions & 1 deletion src/QtAV/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 23,7 @@
#define QAV_PACKET_H

#include <QtCore/QByteArray>
#include <QtCore/QMetaType>
#include <QtCore/QSharedData>
#include <QtAV/QtAV_Global.h>

Expand Down Expand Up @@ -75,5 76,5 @@ bool Packet::isValid() const
}

} //namespace QtAV

Q_DECLARE_METATYPE(QtAV::Packet)
#endif // QAV_PACKET_H

0 comments on commit 5157476

Please sign in to comment.