aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-07-18 13:53:40 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-28 01:51:19 +0200
commit3912bbaceab166eb116447311eb16453e4f26edf (patch)
treeb44561b4fbded41d7011e79c3d9a5411a1de438c /src/quick
parentc2f2ae8ce90e621cc3835428c40c116fbdc593e6 (diff)
Update usage of smooth and antialiasing.
Change-Id: Icc8b28bdd466389ed3f269f076f1bdb6e9abe3f2 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/doc/snippets/qml/focus/MyClickableWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/MyWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/propertyaction.qml4
-rw-r--r--src/quick/doc/snippets/qml/rotation.qml4
-rw-r--r--src/quick/doc/snippets/qml/rotationanimation.qml2
-rw-r--r--src/quick/items/qquickborderimage.cpp20
-rw-r--r--src/quick/items/qquickimage.cpp17
-rw-r--r--src/quick/items/qquickshadereffectmesh.cpp1
-rw-r--r--src/quick/items/qquickshadereffectsource.cpp5
-rw-r--r--src/quick/util/qquickanimation.cpp4
11 files changed, 22 insertions, 41 deletions
diff --git a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
index 7017f1bcb6..3c487ada2a 100644
--- a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
@@ -52,7 +52,7 @@ FocusScope {
Rectangle {
id: rectangle
anchors.centerIn: parent
- color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent }
focus: true
Keys.onPressed: {
diff --git a/src/quick/doc/snippets/qml/focus/MyWidget.qml b/src/quick/doc/snippets/qml/focus/MyWidget.qml
index 5899b18ae0..591dbd6235 100644
--- a/src/quick/doc/snippets/qml/focus/MyWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyWidget.qml
@@ -43,7 +43,7 @@ import QtQuick 2.0
//! [mywidget]
Rectangle {
id: widget
- color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent}
focus: true
Keys.onPressed: {
diff --git a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
index f568c39a32..0eb992f277 100644
--- a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
+++ b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
@@ -51,7 +51,7 @@ FocusScope {
Rectangle {
id: rectangle
anchors.centerIn: parent
- color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true
Text { id: label; anchors.centerIn: parent }
focus: true
Keys.onPressed: {
diff --git a/src/quick/doc/snippets/qml/propertyaction.qml b/src/quick/doc/snippets/qml/propertyaction.qml
index 5ddef30177..20208d95ce 100644
--- a/src/quick/doc/snippets/qml/propertyaction.qml
+++ b/src/quick/doc/snippets/qml/propertyaction.qml
@@ -74,9 +74,9 @@ Row {
//![standalone]
SequentialAnimation {
- PropertyAction { target: img; property: "smooth"; value: "true" }
+ PropertyAction { target: img; property: "opacity"; value: .5 }
NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
- PropertyAction { target: img; property: "smooth"; value: "false" }
+ PropertyAction { target: img; property: "opacity"; value: 1 }
}
//![standalone]
}
diff --git a/src/quick/doc/snippets/qml/rotation.qml b/src/quick/doc/snippets/qml/rotation.qml
index c7f9df3a9b..2886f68b97 100644
--- a/src/quick/doc/snippets/qml/rotation.qml
+++ b/src/quick/doc/snippets/qml/rotation.qml
@@ -48,22 +48,18 @@ Row {
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
- smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
- smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
- smooth: true
}
Image {
source: "pics/qt.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
- smooth: true
}
}
//! [0]
diff --git a/src/quick/doc/snippets/qml/rotationanimation.qml b/src/quick/doc/snippets/qml/rotationanimation.qml
index caa1ce8207..7fc081ebdf 100644
--- a/src/quick/doc/snippets/qml/rotationanimation.qml
+++ b/src/quick/doc/snippets/qml/rotationanimation.qml
@@ -48,7 +48,7 @@ Item {
id: rect
width: 150; height: 100; anchors.centerIn: parent
color: "red"
- smooth: true
+ antialiasing: true
states: State {
name: "rotated"
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index bb15f3623b..8258dbadb8 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -140,11 +140,7 @@ QT_BEGIN_NAMESPACE
The \l{declarative/imageelements/borderimage}{BorderImage example} shows how a BorderImage
can be used to simulate a shadow effect on a rectangular item.
- \section1 Quality and Performance
-
- By default, any scaled regions of the image are rendered without smoothing to improve
- rendering speed. Setting the \l smooth property improves rendering quality of scaled
- regions, but may slow down rendering.
+ \section1 Image Loading
The source image may not be loaded instantaneously, depending on its original location.
Loading progress can be monitored with the \l progress property.
@@ -205,16 +201,12 @@ QQuickBorderImage::~QQuickBorderImage()
/*!
\qmlproperty bool QtQuick2::BorderImage::smooth
- Set this property if you want the image to be smoothly filtered when scaled or
- transformed. Smooth filtering gives better visual quality, but is slower. If
- the image is displayed at its natural size, this property has no visual or
- performance effect.
-
- By default, this property is set to false.
+ This property holds whether the image is smoothly filtered when scaled or
+ transformed. Smooth filtering gives better visual quality, but it may be slower
+ on some hardware. If the image is displayed at its natural size, this property
+ has no visual or performance effect.
- \note Generally scaling artifacts are only visible if the image is stationary on
- the screen. A common pattern when animating an image is to disable smooth
- filtering at the beginning of the animation and enable it at the conclusion.
+ By default, this property is set to true.
*/
/*!
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp
index 8b0392f403..44aa9734b2 100644
--- a/src/quick/items/qquickimage.cpp
+++ b/src/quick/items/qquickimage.cpp
@@ -199,7 +199,6 @@ void QQuickImagePrivate::setImage(const QImage &image)
\qml
Image {
width: 130; height: 100
- smooth: true
source: "qtlogo.png"
}
\endqml
@@ -211,7 +210,6 @@ void QQuickImagePrivate::setImage(const QImage &image)
Image {
width: 130; height: 100
fillMode: Image.PreserveAspectFit
- smooth: true
source: "qtlogo.png"
}
\endqml
@@ -223,7 +221,6 @@ void QQuickImagePrivate::setImage(const QImage &image)
Image {
width: 130; height: 100
fillMode: Image.PreserveAspectCrop
- smooth: true
source: "qtlogo.png"
clip: true
}
@@ -247,7 +244,6 @@ void QQuickImagePrivate::setImage(const QImage &image)
Image {
width: 120; height: 120
fillMode: Image.TileVertically
- smooth: true
source: "qtlogo.png"
}
\endqml
@@ -259,7 +255,6 @@ void QQuickImagePrivate::setImage(const QImage &image)
Image {
width: 120; height: 120
fillMode: Image.TileHorizontally
- smooth: true
source: "qtlogo.png"
}
\endqml
@@ -360,14 +355,12 @@ qreal QQuickImage::paintedHeight() const
/*!
\qmlproperty bool QtQuick2::Image::smooth
- Set this property if you want the image to be smoothly filtered when scaled or
- transformed. Smooth filtering gives better visual quality, but is slower. If
- the image is displayed at its natural size, this property has no visual or
- performance effect.
+ This property holds whether the image is smoothly filtered when scaled or
+ transformed. Smooth filtering gives better visual quality, but it may be slower
+ on some hardware. If the image is displayed at its natural size, this property has
+ no visual or performance effect.
- \note Generally scaling artifacts are only visible if the image is stationary on
- the screen. A common pattern when animating an image is to disable smooth
- filtering at the beginning of the animation and reenable it at the conclusion.
+ By default, this property is set to true.
*/
/*!
diff --git a/src/quick/items/qquickshadereffectmesh.cpp b/src/quick/items/qquickshadereffectmesh.cpp
index c2c76439b2..113332f162 100644
--- a/src/quick/items/qquickshadereffectmesh.cpp
+++ b/src/quick/items/qquickshadereffectmesh.cpp
@@ -185,7 +185,6 @@ QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, const QVector
property variant source: Image {
source: "qt-logo.png"
sourceSize { width: 200; height: 200 }
- smooth: true
}
vertexShader: "
uniform highp mat4 qt_Matrix;
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index d2a1ad2590..65a6cdc3fe 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -531,8 +531,9 @@ QImage QQuickShaderEffectTexture::toImage() const
which is the case for most embedded graphics chips, edges rendered
inside a ShaderEffectSource will not be antialiased. One way to remedy
this is to double the size of the effect source and render it with
- \c {smooth: true}. This will be equivalent to 4x multisampling, at
- the cost of lower performance and higher memory use.
+ \c {smooth: true} (this is the default value of smooth).
+ This will be equivalent to 4x multisampling, at the cost of lower performance
+ and higher memory use.
\warning In most cases, using a ShaderEffectSource will decrease
performance, and in all cases, it will increase video memory usage.
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 34a70ca3c0..bb7b451808 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1000,8 +1000,8 @@ QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &action
It is useful for setting non-animated property values during an animation.
For example, here is a SequentialAnimation that sets the image's
- \l {Image::}{smooth} property to \c true, animates the width of the image,
- then sets \l {Image::}{smooth} back to \c false:
+ \l {Item::}{opacity} property to \c .5, animates the width of the image,
+ then sets \l {Item::}{opacity} back to \c 1:
\snippet qml/propertyaction.qml standalone