Hello,I have a problem in use of Qt::ConicalGradientPattern.please help me.thank you very very much.
#ifndef PAINT_H
#define PAINT_H
#include <QtWidgets>
{
Q_OBJECT
public:
protected:
};
#endif // PAINT_H
#ifndef PAINT_H
#define PAINT_H
#include <QtWidgets>
class Lines : public QWidget
{
Q_OBJECT
public:
Lines(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *event);
void drawLines(QPainter *qp);
};
#endif // PAINT_H
To copy to clipboard, switch view to plain text mode
#include "lines.h"
#include <QPainter>
{
}
{
Q_UNUSED(e);
drawLines(&qp);
}
{QPen pen
(Qt
::black,
100, Qt
::SolidLine);
qp->fillRect(500,500,200,200,Qt::ConicalGradientPattern );
qp->setPen(pen);
qp->drawLine(100,100,100,100);
}
#include "lines.h"
#include <QPainter>
Lines::Lines(QWidget *parent)
: QWidget(parent)
{
}
void Lines::paintEvent(QPaintEvent *e)
{
Q_UNUSED(e);
QPainter qp(this);
drawLines(&qp);
}
void Lines::drawLines(QPainter *qp)
{QPen pen(Qt::black, 100, Qt::SolidLine);
qp->fillRect(500,500,200,200,Qt::ConicalGradientPattern );
qp->setPen(pen);
qp->drawLine(100,100,100,100);
}
To copy to clipboard, switch view to plain text mode
The error is: QBrush: Wrong use of a gradient pattern
Bookmarks