QList wrapper
Unsolved
General and Desktop
-
@firen said in QList wrapper:
I read about Q_DISABLE_COPY. Isn`t it mainly for QObject based types?
If you want to copy PointerList <T> then you have to provide a proper copy operator, the one generated by the compiler will not work, therefore Q_DISABLE_COPY.
-
-
It looks like this now:
template <class T> class CPtrListWrapper: public QList<T*> { using Item = T*; public: CPtrListWrapper(): QList(), m_bAutoDelete(false), m_pCurrentItem(nullptr) { } ~CPtrListWrapper() { } //I need to wrap an old Containerclass and want to replace it internally by QList and these is one of the original methods void insert(uint i, const T* d) // { QList::insert(i, d); }
But this gives me an error C2664 if I try:
bas::qtw::CPtrList<QString> m_q5List; const QString* pString = new QString("TEST"); m_q5List.insert(0, pString);
The error is that he cannot convert "const QString *" in "QString *const &"
-
@firen said in QList wrapper:
But this gives me an error C2664 if I try:
Please post the whole error, not just its id.
Also, show the declaration of m_q5List.