c++ - 是否可以使 QML ListView 循环?

标签 c++ qt4 qml

我已经在 QML 中实现了一个简单的列表模型和列表委托(delegate),现在很好奇使基础列表循环是否可行。 这是代码片段:

      Common.MarketsListView {
      id: markets
      anchors.top: logoImage.bottom
      anchors.topMargin: 5
      cacheBuffer: 20000

      NumberAnimation on x {
          running: runtime.isActiveWindow
          loops: Animation.Infinite
          from: 0
          to: -300
          duration: 20000
      }

目前,列表缓慢地向左移动,但当它到达末尾时,只显示最后几项。所以我要么让底层列表循环,要么硬编码跳转到第一个列表项:(

最佳答案

你不能用 ListView 做到这一点,但你可以使用 PathView 获得你想要的行为,例如https://doc.qt.io/archives/qt-4.7/declarative-ui-components-spinner.html

关于c++ - 是否可以使 QML ListView 循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4225044/

相关文章:

c++ - 使用模板递归检查函数方法是否存在

c++ - QML 中的设置值保存在哪里?

javascript - 创建后如何将项目添加到 QML 网格?

c++ - 在 MFC 中创建标尺栏

c++ - 如何在 CMake 中明确指定树外源?

c++ - Qt 4.6 是否默认在 Snow Leopard 上使用 Cocoa 编译?

qt - Qt Creator 是用 Qt Creator 构建的吗?

c++ - 使用 QAbstractItemModel 将 2D C++ 游戏板暴露给 QML

c# - 获取指向 C# 的 C++ 指针

c++ - Qt4 DNS 代理 QUdpSocket