Commit Graph

36 Commits

Author SHA1 Message Date
057bd244bd Added type roles to the calculation if an item is equal to the given item values. 2026-03-01 11:37:00 +01:00
c9d67ff2cc In TableModel::data(...): Default to ModelItem::data(...) for non user facing roles too. 2026-03-01 11:35:26 +01:00
e68b446407 A new role doesn't have to be added to TableModel::data(...) anymore. 2026-03-01 11:33:08 +01:00
6fc3ffc537 Added missing type role to TableModel::data(...). 2026-03-01 11:25:57 +01:00
d4ff1ffb61 Split TableModel::updateItemsFromJson(...) into two functions and added support for multiple items in JSON data. 2026-02-02 16:48:42 +01:00
db1ecbece0 Current items can be deleted by passing the UUID to the deleteItemFromServer signal. 2026-02-02 16:15:43 +01:00
63fe96fb2e On sending (posting) item to the server the generated UUID is added to the local item. 2026-02-02 16:13:44 +01:00
bedf8084d3 Retrieving the JSON data of the current index to send to the server through the proxy model. Sending this data happens by triggering the core. 2026-01-29 13:13:32 +01:00
2a152daa70 Using lower case role names for improved compatibility with the server. 2026-01-29 13:06:46 +01:00
08c2e3a093 Added IdRole for the server generated UUID of the items. 2026-01-29 09:27:50 +01:00
e29cd0aebf Basic JSON RESTful client fetching items from a local server at application start and adding them to the model. 2026-01-25 10:47:19 +01:00
e1bc779791 Added QAbstractItemModelTester to main and proxy model. And fixing errors in functions flags(...), rowCount(...) and columnCount(...). 2026-01-19 18:43:13 +01:00
caffa1c18a Added a ToStringRole to summarize the model items (for tool tip and QR code). 2026-01-15 14:04:37 +01:00
99ed398c2f Simple implementation of CSV export. 2026-01-06 10:04:26 +01:00
3e6273cb7d Using the typedef ModelItemValues for "QHash<int, QVariant>". 2026-01-04 17:48:27 +01:00
2702b9c835 Simple implementation of CSV file import. Successfully imported items are appended to the model. 2026-01-04 13:38:54 +01:00
b8fe4e6502 Iterating over USER_FACING_ROLES to get all the item values when parsing and keeping them in edit and remove commands. Instead of using each role explicitly. 2025-12-31 10:39:32 +01:00
acb8be5602 Refactored JsonParser to not use roles (or their names) directly. 2025-12-29 13:03:09 +01:00
3610aa3841 Using "model/metadata.h" for file and JSON object naming as well. Using all upper case for naming static meta data constants and functions. 2025-12-29 10:35:00 +01:00
0c3d711513 Moved the model meta data for roles and columns into "model/metadata.h" to gather meta data like this in one central place. 2025-12-29 10:30:12 +01:00
1fc1b1715d Items are loaded from default JSON file in standard location at startup. If no items are found in file, example items are generated. 2025-12-23 13:40:33 +01:00
0e1a0d4959 Items can be saved to JSON file "items.json" (in standard location). 2025-12-23 10:14:13 +01:00
e54204e394 Editing an item is now undo/redo-able. 2025-12-15 18:04:14 +01:00
772ab6b2ff Reordered function implementations according to declarations in header file. 2025-12-12 13:22:27 +01:00
c75d35179b Deleting items from the model can now be made undone/redone. 2025-12-11 15:49:16 +01:00
0166a00d9d Adding new items to the model can now be made undone/redone. 2025-12-11 15:47:55 +01:00
e21c899aac Bugfix: Last row could not be removed due to miscalculations of the bounds. 2025-12-09 09:33:46 +01:00
169d8f9f1e Items can be deleted from the model. 2025-12-08 14:50:13 +01:00
d45b1098f9 Added default invalid parentIndex to TableModel::columnCount and added Q_UNUSED macro to suppress warnings. 2025-12-08 13:33:05 +01:00
4c906099eb Items can be added to model dynamically. 2025-12-08 13:25:02 +01:00
144460b5aa Start with the current data, when editing a table cell. 2025-12-06 14:34:17 +01:00
a07e03d80d Deducing the column count of the table model from the header names. 2025-12-04 15:54:53 +01:00
40e1dd3002 A very simple version of editing model data. 2025-12-04 11:30:30 +01:00
16c524f7a2 Proper header names for the columns. 2025-12-04 11:29:33 +01:00
0dba9639e6 Added a ModelItem class to hold the data for each row. 2025-12-03 11:07:39 +01:00
6a3725bde7 Added a simple read-only TableModel and made it accessible via GenericCore.
Basically like in this tutorial: https://doc.qt.io/qt-6/modelview.html#2-1-a-read-only-table
2025-12-02 16:09:34 +01:00