Hi,
I want to create a plugin system. So - first I create Interface
class ShopInterface
{
public:
virtual ~ShopInterface() {}
virtual QIcon getShopIcon
() const = 0;
virtual bool checkPrices
(QString strCompName,
double & dPrice,
QString strURL
);
};
class ShopInterface
{
public:
virtual ~ShopInterface() {}
virtual QStringList shopNames() const = 0;
virtual QIcon getShopIcon() const = 0;
virtual bool checkPrices(QString strCompName, double & dPrice, QString strURL );
};
To copy to clipboard, switch view to plain text mode
Then in separate CMake/VS project plugin is created.
class Shop1Plugin
: public QObject,
public ShopInterface
{
Q_OBJECT
Q_INTERFACES(ShopInterface)
public:
virtual ~Shop1Plugin ();
virtual QIcon getShopIcon
() const;
virtual bool checkPrices
(QString strCompName,
double & dPrice,
QString strURL
);
};
class Shop1Plugin : public QObject, public ShopInterface
{
Q_OBJECT
Q_INTERFACES(ShopInterface)
public:
virtual ~Shop1Plugin ();
virtual QStringList shopNames() const;
virtual QIcon getShopIcon() const;
virtual bool checkPrices(QString strCompName, double & dPrice, QString strURL );
};
To copy to clipboard, switch view to plain text mode
File Shop1Plugin.h file is sent to MOC which reports 'Error: Undefined interface' in line with Q_INTERFACES().
Why? Using Qt version 4.7.3
Bookmarks