qt_gotcha
24th January 2011, 10:50
Most posts on this subject go way beyond what I want, and I quickly loose track.
I have a structure
typedef structure LDD_POINT{
int row;
int col;
}LDD_POINT;
in my class I define:
QList <LDD_POINT> *lddlist;
then with each new point in the code:
ldd_point *p = new LDD_POINT;
lddlist->append(p);
which doesn't work:
c:\Qt\2010.05\qt\include\QtCore\..\..\src\corelib\ tools\qlist.h:493: candidates are: void QList<T>::append(const T&) [with T = LDD_POINT]
c:\Qt\2010.05\qt\include\QtCore\..\..\src\corelib\ tools\qlist.h:819: void QList<T>::append(const QList<T>&) [with T = LDD_POINT]
So obviously I am doing something too simple. I don't understand the const T stuff, what is the correct format, or point me to an example...
Thanks
I have a structure
typedef structure LDD_POINT{
int row;
int col;
}LDD_POINT;
in my class I define:
QList <LDD_POINT> *lddlist;
then with each new point in the code:
ldd_point *p = new LDD_POINT;
lddlist->append(p);
which doesn't work:
c:\Qt\2010.05\qt\include\QtCore\..\..\src\corelib\ tools\qlist.h:493: candidates are: void QList<T>::append(const T&) [with T = LDD_POINT]
c:\Qt\2010.05\qt\include\QtCore\..\..\src\corelib\ tools\qlist.h:819: void QList<T>::append(const QList<T>&) [with T = LDD_POINT]
So obviously I am doing something too simple. I don't understand the const T stuff, what is the correct format, or point me to an example...
Thanks