diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-05 03:51:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-05 03:51:20 (GMT) |
commit | c06a5b4459a50716e4d41183fa9c2fd39d605c3e (patch) | |
tree | 64da64d7b133667adb13f9555069ffe16b38b429 | |
parent | 64a6d6dafbf313a9cd1db03045230187c6c547d5 (diff) | |
parent | 3e6a330d2aa6f139347fe29947721368a5186cc3 (diff) | |
download | Qt-c06a5b4459a50716e4d41183fa9c2fd39d605c3e.zip Qt-c06a5b4459a50716e4d41183fa9c2fd39d605c3e.tar.gz Qt-c06a5b4459a50716e4d41183fa9c2fd39d605c3e.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Update documentation with warning about setForwardOnly
Make the star example recreate its path if the VG context is destroyed.
Image drawing in OpenVG was off by 0.5 of a pixel
-rw-r--r-- | examples/openvg/star/starwidget.cpp | 5 | ||||
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 23 | ||||
-rw-r--r-- | src/sql/kernel/qsqlquery.cpp | 3 | ||||
-rw-r--r-- | src/sql/kernel/qsqlresult.cpp | 3 |
4 files changed, 23 insertions, 11 deletions
diff --git a/examples/openvg/star/starwidget.cpp b/examples/openvg/star/starwidget.cpp index bde0719..794ede9 100644 --- a/examples/openvg/star/starwidget.cpp +++ b/examples/openvg/star/starwidget.cpp @@ -93,8 +93,9 @@ void StarWidget::paintEvent(QPaintEvent *) // and prepare to perform raw OpenVG calls. painter.beginNativePainting(); - // Cache the path if we haven't already. - if (path == VG_INVALID_HANDLE) { + // Cache the path if we haven't already or if the path has + // become invalid because the window's context has changed. + if (path == VG_INVALID_HANDLE || !vgGetPathCapabilities(path)) { path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, // scale diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index c46bc27..4a97a6f 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -516,14 +516,11 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) 0.0f, -1.0f, 0.0f, 0.5f, devh + 0.5f, 1.0f); - // The image transform is always the full transformation, - // because it can be projective. - imageTransform = transform * viewport; - - // Determine if the transformation is projective. - bool projective = (imageTransform.m13() != 0.0f || - imageTransform.m23() != 0.0f || - imageTransform.m33() != 1.0f); + // Compute the path transform and determine if it is projective. + pathTransform = transform * viewport; + bool projective = (pathTransform.m13() != 0.0f || + pathTransform.m23() != 0.0f || + pathTransform.m33() != 1.0f); if (projective) { // The engine cannot do projective path transforms for us, // so we will have to convert the co-ordinates ourselves. @@ -531,11 +528,19 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) pathTransform = viewport; simpleTransform = false; } else { - pathTransform = imageTransform; simpleTransform = true; } pathTransformSet = false; + // The image transform is always the full transformation, + // because it can be projective. It also does not need the + // (0.5, -0.5) translation because vgDrawImage() implicitly + // adds 0.5 to each co-ordinate. + QTransform viewport2(1.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + 0.0f, devh, 1.0f); + imageTransform = transform * viewport2; + // Calculate the scaling factor to use for turning cosmetic pens // into ordinary non-cosmetic pens. qt_scaleForTransform(transform, &penScale); diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index 430cf1a..f253c82 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -822,6 +822,9 @@ bool QSqlQuery::isForwardOnly() const scrollable. isForwardOnly() will always return the correct status of the result set. + \note Calling setForwardOnly after execution of the query will result + in unexpected results at best, and crashes at worst. + \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly() */ void QSqlQuery::setForwardOnly(bool forward) diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 0c0c31c..6382b42 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -564,6 +564,9 @@ bool QSqlResult::isForwardOnly() const scrollable. isForwardOnly() will always return the correct status of the result set. + \note Calling setForwardOnly after execution of the query will result + in unexpected results at best, and crashes at worst. + \sa isForwardOnly(), fetchNext(), QSqlQuery::setForwardOnly() */ void QSqlResult::setForwardOnly(bool forward) |