mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Implement option to disable selections
Sometimes you don't want the user to be able to highlight certain rows. Contributes to issue CURA-8686.
This commit is contained in:
parent
6457410a53
commit
a4ef86609f
2 changed files with 6 additions and 0 deletions
|
@ -24,6 +24,7 @@ Item
|
||||||
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
||||||
property int currentRow: -1 //The selected row index.
|
property int currentRow: -1 //The selected row index.
|
||||||
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
|
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
|
||||||
|
property bool allowSelection: true //Whether to allow the user to select items.
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
|
@ -134,6 +135,8 @@ Item
|
||||||
MouseArea
|
MouseArea
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
enabled: tableScrollView.allowSelection
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
tableScrollView.currentRow = row; //Select this row.
|
tableScrollView.currentRow = row; //Select this row.
|
||||||
|
|
|
@ -24,6 +24,7 @@ Item
|
||||||
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
||||||
property int currentRow: -1 //The selected row index.
|
property int currentRow: -1 //The selected row index.
|
||||||
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
|
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
|
||||||
|
property bool allowSelection: true //Whether to allow the user to select items.
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
|
@ -134,6 +135,8 @@ Item
|
||||||
MouseArea
|
MouseArea
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
enabled: tableScrollView.allowSelection
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
tableScrollView.currentRow = row; //Select this row.
|
tableScrollView.currentRow = row; //Select this row.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue