I'm follow Qt Echo Plugin
example and trying to write complex application. My project have following structure:
MainDir \
Main.pro
kernel \
kernel.pro
abstractinterface.h
main.cpp
testplugin \
testplugin.pro
abstractplugin.h
abstractplugin.cpp
Problem is in plugin header file:
#include <QObject>
#include <QtPlugin>
#include "abstractinterface.h"
class AbstractPlugin : public QObject, AbstractInterface
// An error appears here
// expected class-name before '{' token
{
Q_OBJECT
//... plugin initialization code ...
public:
explicit AbstractPlugin(QObject *parent = 0);
};
Also, autocompletion can't find class AbstractInterface.
So, question is: what I'm doing wrong? In testplugin.pro
file I have line INCLUDEPATH += ../kernel/
.
Any help appreciated.
---- EDIT -----
abstractinterface.h
#include <QtPlugin>
#define INTERFACE_ID "AbstractInterface/1.0"
class AbstractInterface
{
public:
virtual ~AbstractInterface();
virtual void init();
virtual void enable();
virtual void disable();
};
Q_DECLARE_INTERFACE(AbstractInterface, INTERFACE_ID)