Unsolved how to load enter data in qtable view?
This post is deleted!
MarKS last edited by MarKS
JonB last edited by JonB
Write your model, with columns
product name. You might use a custom model, a
QSqlTableModelif you are using an actual database. Store the numeric columns to hold numbers, not strings.
QTableViewfor the model. Alternatively, you could make it a
QTableWidget, in which the case model mentioned in #1 will already be attached to it (
QTableWidgethas its own inbuilt model).
Get that working to display whatever rows the table has.
Easiest is if you add something like
QPushButtonjust below (not inside) the table. Clicking it adds a new, blank row at the end of the table, for a new item. Or have dedicated widgets for the user to pick what he wants and a button to add that as the row. There are other ways too.
(Probably) extend the
QTableViewto allow columns Modify and Remove with their own buttons against each row.
For adding/modifying you have a choice: you can have dedicated widgets outside the table where you copy rows/do your editing, or you can make your
QTableViewallow editing in selected row, changing values inside the actual row.
That's the outline.