V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Vindroid
V2EX  ›  Qt

Qml PathView 要怎么限制显示的范围

  •  
  •   Vindroid · 2021-01-13 17:17:09 +08:00 · 1288 次点击
    这是一个创建于 1170 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想让图片只显示在黄框里,黄框外的不显示,要怎么弄?试过 ListView 也有同样的问题

    PathView {
        id: _pathView
        x: 490
        y: 260
        width: 300
        height: 200
        snapMode: PathView.SnapOneItem
        model: _model
        delegate: _delegate
        pathItemCount: 5
        path: _horizontalPath
    
    Path {
        id: _horizontalPath
        startX: -_pathView.currentItem.width / 2 * 3
        startY: _pathView.currentItem.height / 2
    
        PathLine {
            relativeX: _pathView.currentItem.width * _pathView.pathItemCount
            relativeY: _pathView.currentItem.y
        }
    }
    
    1 条回复    2021-01-13 17:30:02 +08:00
    Vindroid
        1
    Vindroid  
    OP
       2021-01-13 17:30:02 +08:00
    二了,用 clip: true 就行了,结帖
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1386 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:42 · PVG 07:42 · LAX 16:42 · JFK 19:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.