basictoolsplugin.h Example File
tools/plugandpaint/plugins/basictools/basictoolsplugin.h
#ifndef BASICTOOLSPLUGIN_H
#define BASICTOOLSPLUGIN_H
#include <interfaces.h>
#include <QRect>
#include <QObject>
#include <QtPlugin>
#include <QStringList>
#include <QPainterPath>
#include <QImage>
class BasicToolsPlugin : public QObject,
public BrushInterface,
public ShapeInterface,
public FilterInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
public:
QStringList brushes() const override;
QRect mousePress(const QString &brush, QPainter &painter,
const QPoint &pos) override;
QRect mouseMove(const QString &brush, QPainter &painter,
const QPoint &oldPos, const QPoint &newPos) override;
QRect mouseRelease(const QString &brush, QPainter &painter,
const QPoint &pos) override;
QStringList shapes() const override;
QPainterPath generateShape(const QString &shape, QWidget *parent) override;
QStringList filters() const override;
QImage filterImage(const QString &filter, const QImage &image,
QWidget *parent) override;
};
#endif