This update removes the custom table cell and uses the TableViewDelegate
type as the main TableView's delegate.
Task-number: QTBUG-114636
Change-Id: Icc2fd121d66f2bd1a6102e8575b75abd46940b96
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
The 'model' used when invoking mapColumn/mapRow during section
reordering seems incorrect as the model here has been referred to as
QHeaderProxyModel and not the SpreadModel. Updated the corresponding qml
to refer to the correct model.
Pick-to: 6.8
Change-Id: Ia8fe900eb0574319fd4c967b6f85cf8dd11bddd8
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The bug occurred when dragging a column over a selected column cells.
The DropArea in TableView attempted to process inconsistent drag data
for all the selected cells (up to 1000), causing the application to
hang.
Fix: Enable DropArea only for dragging TableView cells; disable for
other cases.
Fixes: QTBUG-130928
Pick-to: 6.8
Change-Id: I162a57638d89b97f3f1ef553850e3be3be389f1d
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
The example fails to compile on some platforms due to an existing
circular dependency. To fix this issue, the inclusion of
`spreadformula.h` has been moved to the related .cpp files, and a
forward declaration is used in the `spreadmodel.h` file instead.
Fixes: QTBUG-128272
Pick-to: 6.8
Change-Id: Ic2c589f9126e0ba0eed6ffe5150bacd4afa6d239
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
The documentation was missing for the example. This patch provides a
screenshot image of the application and a documentation file.
Fixes: QTBUG-128224
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I2aa73ea7e82eb019db84a7ce685837b89e62f300
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
After installing the example outside the build directory using
`cmake --install --prefix`, the installed application could not run
because the Spreadsheet subproject library was not found at runtime.
To fix this issue, the Spreadsheets subproject has been added as a
static library to the project. Now, it can be found in the installed
directory.
Fixes: QTBUG-127846
Pick-to: 6.8
Change-Id: I30968afa958ec6bda6017969de157e27550a7616
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The following changes are applied:
- Using ScrollView
- Cut action removes the data from the model
- Selection handle: smaller size, lighter color and border is used
Pick-to: 6.8
Change-Id: Id09c12db5f5c38c2254e1bf81970616e7e84f38d
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The Spreadsheets example does not build on QNX as it uses the clipboard,
which is not supported on QNX.
To fix this issue, it checks `QT_NO_CLIPBOARD` macro around the
clipboard usage and prints a warning if it is not supported.
Fixes: QTBUG-127273
Pick-to: 6.8
Change-Id: Ib677ecd79c216f4e7dde20d82875ee3f492a21ea
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
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>
The Main.qml file was growing larger due to modifications in header
views. To prevent this, the header views have been separated into
ColumnHeaderView and RowHeaderView QML module types.
Similar to the header views, the tap handlers have been separated into
a QML module type to maintain consistent behavior for header views.
Additionally, the mouse tap handlers have been merged into a single
tap handler to manage mouse events with different combinations of
buttons and modifiers.
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: Ib465b8b631cb8fe2aeeaaea229e2c4985619d2e9
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
When MouseArea is used for the header views, it blocks events for the
column/row reordering event handler.
To fix this issue, TapHandler is used instead of MouseArea. With proper
configuration of TapHandler properties, the column/row reordering event
handler can access events when they're not accepted by TapHandler.
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: Ie59dfc681bb3d853e0a73a05d46bdcd2607091b0
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
According to QUIP-18 [1], all example files
should be LicenseRef-Qt-Commercial OR BSD-3-Clause
Example takes precedence over build system
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.8
Task-number: QTBUG-121787
Change-Id: Ia60be3cc375a3a16af7e6ea7755a61cfe6e1573b
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If the user drags a column from outside the visible area and drops it
into the visible area when the column contains a formula that depends
on a visible cell, updating that cell will not update the cell
containing the formula.
The reason is that the update method in the SpreadModel updates the
wrong rows and columns. The visible rows and columns need to be mapped
to the model's rows and columns.
The improvement is that the update uses a mutex instead of enabling or
disabling the connection in the view. However, the blockConnection()
function has been kept because some actions need to update a large
amount of data in the model, and then the view can be updated without
any extra view updates.
The pan and reset_reordering icons are updated. The new icons have
been designed by the designers.
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I20ea1ef0bb777b5b0b04e7ae74df172ffc5b5ed8
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
The HelpDialog is improved by defining an inline component inside it.
The column selection issue is fixed by removing the unnecessary margins
and rows as well.
When the user tries to cut cell data and paste it onto an area including
the cell itself, that cell would be deleted because it was a cut action.
However, this is not correct because the value of that cell is replaced
with the data from the clipboard (mime data) already. To fix this bug,
before deleting the data of the cutting cell, that cell should be
checked to ensure it is not part of the target cells.
Task-number: QTBUG-125767
Pick-to: 6.8
Change-Id: I1adab2c17dab1cf07245bfaed03193904d7d7a2e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>