I have a class defined inside a namespace which has properties of the type from the same namespace:
// inside the included file
Q_DECLARE_METATYPE(Core::Vector)
// inside particle.h
namespace Core {
class Particle {
Q_OBJECT
Q_PROPERTY(Core::Vector position READ position WRITE setPosition)
public:
....
};
}
// inside the included file
Q_DECLARE_METATYPE(Core::Vector)
// inside particle.h
namespace Core {
class Particle {
Q_OBJECT
Q_PROPERTY(Core::Vector position READ position WRITE setPosition)
public:
....
};
}
To copy to clipboard, switch view to plain text mode
But when trying to compile I'm getting the following error:
particle.moc|43| error: ‘staticMetaObject’ is not a member of ‘Core’
Inside particle.moc there is the following fragment:
static const QMetaObject *qt_meta_extradata_Core__Particle
[] = { &Core::staticMetaObject,0
};
{ &Body::staticMetaObject, qt_meta_stringdata_Core__Particle,
qt_meta_data_Core__Particle, qt_meta_extradata_Core__Particle }
};
static const QMetaObject *qt_meta_extradata_Core__Particle[] = {
&Core::staticMetaObject,0
};
const QMetaObject Core::Particle::staticMetaObject = {
{ &Body::staticMetaObject, qt_meta_stringdata_Core__Particle,
qt_meta_data_Core__Particle, qt_meta_extradata_Core__Particle }
};
To copy to clipboard, switch view to plain text mode
This looks like wrong code. I have no idea why moc generates it.
Thanks in advance for any help.
Bookmarks