summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-19 05:05:50 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-19 05:05:50 (GMT)
commit0958910671d9e792c3e2b419cb71d5568c93aee2 (patch)
tree85080b2cbee7ae5fb76d934b4e76b8645549767a /src/gui/painting
parent76aa88cef4000ae7c635611dd78467195a9f8997 (diff)
parentcd62795fc3282e34d0f37c935a5ec1c45e4eb483 (diff)
downloadQt-0958910671d9e792c3e2b419cb71d5568c93aee2.zip
Qt-0958910671d9e792c3e2b419cb71d5568c93aee2.tar.gz
Qt-0958910671d9e792c3e2b419cb71d5568c93aee2.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (151 commits) Skip until after CI succeeds Fixed install of qml imports when doing a vcproj build. Disable tests temporarily Remove warnings Add missing semicolons. moc was confused and positionViewAtIndex not invokable. Use the correct base URL in resolveUri Remove timing sensitivity. Optimize id checking. Fix examples after 47fb07c9fdf47584ae55f3412102bbeef5576b04. Don't use QScriptValueIterator to iterate over arrays. Skip test, to be fixed. Only release the binding once we're finished with its memory Make it harder to accidentally delete a binding Adjust test now that redundant contexts are not create due Block modifications to internal QDeclarativeContexts Don't destroy cookie jar until while someone may be using it. Fix tests after 47fb07c9fdf47584ae55f3412102bbeef5576b04. Another fix to find Improve implicit "." import Fix auto test ...
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qregion.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index bea2b6e..bfeef72 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -704,28 +704,13 @@ bool QRegion::intersects(const QRegion &region) const
}
/*!
+ \fn bool QRegion::intersects(const QRect &rect) const
\since 4.2
Returns true if this region intersects with \a rect, otherwise
returns false.
*/
-bool QRegion::intersects(const QRect &rect) const
-{
- if (isEmpty() || rect.isNull())
- return false;
- const QRect r = rect.normalized();
- if (!rect_intersects(boundingRect(), r))
- return false;
- if (rectCount() == 1)
- return true;
-
- const QVector<QRect> myRects = rects();
- for (QVector<QRect>::const_iterator it = myRects.constBegin(); it < myRects.constEnd(); ++it)
- if (rect_intersects(r, *it))
- return true;
- return false;
-}
#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN)
/*!
@@ -4349,5 +4334,24 @@ bool QRegion::operator==(const QRegion &r) const
return EqualRegion(d->qt_rgn, r.d->qt_rgn);
}
+bool QRegion::intersects(const QRect &rect) const
+{
+ if (isEmptyHelper(d->qt_rgn) || rect.isNull())
+ return false;
+
+ const QRect r = rect.normalized();
+ if (!rect_intersects(d->qt_rgn->extents, r))
+ return false;
+ if (d->qt_rgn->numRects == 1)
+ return true;
+
+ const QVector<QRect> myRects = rects();
+ for (QVector<QRect>::const_iterator it = myRects.constBegin(); it < myRects.constEnd(); ++it)
+ if (rect_intersects(r, *it))
+ return true;
+ return false;
+}
+
+
#endif
QT_END_NAMESPACE