QMap/QHash: not remove and not reinsert item.
Hello!
I have completed QMap/QHash.
And I try remove or reinsert value whis a key, , which is already in Map.
But nothing happens.
If I try remove, function return value not equal 0, but in the debugger value remains the same.
- {
- if (!value.isValid())
- return;
- int i = listItem->value(row).remove(lsNameAttr.value(col)); //try remove before inserting
- listItem->value(row).insert(lsNameAttr.value(col), value);
- //work whis BD
- QUERY_COND cond;
- cond.nameAttr = "id";
- cond.sign = "=";
- datasoure.setItemAttr(cond, getName(), lsNameAttr.value(col), value);
- }
3 replies
And what is your problem? From that dump of variable names, we cannot get anything meaningful (we do not know your code).
The best way to present those problems to a forum is to create a test case that demonstrates the erroneous behavior. This usually consists a small, complete, compilable program; most often less more than a main function and one or two small classes. And chances are good that you stumble over the cause of the problem during the process of preparing that test case :-)
You must log in to post a reply. Not a member yet? Register here!


