我有一个gsettings模式,其键类型为 a{ss} 。我想将所述密钥绑定到对象上的属性。我已成功使用 g_settings_bind 和 g_settings_bind_with_mapping 使用其他键,但我不知道要将此键映射到什么类型。这个 GVariant 是一个包含键字符串和值字符串的字典数组,但这是什么累计glib类型?
a{ss}
g_settings_bind
g_settings_bind_with_mapping
GVariant
您需要使用 g_settings_bind_with_mapping() 自从 a{ss} 是 not supported by g_settings_bind() 。 a{ss} 是一个将字符串映射到字符串的字典,我可能会用GLib将其表示为 GHashTable 将字符串映射到字符串。
g_settings_bind_with_mapping()
g_settings_bind()
GHashTable