scoutycat
22nd June 2016, 20:48
I have a function,
const QVector<double> & getmData() {return mData;}
I need to pass the return of this function to another function:
processData(QSharedPointer<QVector<double> > data)
I see that there is a function qSharedPointerConstCast(const QSharedPointer<T> &other) that should help me get from const QVector<double> & to QSharedPointer<QVector<double> > , but damned if I can make it work!! Something like...
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QVector<double> >(getmData());
but of course this throws a compile error, " no matching function for call to 'qSharedPointerConstCast(const QVector<double>&)'
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QVector<double> >(getmData());"
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QSharedPointer<QVector<double> >>(iter->second->getmData());
gives a no matching function error
^
const QVector<double> & getmData() {return mData;}
I need to pass the return of this function to another function:
processData(QSharedPointer<QVector<double> > data)
I see that there is a function qSharedPointerConstCast(const QSharedPointer<T> &other) that should help me get from const QVector<double> & to QSharedPointer<QVector<double> > , but damned if I can make it work!! Something like...
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QVector<double> >(getmData());
but of course this throws a compile error, " no matching function for call to 'qSharedPointerConstCast(const QVector<double>&)'
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QVector<double> >(getmData());"
QSharedPointer<QVector<double> > rawData = qSharedPointerConstCast<QSharedPointer<QVector<double> >>(iter->second->getmData());
gives a no matching function error
^