changed private hing ahsh type

This commit is contained in:
Patrick von Reth 2014-01-19 16:47:03 +01:00
parent 0a4093ecda
commit 7e0d97a960
2 changed files with 5 additions and 5 deletions

View File

@ -60,16 +60,16 @@ bool Hint::contains(const QString &key) const
void Hint::setPrivateValue(const void *owner, const QString &key, const QVariant &value) 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<const void*,QString>(owner,key), value);
} }
QVariant Hint::privateValue(const void *owner, const QString &k, const QVariant &defaultValue) const 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<const void*,QString> key(owner,k);
if(m_privateData.contains(key)) if(m_privateData.contains(key))
{ {
return m_privateData[key]; return m_privateData.value(key);
} }
else 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 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<const void*,QString>(owner,key));
} }

View File

@ -45,7 +45,7 @@ public:
private: private:
QVariantHash m_data; QVariantHash m_data;
QVariantHash m_privateData; QHash<QPair<const void*,QString>, QVariant> m_privateData;
}; };