使用此代码:
size = 100;
uint64_t work;
row.get_value(3, work);
cout << "value was " << work << endl;
work += size;
cout << "value set to " << work << endl;
row.set_value(3, work);
row.get_value(3, work);
cout << "value now " << work << endl;
我期待这个输出:
value was 0
value set to 100
value now 100
但我明白了:
value was 0
value set to 100
value now 0
更新后的值100在树视图小部件中正确显示,我无法用get_value读取它。我做错了什么?
答案 0 :(得分:1)
原来问题是uint64_t; row [3]被定义为(在Glade中)作为guint,工作变量必须与该类型完全匹配,否则get_value将不起作用。