Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.6.0
-
None
Description
I have class Message defined in my project. Message is also registered into meta type system. Here is the code snippet:
message.h
=========
class Message {
...
}
Q_DECLARE_METATYPE(Message)
message.cpp
===========
void init() {
qRegisterMetaType<Message>();
...
}
Everything worked well until I tried to make instance of Phonon's Video Player. This line of code makes a crash:
Phonon::VideoPlayer *p = new Phonon::VideoPlayer(Phonon::VideoCategory);
When I backtracked the problem in gdb I found the line 99 in \src\3rdparty\phonon\gstreamer\backend.cpp
QMetaObject::invokeMethod(mediaObject->backend(), "handleBusMessage", Qt::QueuedConnection, Q_ARG(Message, message));
makes the trouble. It looks that Q_ARG macro refers to my Message class instead of Phonon::Gstreamer::Message.
The metatype system does not respect the namespace, so the Message type here should be explicitly stated as Phonon::GStreamer::Message.