summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-07-21 02:21:22 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-07-21 05:30:23 (GMT)
commit640cf6e66f71859632e21da131e5546876487954 (patch)
tree7f65e72c92714c8d811a87355e8bd5d5eabb2c34
parent6a935c95acfe2e4d0f718131e9bf643b918d5c84 (diff)
QList<QPointF> -> QVector<QPointF>
-rw-r--r--src/bindings/python/sip/BillboardGraphicsItem.sip2
-rw-r--r--src/bindings/python/sip/ScreenGraphicsItem.sip2
-rw-r--r--src/lib/marble/ClipPainter.cpp10
-rw-r--r--src/lib/marble/PopupItem.cpp4
-rw-r--r--src/lib/marble/graphicsview/BillboardGraphicsItem.cpp8
-rw-r--r--src/lib/marble/graphicsview/BillboardGraphicsItem.h2
-rw-r--r--src/lib/marble/graphicsview/MarbleGraphicsItem.cpp4
-rw-r--r--src/lib/marble/graphicsview/MarbleGraphicsItem_p.h4
-rw-r--r--src/lib/marble/graphicsview/ScreenGraphicsItem.cpp2
-rw-r--r--src/lib/marble/graphicsview/ScreenGraphicsItem.h2
-rw-r--r--src/lib/marble/graphicsview/ScreenGraphicsItem_p.h10
-rw-r--r--src/lib/marble/graphicsview/WidgetGraphicsItem.cpp4
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp6
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.h4
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp8
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h8
-rw-r--r--tests/BillboardGraphicsItemTest.cpp4
17 files changed, 42 insertions, 42 deletions
diff --git a/src/bindings/python/sip/BillboardGraphicsItem.sip b/src/bindings/python/sip/BillboardGraphicsItem.sip
index 7ec7f66..ae5a6ee 100644
--- a/src/bindings/python/sip/BillboardGraphicsItem.sip
+++ b/src/bindings/python/sip/BillboardGraphicsItem.sip
@@ -29,7 +29,7 @@ public:
BillboardGraphicsItem ();
Marble::GeoDataCoordinates coordinate () const;
void setCoordinate (const Marble::GeoDataCoordinates& coordinates);
- QList<QPointF> positions () const;
+ QVector<QPointF> positions () const;
QList<QRectF> boundingRects () const;
Qt::Alignment alignment () const;
void setAlignment (Qt::Alignment alignment);
diff --git a/src/bindings/python/sip/ScreenGraphicsItem.sip b/src/bindings/python/sip/ScreenGraphicsItem.sip
index fffebb9..08861ea 100644
--- a/src/bindings/python/sip/ScreenGraphicsItem.sip
+++ b/src/bindings/python/sip/ScreenGraphicsItem.sip
@@ -47,7 +47,7 @@ public:
protected:
virtual bool eventFilter (QObject*, QEvent*);
public:
- QList<QPointF> absolutePositions () const;
+ QVector<QPointF> absolutePositions () const;
};
// ScreenGraphicsItem
diff --git a/src/lib/marble/ClipPainter.cpp b/src/lib/marble/ClipPainter.cpp
index 4aba827..2250fcb 100644
--- a/src/lib/marble/ClipPainter.cpp
+++ b/src/lib/marble/ClipPainter.cpp
@@ -75,7 +75,7 @@ class ClipPainterPrivate
bool isClosed ) const;
- void labelPosition( const QPolygonF & polygon, QVector<QPointF>& labelNodes,
+ void labelPosition(const QPolygonF& polygon, QVector<QPointF>& labelNodes,
LabelPositionFlags labelPositionFlags);
bool pointAllowsLabel( const QPointF& point );
@@ -236,8 +236,8 @@ void ClipPainter::drawPolyline( const QPolygonF & polygon )
}
}
-void ClipPainter::drawPolyline( const QPolygonF & polygon, QVector<QPointF>& labelNodes,
- LabelPositionFlags positionFlags)
+void ClipPainter::drawPolyline(const QPolygonF & polygon, QVector<QPointF>& labelNodes,
+ LabelPositionFlags positionFlags)
{
if ( d->m_doClip ) {
d->initClipRect();
@@ -288,8 +288,8 @@ void ClipPainter::drawPolyline( const QPolygonF & polygon, QVector<QPointF>& lab
}
}
-void ClipPainterPrivate::labelPosition( const QPolygonF & polygon, QVector<QPointF>& labelNodes,
- LabelPositionFlags labelPositionFlags)
+void ClipPainterPrivate::labelPosition(const QPolygonF & polygon, QVector<QPointF>& labelNodes,
+ LabelPositionFlags labelPositionFlags)
{
bool currentAllowsLabel = false;
diff --git a/src/lib/marble/PopupItem.cpp b/src/lib/marble/PopupItem.cpp
index cbf7828..b8eee53 100644
--- a/src/lib/marble/PopupItem.cpp
+++ b/src/lib/marble/PopupItem.cpp
@@ -319,8 +319,8 @@ QWidget* PopupItem::transform( QPoint &point ) const
}
}
- QList<QPointF> widgetPositions = positions();
- QList<QPointF>::const_iterator it = widgetPositions.constBegin();
+ const QVector<QPointF> widgetPositions = positions();
+ QVector<QPointF>::const_iterator it = widgetPositions.constBegin();
for( ; it != widgetPositions.constEnd(); ++it ) {
if ( QRectF( *it, size() ).contains( point ) ) {
point -= it->toPoint();
diff --git a/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp b/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
index 85c5b9e..64d89e5 100644
--- a/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/BillboardGraphicsItem.cpp
@@ -28,12 +28,12 @@ class Q_DECL_HIDDEN BillboardGraphicsItem::Private : public MarbleGraphicsItemPr
{
}
- QList<QPointF> positions() const
+ QVector<QPointF> positions() const override
{
return m_positions;
}
- QList<QPointF> absolutePositions() const
+ QVector<QPointF> absolutePositions() const override
{
return m_positions;
}
@@ -85,7 +85,7 @@ class Q_DECL_HIDDEN BillboardGraphicsItem::Private : public MarbleGraphicsItemPr
}
GeoDataCoordinates m_coordinates;
- QList<QPointF> m_positions;
+ QVector<QPointF> m_positions;
};
BillboardGraphicsItem::BillboardGraphicsItem()
@@ -103,7 +103,7 @@ void BillboardGraphicsItem::setCoordinate( const GeoDataCoordinates &coordinates
p()->m_coordinates = coordinates;
}
-QList<QPointF> BillboardGraphicsItem::positions() const
+QVector<QPointF> BillboardGraphicsItem::positions() const
{
return p()->positions();
}
diff --git a/src/lib/marble/graphicsview/BillboardGraphicsItem.h b/src/lib/marble/graphicsview/BillboardGraphicsItem.h
index 671e950..1b77552 100644
--- a/src/lib/marble/graphicsview/BillboardGraphicsItem.h
+++ b/src/lib/marble/graphicsview/BillboardGraphicsItem.h
@@ -49,7 +49,7 @@ class MARBLE_EXPORT BillboardGraphicsItem : public MarbleGraphicsItem
* an unbound number of elements, including zero, depending on the item's visibility,
* the projection and zoom level.
*/
- QList<QPointF> positions() const;
+ QVector<QPointF> positions() const;
/**
* @brief Returns the absolute screen bounding boxes of the item.
diff --git a/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp b/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
index aa55f52..bf39350 100644
--- a/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/MarbleGraphicsItem.cpp
@@ -117,7 +117,7 @@ bool MarbleGraphicsItem::contains( const QPointF& point ) const
QList<QRectF> MarbleGraphicsItemPrivate::boundingRects() const
{
- const QList<QPointF> positions = this->positions();
+ const QVector<QPointF> positions = this->positions();
QList<QRectF> list;
list.reserve(positions.count());
@@ -237,7 +237,7 @@ bool MarbleGraphicsItem::eventFilter( QObject *object, QEvent *e )
QMouseEvent *event = static_cast<QMouseEvent*> (e);
if( !p()->m_children.isEmpty() ) {
- QList<QPointF> absolutePositions = p()->absolutePositions();
+ const QVector<QPointF> absolutePositions = p()->absolutePositions();
foreach( const QPointF& absolutePosition, absolutePositions ) {
QPoint shiftedPos = event->pos() - absolutePosition.toPoint();
diff --git a/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h b/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
index 9675ad0..d3ee758 100644
--- a/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
+++ b/src/lib/marble/graphicsview/MarbleGraphicsItem_p.h
@@ -69,9 +69,9 @@ class MarbleGraphicsItemPrivate
m_children.remove( child );
}
- virtual QList<QPointF> positions() const = 0;
+ virtual QVector<QPointF> positions() const = 0;
- virtual QList<QPointF> absolutePositions() const = 0;
+ virtual QVector<QPointF> absolutePositions() const = 0;
/**
* @brief Used to get the set of screen bounding rects
diff --git a/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp b/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
index 111c895..cc6ef4b 100644
--- a/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/ScreenGraphicsItem.cpp
@@ -51,7 +51,7 @@ QPointF ScreenGraphicsItem::positivePosition() const
return p()->positivePosition();
}
-QList<QPointF> ScreenGraphicsItem::absolutePositions() const
+QVector<QPointF> ScreenGraphicsItem::absolutePositions() const
{
return p()->absolutePositions();
}
diff --git a/src/lib/marble/graphicsview/ScreenGraphicsItem.h b/src/lib/marble/graphicsview/ScreenGraphicsItem.h
index d347911..51dd90e 100644
--- a/src/lib/marble/graphicsview/ScreenGraphicsItem.h
+++ b/src/lib/marble/graphicsview/ScreenGraphicsItem.h
@@ -79,7 +79,7 @@ class MARBLE_EXPORT ScreenGraphicsItem : public MarbleGraphicsItem
* Positive x-coordinates are counted left-aligned from the left border of the map.
* Positive y-coordinates are counted top-aligned from the top border of the map.
*/
- QList<QPointF> absolutePositions() const;
+ QVector<QPointF> absolutePositions() const;
/**
* Returns the flags of the item.
diff --git a/src/lib/marble/graphicsview/ScreenGraphicsItem_p.h b/src/lib/marble/graphicsview/ScreenGraphicsItem_p.h
index ef14134..3aaaa3e 100644
--- a/src/lib/marble/graphicsview/ScreenGraphicsItem_p.h
+++ b/src/lib/marble/graphicsview/ScreenGraphicsItem_p.h
@@ -38,9 +38,9 @@ class ScreenGraphicsItemPrivate : public MarbleGraphicsItemPrivate
{
}
- QList<QPointF> positions() const
+ QVector<QPointF> positions() const override
{
- QList<QPointF> list;
+ QVector<QPointF> list;
list.append( positivePosition() );
return list;
@@ -63,13 +63,13 @@ class ScreenGraphicsItemPrivate : public MarbleGraphicsItemPrivate
return position;
}
- QList<QPointF> absolutePositions() const
+ QVector<QPointF> absolutePositions() const override
{
if( m_parent == 0 ) {
return positions();
}
- QList<QPointF> parentPositions;
+ QVector<QPointF> parentPositions;
if( ScreenGraphicsItem *screenItem = dynamic_cast<ScreenGraphicsItem*>( m_parent ) ) {
parentPositions = screenItem->absolutePositions();
@@ -80,7 +80,7 @@ class ScreenGraphicsItemPrivate : public MarbleGraphicsItemPrivate
QPointF relativePosition = positivePosition();
- QList<QPointF> absolutePositions;
+ QVector<QPointF> absolutePositions;
absolutePositions.reserve(parentPositions.size());
foreach( const QPointF &point, parentPositions ) {
absolutePositions.append( point + relativePosition );
diff --git a/src/lib/marble/graphicsview/WidgetGraphicsItem.cpp b/src/lib/marble/graphicsview/WidgetGraphicsItem.cpp
index 6be59b9..633f59e 100644
--- a/src/lib/marble/graphicsview/WidgetGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/WidgetGraphicsItem.cpp
@@ -94,10 +94,10 @@ bool WidgetGraphicsItem::eventFilter( QObject *object, QEvent *e )
// Mouse events are forwarded to the underlying widget
QMouseEvent *event = static_cast<QMouseEvent*> ( e );
- QList<QPointF> widgetPositions = absolutePositions();
+ const QVector<QPointF> widgetPositions = absolutePositions();
QRectF widgetItemRect;
QPoint shiftedPos;
- QList<QPointF>::iterator it = widgetPositions.begin();
+ QVector<QPointF>::ConstIterator it = widgetPositions.begin();
bool foundRightPosition = false;
for(; !foundRightPosition && it != widgetPositions.end(); ++it ) {
widgetItemRect = QRectF( *it, size() );
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
index 7f9f508..9327928 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.cpp
@@ -36,10 +36,10 @@ ElevationProfileDataSource::ElevationProfileDataSource( QObject *parent ) :
// nothing to do
}
-QList<QPointF> ElevationProfileDataSource::calculateElevationData( const GeoDataLineString &lineString ) const
+QVector<QPointF> ElevationProfileDataSource::calculateElevationData(const GeoDataLineString &lineString) const
{
// TODO: Don't re-calculate the whole route if only a small part of it was changed
- QList<QPointF> result;
+ QVector<QPointF> result;
qreal distance = 0;
//GeoDataLineString path;
@@ -226,7 +226,7 @@ void ElevationProfileRouteDataSource::requestUpdate()
}
const GeoDataLineString routePoints = m_routingModel->route().path();
- const QList<QPointF> elevationData = calculateElevationData( routePoints );
+ const QVector<QPointF> elevationData = calculateElevationData(routePoints);
emit dataUpdated( routePoints, elevationData );
}
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.h b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.h
index 8814bcd..6f2b708 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.h
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileDataSource.h
@@ -50,10 +50,10 @@ public Q_SLOTS:
Q_SIGNALS:
void sourceCountChanged();
- void dataUpdated( const GeoDataLineString &points, const QList<QPointF> &elevationData );
+ void dataUpdated(const GeoDataLineString &points, const QVector<QPointF> &elevationData);
protected:
- QList<QPointF> calculateElevationData(const GeoDataLineString &lineString) const;
+ QVector<QPointF> calculateElevationData(const GeoDataLineString &lineString) const;
virtual qreal getElevation(const GeoDataCoordinates &coordinates) const = 0;
};
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
index 416e788..645b0f6 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
@@ -504,7 +504,7 @@ bool ElevationProfileFloatItem::eventFilter( QObject *object, QEvent *e )
return AbstractFloatItem::eventFilter(object,e);
}
-void ElevationProfileFloatItem::handleDataUpdate(const GeoDataLineString &points, const QList<QPointF> &eleData)
+void ElevationProfileFloatItem::handleDataUpdate(const GeoDataLineString &points, const QVector<QPointF> &eleData)
{
m_eleData = eleData;
m_points = points;
@@ -571,7 +571,7 @@ void ElevationProfileFloatItem::updateVisiblePoints()
return;
}
-void ElevationProfileFloatItem::calculateStatistics( const QList<QPointF> &eleData )
+void ElevationProfileFloatItem::calculateStatistics(const QVector<QPointF> &eleData)
{
// This basically calculates the important peaks of the moving average filtered elevation and
// calculates the elevation data based on this points.
@@ -717,9 +717,9 @@ void ElevationProfileFloatItem::switchToTrackDataSource(int index)
void ElevationProfileFloatItem::switchDataSource(ElevationProfileDataSource* source)
{
- disconnect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QList<QPointF>)),0,0);
+ disconnect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QVector<QPointF>)),0,0);
m_activeDataSource = source;
- connect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QList<QPointF>)), this, SLOT(handleDataUpdate(GeoDataLineString,QList<QPointF>)));
+ connect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QVector<QPointF>)), this, SLOT(handleDataUpdate(GeoDataLineString,QVector<QPointF>)));
m_activeDataSource->requestUpdate();
}
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
index 42d2f43..61f1240 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h
@@ -94,7 +94,7 @@ protected:
virtual void contextMenuEvent( QWidget *w, QContextMenuEvent *e );
private Q_SLOTS:
- void handleDataUpdate(const GeoDataLineString &points, const QList<QPointF> &eleData);
+ void handleDataUpdate(const GeoDataLineString &points, const QVector<QPointF> &eleData);
void updateVisiblePoints();
void forceRepaint();
void readSettings();
@@ -143,15 +143,15 @@ Q_SIGNALS:
int m_firstVisiblePoint;
int m_lastVisiblePoint;
bool m_zoomToViewport;
- QList<QPointF> m_eleData;
+ QVector<QPointF> m_eleData;
GeoDataLineString m_points;
qreal m_minElevation;
qreal m_maxElevation;
qreal m_gain;
qreal m_loss;
- QList<QPointF> calculateElevationData( const GeoDataLineString &lineString ) const;
- void calculateStatistics( const QList<QPointF> &eleData );
+ QVector<QPointF> calculateElevationData(const GeoDataLineString &lineString) const;
+ void calculateStatistics(const QVector<QPointF> &eleData);
};
diff --git a/tests/BillboardGraphicsItemTest.cpp b/tests/BillboardGraphicsItemTest.cpp
index 5fd38a4..c94c156 100644
--- a/tests/BillboardGraphicsItemTest.cpp
+++ b/tests/BillboardGraphicsItemTest.cpp
@@ -46,7 +46,7 @@ void BillboardGraphicsItemTest::defaultConstructorValues()
// BillboardGraphicsItem
QCOMPARE( item.coordinate(), GeoDataCoordinates() );
QCOMPARE( item.alignment(), Qt::AlignHCenter | Qt::AlignVCenter );
- QCOMPARE( item.positions(), QList<QPointF>() );
+ QCOMPARE( item.positions(), QVector<QPointF>() );
QCOMPARE( item.boundingRects(), QList<QRectF>() );
}
@@ -62,7 +62,7 @@ void BillboardGraphicsItemTest::paintEvent()
frameItem.setSize( QSizeF( 11.2, 11.3 ) );
topLayout->addItem( &frameItem, 0, 0 );
- QCOMPARE( item.positions(), QList<QPointF>() );
+ QCOMPARE( item.positions(), QVector<QPointF>() );
QCOMPARE( item.size(), QSizeF() );
QImage paintDevice( 100, 100, QImage::Format_ARGB32_Premultiplied );