【问题标题】:How to disable QML TableView transition animations?如何禁用 QML TableView 过渡动画?
【发布时间】:2017-12-19 22:34:17
【问题描述】:

我有一个按钮,单击时可以更改 QML TableView 的选定行。我的问题是更改行的过渡动画需要太长时间。有没有办法禁用它?

    Rectangle {
        height: 100
        width: 100
        MouseArea {
            anchors.fill: parent
            onClicked: {
                //the table will move few rows per second (too slow)
                agendarClienteTableView.currentRow = agendarClienteTableView.currentRow + 100 
                agendarClienteTableView.selection.clear()
                agendarClienteTableView.selection.select(agendarClienteTableView.currentRow + 100)
                agendarClienteTableView.forceActiveFocus()
            }
        }
    }

【问题讨论】:

    标签: qt qml qtquick2


    【解决方案1】:

    您可以使用函数positionViewAtRow() 来切片到您想要的行。

    请看下面的链接:

    https://doc.qt.io/qt-5/qml-qtquick-controls-tableview.html#positionViewAtRow-method

    【讨论】:

      猜你喜欢
      • 2017-12-04
      • 2020-05-25
      • 2023-02-05
      • 1970-01-01
      • 2011-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多