GridView in widget application
-
Hi
You mean a like
http://doc.qt.io/qt-5/qtableview.html#details
I dont know what GridView offers so hard to suggest :) -
I have array of structure I need to display:
struct FlightData {
string name;
int value_show;
int value_enter;
} ;FlightData fd [2] ={{"Speed",10,0},{"Altitude",55,0}};
I need to show first two columns -name and value_show in table :
User must read data and enter values in editable column Enter.
By pressing button I need to read all data back to array of structure.
Which control is better to use in my case? Would you help me with my task?
-
Hi
You could use a tablewidget
https://wiki.qt.io/How_to_Use_QTableWidget
http://doc.qt.io/qt-5/qtablewidget.html#signals
You will hook up cellChanged to own slot and write data back to your
FlightData list.However, if you will have many FlightData ( more than a few hundred)
a TableView + model might better.
http://doc.qt.io/qt-5/model-view-programming.html
This has better performance for large lists and also
allows other views to show part of the data.
Editing is automatic.