gpt4 book ai didi

c++ - 如何显示存储在 QList 中的 QPointF?

转载 作者:太空宇宙 更新时间:2023-11-04 15:20:42 25 4
gpt4 key购买 nike

QList <QPointF> markers;
markers.append (QPointF (getLat (), getLon ()));


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

给我:

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

最佳答案

您可以使用 qDebug() .

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

记得包含QDebug:

#include <QDebug>

关于c++ - 如何显示存储在 QList 中的 QPointF?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19996579/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com