Well, is it possible to get value of key if there is a value known from QHash?
Ok, that was another stupid question, it is all in docs ... there is a key() method ...
But, following method:
inline qint16 merchandiseId(const QString& strKey) const
{ return m_strNames.key(strKey).iLanguageId; };
inline qint16 merchandiseId(const QString& strKey) const
{ return m_strNames.key(strKey).iLanguageId; };
To copy to clipboard, switch view to plain text mode
produces following errors:
In file included from CMerchandizeElement.cpp:8:
CMerchandizeElement.h: In member function `qint16 CMerchandizeElement::merchandiseId(const QString&) const':
CMerchandizeElement.h:95: error: no matching function for call to `QHash<qint16, merchandiseLangStruct>::key(const QString&) const'
c:/Qt/4.4.3/include/QtCore/../../src/corelib/tools/qhash.h:652: note: candidates are: const Key QHash<K, V>::key(const T&) const [with Key = qint16, T = merchandiseLangStruct]
c:/Qt/4.4.3/include/QtCore/../../src/corelib/tools/qhash.h:658: note: const Key QHash<K, V>::key(const T&, const Key&) const [with Key = qint16, T = merchandiseLangStruct]
mingw32-make[1]: *** [debug/CMerchandizeElement.o] Error 1
mingw32-make: *** [debug] Error 2
In file included from CMerchandizeElement.cpp:8:
CMerchandizeElement.h: In member function `qint16 CMerchandizeElement::merchandiseId(const QString&) const':
CMerchandizeElement.h:95: error: no matching function for call to `QHash<qint16, merchandiseLangStruct>::key(const QString&) const'
c:/Qt/4.4.3/include/QtCore/../../src/corelib/tools/qhash.h:652: note: candidates are: const Key QHash<K, V>::key(const T&) const [with Key = qint16, T = merchandiseLangStruct]
c:/Qt/4.4.3/include/QtCore/../../src/corelib/tools/qhash.h:658: note: const Key QHash<K, V>::key(const T&, const Key&) const [with Key = qint16, T = merchandiseLangStruct]
mingw32-make[1]: *** [debug/CMerchandizeElement.o] Error 1
mingw32-make: *** [debug] Error 2
To copy to clipboard, switch view to plain text mode
Can someone help me please?
Bookmarks