Object vector in a qt widget application
-
hello everyone, I'm trying to make a simple widget application like a form, where the user can introduce several data, check if the data is correct and then show it in a list, the thing is that i want that every time the data is correct it gets stored in a vector of objets, the question is how can I "connect" the interface( mainwindow) with my object and create a
vector <Object> objectlist;? thanks in advance :) -
Hi,
Shall that data be stored in the long term ?
In any case, based on your description, you should go through the Model View Programming chapter in Qt's documentation.
-
Hi,
Shall that data be stored in the long term ?
In any case, based on your description, you should go through the Model View Programming chapter in Qt's documentation.
@SGaist only meanwhile the program is running, once i close the program the data is lost, the program is just to simulate a form where the features of different vehicles are the input( number of wheels, if it has engine...) and once all the inputs are ready the program must check which tipe of vehicle it is, so I want the data to be stored in the object vehicle.
I found out that adding to the private field in mainwindow.h :
Vehicle v;
vector<Vehicle> vehicleList;may work.