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-05-27 16:06:47 +00:00
|
|
|
// Copyright (C) 2024 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: root
|
|
|
|
modal: true
|
|
|
|
standardButtons: Dialog.Ok
|
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
component SectionHelpInfo: Item {
|
|
|
|
property alias sectionText: section.text
|
|
|
|
property alias sectionDescription: sectionDesc.text
|
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-05-27 16:06:47 +00:00
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: 20
|
|
|
|
|
|
|
|
Item {
|
|
|
|
implicitWidth: 40
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: section
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
Rectangle {
|
|
|
|
implicitWidth: 90
|
|
|
|
color: palette.base
|
|
|
|
border.width: 1
|
|
|
|
border.color: Qt.styleHints.colorScheme === Qt.Light ? palette.dark : palette.light
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: sectionDesc
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
}
|
2024-05-31 10:26:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
spacing: 10
|
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-05-27 16:06:47 +00:00
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
Item {
|
|
|
|
Layout.topMargin: 20
|
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-05-27 16:06:47 +00:00
|
|
|
Layout.leftMargin: 20
|
2024-05-31 10:26:01 +00:00
|
|
|
Layout.rightMargin: 20
|
|
|
|
implicitWidth: infoLabel.width
|
|
|
|
implicitHeight: infoLabel.height
|
|
|
|
|
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-05-27 16:06:47 +00:00
|
|
|
Label {
|
2024-05-31 10:26:01 +00:00
|
|
|
id: infoLabel
|
|
|
|
text: qsTr("A formula starts with `=` follows with the operator and arguments.\n" +
|
|
|
|
"Formula could be")
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
SectionHelpInfo {
|
|
|
|
implicitHeight: 30
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Cell assignment"
|
|
|
|
sectionDescription: "=A1"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
2024-05-31 10:26:01 +00:00
|
|
|
|
|
|
|
SectionHelpInfo {
|
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-05-27 16:06:47 +00:00
|
|
|
implicitHeight: 30
|
2024-05-31 10:26:01 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Addition"
|
|
|
|
sectionDescription: "=A1+A2"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
SectionHelpInfo {
|
|
|
|
implicitHeight: 30
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Subtraction"
|
|
|
|
sectionDescription: "=A1-A2"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
2024-05-31 10:26:01 +00:00
|
|
|
|
|
|
|
SectionHelpInfo {
|
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-05-27 16:06:47 +00:00
|
|
|
implicitHeight: 30
|
2024-05-31 10:26:01 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Division"
|
|
|
|
sectionDescription: "=A1/A2"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
|
2024-05-31 10:26:01 +00:00
|
|
|
SectionHelpInfo {
|
|
|
|
implicitHeight: 30
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Multiplication"
|
|
|
|
sectionDescription: "=A1*A2"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
2024-05-31 10:26:01 +00:00
|
|
|
|
|
|
|
SectionHelpInfo {
|
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-05-27 16:06:47 +00:00
|
|
|
implicitHeight: 30
|
2024-05-31 10:26:01 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: 40
|
|
|
|
sectionText: "Summation"
|
|
|
|
sectionDescription: "=SUM A1:A2"
|
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-05-27 16:06:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|