Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

qt - 多行文本项未在QML ListView中剪切(Multiline text item is not clipped inside QML ListView)

I have a QML page that with a GridLayout that contains the page title, ListView and close button:

(我有一个QML页面,其中的GridLayout包含页面标题,ListView和关闭按钮:)

    GridLayout {
        columns: 1
        rows: 5

        anchors.fill: parent

        <page title item>....

        ListView
        {
            spacing: 15

            model: logModel

            delegate: Item {
                implicitWidth: parent.width
                implicitHeight: grid.height

                RowLayout
                {
                    id: grid
                    spacing: 0
                    width: parent.width
                    height: commentLabel.implicitHeight

                    <icon>....

                    Label {
                        id: commentLabel
                        Layout.fillWidth: true
                        text: comment
                        wrapMode: Label.Wrap
                    }
                }
            }

            ScrollIndicator.vertical: ScrollIndicator { }
        }

        <close button>...
}

When I scroll the list, the first and the last visible item in the list may go beyond the list bounder and intersect the page title or close button:

(当我滚动列表时,列表中的第一个和最后一个可见项可能会超出列表边界,并与页面标题或关闭按钮相交:)

在此处输入图片说明

在此处输入图片说明

How to prevent this and make the items clipped?

(如何防止这种情况并使物品被修剪?)

  ask by Dmitriano translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...