Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Qt QVector-我可以通过引用更改元素中的值吗?_C++_Qt - Fatal编程技术网

C++ Qt QVector-我可以通过引用更改元素中的值吗?

C++ Qt QVector-我可以通过引用更改元素中的值吗?,c++,qt,C++,Qt,我有一个 QVector<structure> m_vector; 更改对整个m_向量有效吗?是的,这应该按照您期望的方式工作。我不是故意粗鲁,但这不是很容易测试您自己吗?也许我不理解这个问题。老实说,你是对的,但是我的应用程序现在是高度嵌套的,所以测试它并不容易。此外,我编译没有IDE,所以如果有人有正确的答案,可以节省我很多时间 m_vector[4].another_vector[9].another_vector[2].field_in_the_structure = 2;

我有一个

QVector<structure> m_vector;

更改对整个m_向量有效吗?

是的,这应该按照您期望的方式工作。

我不是故意粗鲁,但这不是很容易测试您自己吗?也许我不理解这个问题。老实说,你是对的,但是我的应用程序现在是高度嵌套的,所以测试它并不容易。此外,我编译没有IDE,所以如果有人有正确的答案,可以节省我很多时间
m_vector[4].another_vector[9].another_vector[2].field_in_the_structure = 2;