Vindroid
V2EX  ›  Qt

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

  •  
  •   Vindroid · Jan 13, 2021 · 4846 views
    This topic created in 1951 days ago, the information mentioned may be changed or developed.

    我想让图片只显示在黄框里,黄框外的不显示,要怎么弄?试过 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 replies    2021-01-13 17:30:02 +08:00
    Vindroid
        1
    Vindroid  
    OP
       Jan 13, 2021
    二了,用 clip: true 就行了,结帖
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2201 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 16:09 · PVG 00:09 · LAX 09:09 · JFK 12:09
    ♥ Do have faith in what you're doing.