Momergil
18th June 2014, 14:02
Hello!
I want to create a class and nest it inside the unique other class that will be using it. This nested class is a QObject derived one, being a reimplementation of QVariantAnimation.
The problem is that when I put it inside my base class, the compiler states "error 1" after the message "Error: Meta object features not supported for nested classes".
class MessageFrame : public QFrame
{
Q_OBJECT
Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText)
Q_ENUMS(Icon)
Q_ENUMS(TextType)
class MessageFrameAnimator : public QVariantAnimation
{
Q_OBJECT
public:
MessageFrameAnimator(QObject* parent = 0) :
QVariantAnimation(parent)
{}
virtual ~MessageFrameAnimator() {}
protected:
void updateCurrentValue(const QVariant & value) //Does nothing
{
Q_UNUSED(value);
}
};
public:
//...
It's not imperative to use this class as a nested one, but I'm still curious how to solve this problem - if there is any solution to it. Does somebody knows how to nest my class correctly?
Thanks,
Momergil
I want to create a class and nest it inside the unique other class that will be using it. This nested class is a QObject derived one, being a reimplementation of QVariantAnimation.
The problem is that when I put it inside my base class, the compiler states "error 1" after the message "Error: Meta object features not supported for nested classes".
class MessageFrame : public QFrame
{
Q_OBJECT
Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText)
Q_ENUMS(Icon)
Q_ENUMS(TextType)
class MessageFrameAnimator : public QVariantAnimation
{
Q_OBJECT
public:
MessageFrameAnimator(QObject* parent = 0) :
QVariantAnimation(parent)
{}
virtual ~MessageFrameAnimator() {}
protected:
void updateCurrentValue(const QVariant & value) //Does nothing
{
Q_UNUSED(value);
}
};
public:
//...
It's not imperative to use this class as a nested one, but I'm still curious how to solve this problem - if there is any solution to it. Does somebody knows how to nest my class correctly?
Thanks,
Momergil