我该如何解决以下问题,即转换const QVector<QVector<qreal>>
为QVector<QVector<qreal>>
?
我尝试了几个步骤但没有帮助:
QVector<QVector<qreal>> points = const_cast<QVector<QVector<qreal>>>(abc.points);
abc.points 是 type 的结构元素QVector<QVector<qreal>>
,我试图从 a 中提取QDataStream
:
QDataStream& operator >> (QDataStream& in, const CustomPointCloud& abc)
{
quint32 pointsCount = quint32(abc.pointsCount);
QVector<QVector<qreal>> points =
const_cast<QVector<QVector<qreal>>>(abc.points);
in >> pointsCount >> points;
return in;
}