/* NOTE: ownership of 'value' is transferred to the QDict  */
void qdict_put_obj(QDict *qdict, const char *key, QObject *value)
/* NOTE: ownership of 'value' is transferred to the QDict  */
void qdict_put_obj(QDict *qdict, const char *key, QObject *value)
{
    unsigned int bucket;
    QDictEntry *entry;
    bucket = tdb_hash(key) % QDICT_BUCKET_MAX;
    entry = qdict_find(qdict, key, bucket);
    if (entry) {
        qobject_decref(entry->value);
        entry->value = value;
    } else {
        entry = alloc_entry(key, value);
        QLIST_INSERT_HEAD(&qdict->table[bucket], entry, next);
        qdict->size++;
    }
}