'Acces element of QVector pointer containing pointers
I have the following QVector pointer:
QVector<someStruct*>* qvp;
How can I acces someStruct
members? Let's assume that qvp
has some elements to access allocated eralier. I am trying to do:
qvp[index]->someStructObject->member
but compiler doesn't allow that.
However, I can do: qvp->last()->someStructObject->member
as well as qvp->at(index)->someStructObject->member
, why?
This would work if qvp
was:
QVector<someStruct*>& qvp;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|