0
QList <QPointF> markers; markers.append (QPointF (getLat (), getLon ())); QList <QPointF> :: iterator i; for (i = markers.begin(); i != markers.end(); ++i) std :: cout << *i << endl; 

Gives me:

error: no match for 'operator<<' in 'std::cout << i.QList::iterator::operator* with T = QPointF'

3 Answers 3

4

You can use qDebug().

QList<QPointF> markers; markers.append(getLat(), getLon()); QList<QPointF>::iterator i; for (i = markers.begin(); i != markers.end(); ++i) qDebug() << *i; 

Remember to include QDebug:

#include <QDebug> 
Sign up to request clarification or add additional context in comments.

Comments

2

A foreach loop would be simplier for that:

Q_FOREACH( QPointF p, markers ) { qDebug() << p; } 

Comments

1

AFAIK QPointF class by itself does not have a << overload operator. You can either re-implement it and overload the operator yourself or more simply just try to output the coordinates myPoint.x() and myPoint.y().

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.