29 lines
605 B
C++
29 lines
605 B
C++
#include "effect.h"
|
|
|
|
#include <QPainter>
|
|
#include <QDebug>
|
|
|
|
void Wave_effect::draw(QPainter* painter) {
|
|
auto r = boundingRect();
|
|
qDebug() << r;
|
|
|
|
//r.adjusted(-10, -10, 10, 10);
|
|
|
|
//painter->setBrush(Qt::NoBrush);
|
|
|
|
|
|
painter->fillRect(r, Qt::yellow);
|
|
|
|
drawSource(painter);
|
|
}
|
|
|
|
QRectF Wave_effect::boundingRectFor(const QRectF& sourceRect) const {
|
|
|
|
auto r = QGraphicsEffect::boundingRectFor(sourceRect);
|
|
qDebug() << "Wave_effect::boundingRectFor:" << sourceRect << " " << r;
|
|
return r.adjusted(-10, -10, 10, 10);
|
|
//return QGraphicsEffect::boundingRectFor(sourceRect);
|
|
}
|
|
|
|
|