{
Q_OBJECT
public:
+ MyPaintItem() : QSGPaintedItem()
+ {
+ setAntialiasing(true);
+ }
+
virtual void paint(QPainter *p)
{
QRectF rect(0, 0, width(), height());
QSGItem::update();
}
+/*!
+ Returns true if antialiased painting is enabled; otherwise, false is returned.
+
+ By default, antialiasing is not enabled.
+
+ \sa setAntialiasing()
+*/
+bool QSGPaintedItem::antialiasing() const
+{
+ Q_D(const QSGPaintedItem);
+ return d->antialiasing;
+}
+
+/*!
+ If \a enable is true, antialiased painting is enabled.
+
+ By default, antialiasing is not enabled.
+
+ \sa antialiasing()
+*/
+void QSGPaintedItem::setAntialiasing(bool enable)
+{
+ Q_D(QSGPaintedItem);
+
+ if (d->antialiasing == enable)
+ return;
+
+ d->antialiasing = enable;
+ update();
+}
+
QSize QSGPaintedItem::contentsSize() const
{
// XXX todo
node->setPreferredRenderTarget(d->renderTarget);
node->setSize(QSize(d->width, d->height));
- node->setSmoothPainting(d->smooth);
+ node->setSmoothPainting(d->antialiasing);
node->setLinearFiltering(d->smooth);
node->setOpaquePainting(d->opaquePainting);
node->setFillColor(d->fillColor);
bool opaquePainting() const;
void setOpaquePainting(bool opaque);
+ bool antialiasing() const;
+ void setAntialiasing(bool enable);
+
QSize contentsSize() const;
void setContentsSize(const QSize &);
void resetContentsSize();