I am having a struct containing the vector of int and this struct is later used in the class and this is generating a runtime error with the error message,
QObject::connect: cannot queue arguments of type 'QVector' (Make sure 'QVector' is registered using qRegisterMetaType())
struct:
struct Grid {
std::vector<int> indices;
int pt_count{};
Grid()=default;
~Grid()=default;
void add_indice(int _indice) {
indices.push_back(_indice);
pt_count++;
}
};
main.cpp
#include <vector>
#include <struct.h>
int main() {
std::vector<Grid> grids;
grids.resize(5);
for (int i{0}; i < 5; i++){
for (int j {0}; j < 10; j++){
grids.at(i).add_indice(j);
}
}
return 0;
}
why am i getting the error mentioned above? can anybody help with this?
Thank you!
That message is about
QVectorand has nothing to do withstd::vector(at least not at time of writing).Add somewhere (before that error happens, maybe in
main), something like: