diff --git a/src/core/hint.cpp b/src/core/hint.cpp index 41e6cac..dbbb297 100644 --- a/src/core/hint.cpp +++ b/src/core/hint.cpp @@ -60,16 +60,16 @@ bool Hint::contains(const QString &key) const void Hint::setPrivateValue(const void *owner, const QString &key, const QVariant &value) { - m_privateData[QString("%1-%2").arg(QString::number((quintptr)owner),key)] = value; + m_privateData.insert(QPair(owner,key), value); } QVariant Hint::privateValue(const void *owner, const QString &k, const QVariant &defaultValue) const { - QString key(QString("%1-%2").arg(QString::number((quintptr)owner),k)); + QPair key(owner,k); if(m_privateData.contains(key)) { - return m_privateData[key]; + return m_privateData.value(key); } else { @@ -80,5 +80,5 @@ QVariant Hint::privateValue(const void *owner, const QString &k, const QVariant bool Hint::containsPrivateValue(const void *owner, const QString &key) const { - return m_privateData.contains(QString("%1-%2").arg(QString::number((quintptr)owner),key)); + return m_privateData.contains(QPair(owner,key)); } diff --git a/src/core/hint.h b/src/core/hint.h index fa2b82e..7c56b17 100644 --- a/src/core/hint.h +++ b/src/core/hint.h @@ -45,7 +45,7 @@ public: private: QVariantHash m_data; - QVariantHash m_privateData; + QHash, QVariant> m_privateData; };