summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-06-14 00:17:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-17 17:40:15 +0200
commit67f36f439ffcd25742d76bfbbaf594a7b7093b61 (patch)
treea9bc8c5788a1db209746a06de2472d427584d852
parent6ed20e1f7c2591b86a1c4b230d488ff93b379f6d (diff)
downloadqt3d-67f36f439ffcd25742d76bfbbaf594a7b7093b61.tar.gz
Introducing a property for antialiasing
With this property antialiasing can be enabled and disabled on the viewport when renderMode() == BufferedRender. Change-Id: If811f3141d032103a2495e7624386991cb500cfd Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/imports/threed/viewport.cpp24
-rw-r--r--src/imports/threed/viewport.h6
2 files changed, 30 insertions, 0 deletions
diff --git a/src/imports/threed/viewport.cpp b/src/imports/threed/viewport.cpp
index 51a8873e5..9e506f283 100644
--- a/src/imports/threed/viewport.cpp
+++ b/src/imports/threed/viewport.cpp
@@ -675,6 +675,30 @@ void Viewport::setBlending(bool value)
}
/*!
+ \qmlproperty bool Viewport::antialiasing
+
+ The antialiasing property is used to enable or disable antialiasing
+ on the viewport. This property only has an effect if renderMode() == BufferedRender.
+ For renderMode() == DirectRender antialiasing can be enabled by setting the
+ QSurfaceFormat.
+
+ By default, antialiasing is set to false.
+*/
+bool Viewport::antialiasing() const
+{
+ return QQuickPaintedItem::antialiasing();
+}
+
+void Viewport::setAntialiasing(bool value)
+{
+ if (value != QQuickPaintedItem::antialiasing()) {
+ QQuickPaintedItem::setAntialiasing(value);
+ Q_EMIT antialiasingChanged();
+ }
+}
+
+
+/*!
\qmlproperty Camera Viewport::camera
This property sets the camera parameters which will be used for
diff --git a/src/imports/threed/viewport.h b/src/imports/threed/viewport.h
index ddc9f655a..bc586c3ed 100644
--- a/src/imports/threed/viewport.h
+++ b/src/imports/threed/viewport.h
@@ -71,6 +71,8 @@ class Viewport : public QQuickPaintedItem, public QQuickViewport
Q_PROPERTY(QGLCamera *camera READ camera WRITE setCamera)
Q_PROPERTY(QGLLightParameters *light READ light WRITE setLight NOTIFY viewportChanged)
Q_PROPERTY(QGLLightModel *lightModel READ lightModel WRITE setLightModel NOTIFY viewportChanged)
+ Q_PROPERTY(bool antialiasing READ antialiasing WRITE setAntialiasing NOTIFY antialiasingChanged)
+
public:
enum RenderMode
{
@@ -103,6 +105,9 @@ public:
bool blending() const;
void setBlending(bool value);
+ bool antialiasing() const;
+ void setAntialiasing(bool value);
+
QGLCamera *camera() const;
void setCamera(QGLCamera *value);
@@ -123,6 +128,7 @@ public:
Q_SIGNALS:
void viewportChanged();
void showSceneGraphChanged();
+ void antialiasingChanged();
public Q_SLOTS:
void update3d();