简体   繁体   English

使用GSettings时,{ss}应该映射到哪种GLib类型?

[英]What GLib type should a{ss} map to when using GSettings?

I have a gsettings schema with a key of type a{ss} . 我有一个gsettings模式,其键类型为a{ss} I would like to bind said key to a property on an object. 我想将所述键绑定到对象的属性。 I have successfully used g_settings_bind and g_settings_bind_with_mapping with other keys but I don't know what type to map this key to. 我已经成功地将g_settings_bindg_settings_bind_with_mapping与其他键一起使用,但是我不知道将此键映射到什么类型。 The GVariant is an array of dictionaries with key string and value string, but what accual glib type is that? GVariant是包含键字符串和值字符串的字典数组,但是那是什么准确的glib类型?

You need to use g_settings_bind_with_mapping() , since a{ss} is not supported by g_settings_bind() . 您需要使用g_settings_bind_with_mapping()因为a{ss}不支持g_settings_bind() a{ss} is a dictionary mapping strings to strings, and I would probably represent it in GLib as a GHashTable mapping strings to strings. a{ss}是将字符串映射为字符串的字典,我可能会在GLib中将其表示为将字符串映射为字符串的GHashTable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM