Hello,
I would like to know how to modify a key associated with a value.
QHash<QString,Packet*> hash; Packet being my class object.
I have initially created the keys with empty objects. The hash consists of 5 items but i would like to modify the values for a particular key. I have tried the below but it sets the value for all keys.
Qt Code:
if(hash.contains(s_ip)) { QList<Packet*> pkt = hash.values(); QListIterator<Packet*> i(pkt); while (i.hasNext()){ Packet *temp = i.next(); temp->setLength(len);To copy to clipboard, switch view to plain text mode
Bookmarks