While we lack informations, it's likely that your QList<Servo *>
is const
.
This could happen if your call was made from a const
method of the class holding the QList
.
Lets see an example:
class MyClass
{
private:
QList<Servo *> m_qlServoList;
public:
void addServo(Servo *ptr) const /* Notice the const here */
{
m_qlServoList.append(prt);
}
};
/* from main */
MyClass c;
c.addServo(new Servo(iID, iBaudRate));
This code wouldn't compile, because the addServo()
method is const
, which means that m_qlServoList
will be considered as a const QList<Servo *>
.