Skip to content

Commit

Permalink
Change smooth to be true by default
Browse files Browse the repository at this point in the history
Change-Id: Ia74a5c76058a2822e61dfa2f7316ea0612ebc15c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
  • Loading branch information
Gunnar Sletta authored and Qt by Nokia committed Mar 22, 2012
1 parent 9d1b013 commit ddff201
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/quick/items/qquickitem.cpp
Expand Up @@ -2387,7 +2387,7 @@ bool QQuickItem::isComponentComplete() const
QQuickItemPrivate::QQuickItemPrivate()
: _anchors(0), _stateGroup(0),
flags(0), widthValid(false), heightValid(false), baselineOffsetValid(false), componentComplete(true),
keepMouse(false), keepTouch(false), hoverEnabled(false), smooth(false), focus(false), activeFocus(false), notifiedFocus(false),
keepMouse(false), keepTouch(false), hoverEnabled(false), smooth(true), focus(false), activeFocus(false), notifiedFocus(false),
notifiedActiveFocus(false), filtersChildMouseEvents(false), explicitVisible(true),
effectiveVisible(true), explicitEnable(true), effectiveEnable(true), polishScheduled(false),
inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
Expand Down Expand Up @@ -4314,13 +4314,15 @@ void QQuickItemPrivate::itemChange(QQuickItem::ItemChange change, const QQuickIt

/*!
\property QQuickItem::smooth
\brief whether the item is smoothly transformed.
\brief whether the item is smoothed or not.
This property is provided purely for the purpose of optimization. Turning
smooth transforms off is faster, but looks worse; turning smooth
transformations on is slower, but looks better.
Primarily used in image based elements to decide if the item should use smooth
sampling or not. Smooth sampling is performed using linear interpolation, while
non-smooth is performed using nearest neighbor.
By default smooth transformations are off.
In Qt Quick 2.0, this property has minimal impact on performance.
By default is true.
*/

/*!
Expand Down
1 change: 1 addition & 0 deletions tests/auto/quick/qquickcanvasitem/data/tst_arc.qml
Expand Up @@ -4,6 +4,7 @@ import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
smooth: false
TestCase {
name: "arc"; when: windowShown
function test_angle_1() {
Expand Down
1 change: 1 addition & 0 deletions tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml
Expand Up @@ -4,6 +4,7 @@ import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
smooth: false
TestCase {
name: "arcTo"; when: windowShown
function test_coincide() {
Expand Down
1 change: 1 addition & 0 deletions tests/auto/quick/qquickcanvasitem/data/tst_path.qml
Expand Up @@ -4,6 +4,7 @@ import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
smooth: false
TestCase {
name: "path"; when: windowShown

Expand Down
1 change: 1 addition & 0 deletions tests/auto/quick/qquickcanvasitem/data/tst_strokeStyle.qml
Expand Up @@ -4,6 +4,7 @@ import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget:Canvas.Image; renderStrategy:Canvas.Threaded
smooth: false
TestCase {
name: "strokeStyle"; when: windowShown
function test_default() {
Expand Down
12 changes: 6 additions & 6 deletions tests/auto/quick/qquicktext/tst_qquicktext.cpp
Expand Up @@ -1071,11 +1071,11 @@ void tst_qquicktext::smooth()
for (int i = 0; i < standard.size(); i++)
{
{
QString componentStr = "import QtQuick 2.0\nText { smooth: true; text: \"" + standard.at(i) + "\" }";
QString componentStr = "import QtQuick 2.0\nText { smooth: false; text: \"" + standard.at(i) + "\" }";
QQmlComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QCOMPARE(textObject->smooth(), true);
QCOMPARE(textObject->smooth(), false);

delete textObject;
}
Expand All @@ -1084,19 +1084,19 @@ void tst_qquicktext::smooth()
QQmlComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QCOMPARE(textObject->smooth(), false);
QCOMPARE(textObject->smooth(), true);

delete textObject;
}
}
for (int i = 0; i < richText.size(); i++)
{
{
QString componentStr = "import QtQuick 2.0\nText { smooth: true; text: \"" + richText.at(i) + "\" }";
QString componentStr = "import QtQuick 2.0\nText { smooth: false; text: \"" + richText.at(i) + "\" }";
QQmlComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QCOMPARE(textObject->smooth(), true);
QCOMPARE(textObject->smooth(), false);

delete textObject;
}
Expand All @@ -1105,7 +1105,7 @@ void tst_qquicktext::smooth()
QQmlComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QCOMPARE(textObject->smooth(), false);
QCOMPARE(textObject->smooth(), true);

delete textObject;
}
Expand Down

0 comments on commit ddff201

Please sign in to comment.