QList<QPointF> -> QVector<QPointF>

parent 6a935c95
......@@ -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);
......
......@@ -47,7 +47,7 @@ public:
protected:
virtual bool eventFilter (QObject*, QEvent*);
public:
QList<QPointF> absolutePositions () const;
QVector<QPointF> absolutePositions () const;
};
// ScreenGraphicsItem
......
......@@ -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;
......
......@@ -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();
......
......@@ -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();
}
......
......@@ -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.
......
......@@ -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();
......
......@@ -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
......
......@@ -51,7 +51,7 @@ QPointF ScreenGraphicsItem::positivePosition() const
return p()->positivePosition();
}
QList<QPointF> ScreenGraphicsItem::absolutePositions() const
QVector<QPointF> ScreenGraphicsItem::absolutePositions() const
{
return p()->absolutePositions();
}
......
......@@ -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.
......
......@@ -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 );
......
......@@ -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() );
......
......@@ -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 );
}
......
......@@ -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;
};
......
......@@ -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();
}
......
......@@ -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);
};
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment