hi,
How to use auto pointer in qmap.
I tried giving like QMap<qint32, auto_Ptr Name> m_xxx; .But it gives error.
hi,
How to use auto pointer in qmap.
I tried giving like QMap<qint32, auto_Ptr Name> m_xxx; .But it gives error.
hi, could you paste error you had?
and what do you mean by auto pointer? is it QPointer? Or maybe it is some data type not from qt?
See GrEEn (Graphics Effects Environment)
http://sourceforge.net/project/platf...roup_id=232746
a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).
First of all, get used to a habit of pasting errors you get. We are not mind-readers..
Secondly, "QMap<qint32, auto_Ptr Name>" is not valid C++. Try to be exact what you write because, again, we cannot guess if you actually wrote for example "QMap<qint32, auto_ptr<Name> >". Anyway, in case you mean std::auto_ptr, you cannot use it in containers. There are solutions like "counted_ptr" which can be used in containers.
J-P Nurmi
I created auto pointer and wanted to use it like this..
typedef std::auto_ptr<IBaureihe> IBaureihePtr;
IBaureihePtr create_IBaureihe();
QMap<qint32, IBaureihePtr>::iterator lIter
Errors that i get
d:/Qt/4.3.0/src/corelib/tools/qhash.h: In constructor `QHashNode<int,
T>::QHashNode(int, const T&) [with T = LaufwegSbFr::IDSOrgaPtr]':
d:/Qt/4.3.0/src/corelib/tools/qhash.h:93: instantiated from `static void QHash<Key, T>::duplicat
ode(QHashData::Node*, void*) [with Key = qint32, T = LaufwegSbFr::IDSOrgaPtr]'
d:/Qt/4.3.0/src/corelib/tools/qhash.h:535: instantiated from `void QHash<Key, T>::detach_helper(
[with Key = qint32, T = LaufwegSbFr::IDSOrgaPtr]'
d:/Qt/4.3.0/src/corelib/tools/qhash.h:551: instantiated from `QHash<Key, T>& QHash<Key, T>:per
or=(const QHash<Key, T>&) [with Key = qint32, T = LaufwegSbFr::IDSOrgaPtr]'
GlobalLaufwegImpl.cpp:528: instantiated from `void QHash<Key, T>::clear() [with Key = qint32, T
LaufwegSbFr::IDSOrgaPtr]'
GlobalLaufwegImpl.cpp:21: instantiated from here
d:/Qt/4.3.0/src/corelib/tools/qhash.h:215: passing `const
LaufwegSbFr::IDSOrgaPtr' as `this' argument of `std::auto_ptr<_Tp>:perator
std::auto_ptr_ref<_Tp1>() [with _Tp1 = LaufwegSbFr::IDSOrga, _Tp =
LaufwegSbFr::IDSOrga]' discards qualifiers
You're putting variable name instead of type try with
Qt Code:
QMap<qint32, std::auto_ptr<IBaureihe> >::iterator lIterTo copy to clipboard, switch view to plain text mode
See GrEEn (Graphics Effects Environment)
http://sourceforge.net/project/platf...roup_id=232746
a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).
Bookmarks