Reputation: 22906
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'
Upvotes: 0
Views: 1838
Reputation: 6584
A foreach loop would be simplier for that:
Q_FOREACH( QPointF p, markers ) {
qDebug() << p;
}
Upvotes: 2
Reputation: 12901
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>
Upvotes: 4
Reputation: 12715
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()
.
Upvotes: 1