sincnarf
5th October 2007, 09:16
Here is an interface
#ifndef INTERFACES_H
#define INTERFACES_H
#include <QtPlugin>
#include <QtGui>
#include <QList>
class QImage;
class QString;
class QStringList;
class FilterInterface
{
public:
virtual ~FilterInterface(){}
virtual QStringList filters() const = 0;
virtual QImage filterImage(const QString &filter, const QImage &image,
QWidget *parent) = 0;
virtual QList<QImage> filterImageList(QString &filter, const QImage &image, QWidget *parent) = 0;
};
Q_DECLARE_INTERFACE(FilterInterface,
"com.iadfuq.sp.filterplugin.FilterInterface/1.0")
#endif
This is copied from the plug and paint example of Qt. Only difference is I added a method called filterImageList that must return a QList of QImage.
Now I am trying to use with
const QList<QImage> images = iFilter->filterImageList(action->text(),
pixmapItem->pixmap().toImage(), 0);
I get the error
mainwindow.cpp:1606: error: no matching function for call to ‘FilterInterface::filterImageList(QString, QImage, int)’
interfaces.h:20: note: candidates are: virtual QList<QImage> FilterInterface::filterImageList(QString&, const QImage&, QWidget*)
Is there something wrong with the way I declare QList<QImage> images?
#ifndef INTERFACES_H
#define INTERFACES_H
#include <QtPlugin>
#include <QtGui>
#include <QList>
class QImage;
class QString;
class QStringList;
class FilterInterface
{
public:
virtual ~FilterInterface(){}
virtual QStringList filters() const = 0;
virtual QImage filterImage(const QString &filter, const QImage &image,
QWidget *parent) = 0;
virtual QList<QImage> filterImageList(QString &filter, const QImage &image, QWidget *parent) = 0;
};
Q_DECLARE_INTERFACE(FilterInterface,
"com.iadfuq.sp.filterplugin.FilterInterface/1.0")
#endif
This is copied from the plug and paint example of Qt. Only difference is I added a method called filterImageList that must return a QList of QImage.
Now I am trying to use with
const QList<QImage> images = iFilter->filterImageList(action->text(),
pixmapItem->pixmap().toImage(), 0);
I get the error
mainwindow.cpp:1606: error: no matching function for call to ‘FilterInterface::filterImageList(QString, QImage, int)’
interfaces.h:20: note: candidates are: virtual QList<QImage> FilterInterface::filterImageList(QString&, const QImage&, QWidget*)
Is there something wrong with the way I declare QList<QImage> images?