JPNaude
20th January 2010, 11:17
Hi
I get the following error in regard to the interface below:
In file included from ../tmp/../source/IView.h:24,
from ../tmp/moc_IView.cpp:10:
../tmp/../source/IContext.h:42: error: expected identifier before string constant
This is my class:
#ifndef ICONTEXT_H
#define ICONTEXT_H
#include "ObjManagement_global.h"
#include <QString>
namespace Qtilities {
namespace ObjManagement {
namespace Interfaces {
class OBJMANAGEMENT_SHARED_EXPORT IContext {
public:
virtual QString context() const = 0;
virtual QString contextHelpId() const { return QString(); }
};
}
}
}
Q_DECLARE_INTERFACE(Qtilities::ObjManagement::Inte rfaces::IContext,"com.Qtilities.ObjManagement.IContext/1.0")
#endif // ICONTEXT_H
The interface is used in another interface, which class can inherit from and then implement IContext. This class is shown below:
#ifndef IVIEW_H
#define IVIEW_H
#include "ObjManagement_global.h"
#include "IContext.h"
#include <QWidget>
namespace Qtilities {
namespace ObjManagement {
namespace Interfaces {
class OBJMANAGEMENT_SHARED_EXPORT IView : public QWidget, virtual public IContext
{
Q_OBJECT
Q_INTERFACES(Qtilities::ObjManagement::Interfaces: :IContext)
public:
IView(QWidget * parent = 0, Qt::WindowFlags f = 0) : QWidget(parent,f) {}
virtual ~IView() {}
signals:
void appendContext(const QString& context);
void removeContext(const QString& context);
};
}
}
}
#endif // IVIEW_H
I suspect it has something to do with the namespaces? It has worked before but stopped working now and I can't figure out what changed.
Any inputs will be appreciated.
Thanks.
Jaco
I get the following error in regard to the interface below:
In file included from ../tmp/../source/IView.h:24,
from ../tmp/moc_IView.cpp:10:
../tmp/../source/IContext.h:42: error: expected identifier before string constant
This is my class:
#ifndef ICONTEXT_H
#define ICONTEXT_H
#include "ObjManagement_global.h"
#include <QString>
namespace Qtilities {
namespace ObjManagement {
namespace Interfaces {
class OBJMANAGEMENT_SHARED_EXPORT IContext {
public:
virtual QString context() const = 0;
virtual QString contextHelpId() const { return QString(); }
};
}
}
}
Q_DECLARE_INTERFACE(Qtilities::ObjManagement::Inte rfaces::IContext,"com.Qtilities.ObjManagement.IContext/1.0")
#endif // ICONTEXT_H
The interface is used in another interface, which class can inherit from and then implement IContext. This class is shown below:
#ifndef IVIEW_H
#define IVIEW_H
#include "ObjManagement_global.h"
#include "IContext.h"
#include <QWidget>
namespace Qtilities {
namespace ObjManagement {
namespace Interfaces {
class OBJMANAGEMENT_SHARED_EXPORT IView : public QWidget, virtual public IContext
{
Q_OBJECT
Q_INTERFACES(Qtilities::ObjManagement::Interfaces: :IContext)
public:
IView(QWidget * parent = 0, Qt::WindowFlags f = 0) : QWidget(parent,f) {}
virtual ~IView() {}
signals:
void appendContext(const QString& context);
void removeContext(const QString& context);
};
}
}
}
#endif // IVIEW_H
I suspect it has something to do with the namespaces? It has worked before but stopped working now and I can't figure out what changed.
Any inputs will be appreciated.
Thanks.
Jaco