summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-17 02:29:31 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-17 02:29:31 (GMT)
commit349df5c1ec50fde17a2dbf94af64ed76c55d7aaf (patch)
treea5fe4490baad4a02dff6b91208ea5a0b7a53d98d /src/gui
parent53fd1e2fd9c75d7d55606d4ac5df75eda96b9cc9 (diff)
parentd8aaf0f1823e1bcbfb687ac964187332b5c90259 (diff)
downloadQt-349df5c1ec50fde17a2dbf94af64ed76c55d7aaf.zip
Qt-349df5c1ec50fde17a2dbf94af64ed76c55d7aaf.tar.gz
Qt-349df5c1ec50fde17a2dbf94af64ed76c55d7aaf.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: (112 commits) Verbose unexpected errors. One url for an *unqualilfied* import is not special. Fix test failures Optimization: Don't unnecessarily run VMEStack element constructors Optimization: Reduce unnecessary QObject allocations Reset QDeclarativeDeclarativeData::outerContext when the context is removed Simplify QDeclarativeComponent::creationContext() logic Optimization: Use id notifier for QtScript bindings Optimization: Combine QDeclarativeDeclarativeData and QObject allocations Fixes for the module import Fix documentation add alan's tic-tac-toe AI Remove test in .pro file also Remove unneeded #include and add needed header to .pri Add easing changes to QmlChanges.txt Update more animation on property value source docs. Doc fixes. QmlChanges.txt cleanup. Remove WorkerListModel and integrate its functionality into ListModel. Split post alpha API changes into a separate section. ...
Diffstat (limited to 'src/gui')
-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