summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-25 14:10:23 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-25 14:10:23 (GMT)
commit20aba4ffa2fdf7a7306424981049d430f7d88e5c (patch)
treee30e2351dab3d57e468462b45d53f40ce1e39f43
parent39a1a94bfdb7878afb351101aead2fbdcc871a25 (diff)
parent8eaeb1d4415d19a43b20fffe46c2b29fd609bba1 (diff)
downloadQt-20aba4ffa2fdf7a7306424981049d430f7d88e5c.zip
Qt-20aba4ffa2fdf7a7306424981049d430f7d88e5c.tar.gz
Qt-20aba4ffa2fdf7a7306424981049d430f7d88e5c.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Revert changes made in scroll_sys(). Add benchmarks for accessing meta-object properties via QScriptValue
-rw-r--r--src/gui/kernel/qwidget_mac.mm14
-rw-r--r--tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp25
2 files changed, 38 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 9e7517f..f78596e 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4475,8 +4475,20 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
}
}
+ // ### Scroll the dirty regions as well, the following is not correct.
+ QRegion displayRegion = r.isNull() ? dirtyOnWidget : (dirtyOnWidget & r);
+ const QVector<QRect> &rects = dirtyOnWidget.rects();
+ const QVector<QRect>::const_iterator end = rects.end();
+ QVector<QRect>::const_iterator it = rects.begin();
+ while (it != end) {
+ const QRect rect = *it;
+ const NSRect dirtyRect = NSMakeRect(rect.x() + dx, rect.y() + dy,
+ rect.width(), rect.height());
+ [view setNeedsDisplayInRect:dirtyRect];
+ ++it;
+ }
+
NSSize deltaSize = NSMakeSize(dx, dy);
- [view translateRectsNeedingDisplayInRect:scrollRect by:deltaSize];
[view scrollRect:scrollRect by:deltaSize];
[view setNeedsDisplayInRect:deltaXRect];
[view setNeedsDisplayInRect:deltaYRect];
diff --git a/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp b/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
index 3bfc21c..d7bb04b 100644
--- a/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp
@@ -69,6 +69,8 @@ private slots:
void property();
void setProperty();
void propertyFlags();
+ void readMetaProperty();
+ void writeMetaProperty();
};
tst_QScriptValue::tst_QScriptValue()
@@ -201,5 +203,28 @@ void tst_QScriptValue::propertyFlags()
}
}
+void tst_QScriptValue::readMetaProperty()
+{
+ QScriptEngine engine;
+ QScriptValue object = engine.newQObject(QCoreApplication::instance());
+ QScriptString propertyName = engine.toStringHandle("objectName");
+ QBENCHMARK {
+ for (int i = 0; i < 10000; ++i)
+ object.property(propertyName);
+ }
+}
+
+void tst_QScriptValue::writeMetaProperty()
+{
+ QScriptEngine engine;
+ QScriptValue object = engine.newQObject(QCoreApplication::instance());
+ QScriptString propertyName = engine.toStringHandle("objectName");
+ QScriptValue value(&engine, "foo");
+ QBENCHMARK {
+ for (int i = 0; i < 10000; ++i)
+ object.setProperty(propertyName, value);
+ }
+}
+
QTEST_MAIN(tst_QScriptValue)
#include "tst_qscriptvalue.moc"