summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-07-21 02:23:41 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-07-21 05:30:24 (GMT)
commit096107254f80e56a7442716ca42ec6164fb5d0f9 (patch)
tree0d70a770b658a6a6fbcb64f348ba3933ef5ee1f9
parent640cf6e66f71859632e21da131e5546876487954 (diff)
QList<QRectF> -> QVector<QRectF>
-rw-r--r--src/bindings/python/sip/BillboardGraphicsItem.sip2
-rw-r--r--src/lib/marble/graphicsview/BillboardGraphicsItem.cpp4
-rw-r--r--src/lib/marble/graphicsview/BillboardGraphicsItem.h2
-rw-r--r--src/lib/marble/graphicsview/MarbleGraphicsItem.cpp6
-rw-r--r--src/lib/marble/graphicsview/MarbleGraphicsItem_p.h2
-rw-r--r--tests/BillboardGraphicsItemTest.cpp2
6 files changed, 9 insertions, 9 deletions
diff --git a/src/bindings/python/sip/BillboardGraphicsItem.sip b/src/bindings/python/sip/BillboardGraphicsItem.sip
index ae5a6ee..975a9b6 100644
--- a/src/bindings/python/sip/BillboardGraphicsItem.sip
+++ b/src/bindings/python/sip/BillboardGraphicsItem.sip
@@ -30,7 +30,7 @@ public:
Marble::GeoDataCoordinates coordinate () const;
void setCoordinate (const Marble::GeoDataCoordinates& coordinates);
QVector<QPointF> positions () const;
- QList<QRectF> boundingRects () const;
+ QVector<QRectF> boundingRects () const;
Qt::Alignment alignment () const;
void setAlignment (Qt::Alignment alignment);
QRectF containsRect (const QPointF& point) const;
diff --git a/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp b/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
index 64d89e5..c4e7a7c 100644
--- a/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
@@ -108,9 +108,9 @@ QVector<QPointF> BillboardGraphicsItem::positions() const
return p()->positions();
}
-QList<QRectF> BillboardGraphicsItem::boundingRects() const
+QVector<QRectF> BillboardGraphicsItem::boundingRects() const
{
- QList<QRectF> rects;
+ QVector<QRectF> rects;
rects.reserve(p()->m_positions.size());
QSizeF const size = p()->m_size;
diff --git a/src/lib/marble/graphicsview/BillboardGraphicsItem.h b/src/lib/marble/graphicsview/BillboardGraphicsItem.h
index 1b77552..367d89d 100644
--- a/src/lib/marble/graphicsview/BillboardGraphicsItem.h
+++ b/src/lib/marble/graphicsview/BillboardGraphicsItem.h
@@ -54,7 +54,7 @@ class MARBLE_EXPORT BillboardGraphicsItem : public MarbleGraphicsItem
/**
* @brief Returns the absolute screen bounding boxes of the item.
*/
- QList<QRectF> boundingRects() const;
+ QVector<QRectF> boundingRects() const;
/**
* Returns the rect of one representation of the object that is at the given position.
diff --git a/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp b/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
index bf39350..03553f6 100644
--- a/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
@@ -115,11 +115,11 @@ bool MarbleGraphicsItem::contains( const QPointF& point ) const
return false;
}
-QList<QRectF> MarbleGraphicsItemPrivate::boundingRects() const
+QVector<QRectF> MarbleGraphicsItemPrivate::boundingRects() const
{
const QVector<QPointF> positions = this->positions();
- QList<QRectF> list;
+ QVector<QRectF> list;
list.reserve(positions.count());
foreach (const QPointF &point, positions) {
@@ -244,7 +244,7 @@ bool MarbleGraphicsItem::eventFilter( QObject *object, QEvent *e )
if ( QRect( QPoint( 0, 0 ), size().toSize() ).contains( shiftedPos ) ) {
foreach( MarbleGraphicsItem *child, p()->m_children ) {
- QList<QRectF> childRects = child->d->boundingRects();
+ const QVector<QRectF> childRects = child->d->boundingRects();
foreach( const QRectF& childRect, childRects ) {
if( childRect.toRect().contains( shiftedPos ) ) {
diff --git a/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h b/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
index d3ee758..f9a6b35 100644
--- a/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
+++ b/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
@@ -76,7 +76,7 @@ class MarbleGraphicsItemPrivate
/**
* @brief Used to get the set of screen bounding rects
*/
- QList<QRectF> boundingRects() const;
+ QVector<QRectF> boundingRects() const;
virtual void setProjection( const ViewportParams *viewport ) = 0;
diff --git a/tests/BillboardGraphicsItemTest.cpp b/tests/BillboardGraphicsItemTest.cpp
index c94c156..cec8ac9 100644
--- a/tests/BillboardGraphicsItemTest.cpp
+++ b/tests/BillboardGraphicsItemTest.cpp
@@ -47,7 +47,7 @@ void BillboardGraphicsItemTest::defaultConstructorValues()
QCOMPARE( item.coordinate(), GeoDataCoordinates() );
QCOMPARE( item.alignment(), Qt::AlignHCenter | Qt::AlignVCenter );
QCOMPARE( item.positions(), QVector<QPointF>() );
- QCOMPARE( item.boundingRects(), QList<QRectF>() );
+ QCOMPARE( item.boundingRects(), QVector<QRectF>() );
}
void BillboardGraphicsItemTest::paintEvent()