qml

Get index of the delegate currently displayed - QML ListView

你。 提交于 2020-08-22 09:36:19
问题 I created a ListView, which displays a couple of pages of content defined by the user (plain text). The page displayed is a delegate. Only one page is visible at a time. I decided to use it to get snapping to one item, in the same way the iOS' launcher works. The user simply flicks between the pages. (this is to be used on touch screens) I need to have the index of the currently displayed page for some operation. currentIndex of the ListView always stays == 0. How can I get it? For those who

Do not repaint window during resize

一个人想着一个人 提交于 2020-08-22 05:25:17
问题 My QML application (Qt 5.4) is based on a Window item. The application can be resized by the user. When the application is resized the content of the application is being resized respectively (with onWidthChanged and onHeightChanged ). This is all fine. But to avoid flickering I don't want to update the content of the application while the applicaiton is beeing resized. Is there a possibility in QML to detect when the user is actually resizing the window (holding the mouse button down over

Customizing Window with PathSvg

大兔子大兔子 提交于 2020-08-20 11:30:42
问题 Here's what I've now in my main.qml : import QtQuick 2.9 import QtQuick.Window 2.3 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import QtQuick.Shapes 1.12 import QtGraphicalEffects 1.0 Window { visible: true width: 640 height: 480 title: qsTr("Test Window") property double iconSize: 24 RowLayout{ anchors.fill: parent Rectangle{ id: rect Layout.fillHeight: true Layout.preferredWidth: iconSize ListView{ id: lv model: ViewModel.views anchors.fill: parent delegate: ItemDelegate{ width:

How to add Section footer, Section summary and Grand Total in ListView

我只是一个虾纸丫 提交于 2020-08-10 20:34:45
问题 Here's my ListView with section : ListView{ id: listView width: parent.width height: parent.height model: testContext.List interactive: false delegate: ItemDelegate { width: parent.width padding: 3 leftPadding: 15 rightPadding: scroll.width contentItem: RowLayout{ Text{ id: nameText text: modelData.name Layout.preferredWidth: (parent.width - scroll.width) / 3 } Text{ text: modelData.isActive Layout.preferredWidth: (parent.width - scroll.width) / 3 } Text{ text: modelData.age Layout