Commit Graph

2 Commits

Author SHA1 Message Date
MohammadHossein Qanbari 33b5ba74ed Spreadsheets Example: Fix bug in inserting a new row
When inserting a new row (above or below an existing row), it was
causing a crash.

There was a forgotten call of the previous() method on the iterator
that was supposed to iterate backward.

It has been fixed by adding this function call inside the loop.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I6a4436bacb0348c1b6bccd929f715e36d0279754
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-07-12 20:59:51 +02:00
MohammadHossein Qanbari 3de85ce8b9 Add the Spreadsheet example
The example demonstrates a Spreadsheet that provides adding, editing,
and deleting data, and also the ability to write formulas for numeric
data. Also, it's possible to select cells, rows, and columns for
deleting them or their data, copying or cutting the data, and dragging
them to other places. The user can hide columns or rows, and also show
them again. Thanks to the reordering API, columns and rows can be
reordered and also can be reset to the default order.

There is a SpreadModel class which handles the entered data. It only
stores the data of the cells that is provided by the user. It means
that it does not create any empty data structure for empty cells, in
order to reduce memory usage.

Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I1d9cc5b4b8d902257e9ed508d4a712b0574490f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-06-03 17:27:22 +02:00