qml

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

折月煮酒 提交于 2020-08-10 20:33:27
问题 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

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

ぃ、小莉子 提交于 2020-08-10 20:31:34
问题 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

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

五迷三道 提交于 2020-08-10 20:31:30
问题 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

QML load and display .ply mesh with color attributes

萝らか妹 提交于 2020-08-10 05:00:07
问题 I am trying to load a simple cube with per-vertex color information from a Stanford PLY file using QML. My entity looks like this: Entity { id: circle property Material materialPoint: Material { effect: Effect { techniques: Technique { renderPasses: RenderPass { shaderProgram: ShaderProgram { vertexShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.vert") fragmentShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.frag") } } } } parameters:

Registering a type in QML using PySide2

牧云@^-^@ 提交于 2020-08-08 06:28:07
问题 I am trying to create a new QML type by using Python, but I am having trouble with registering a QML type. However, I am getting an Error: TypeError: 'PySide2.QtQml.qmlRegisterType' called with wrong argument types: PySide2.QtQml.qmlRegisterType(module, str, int, int, str) Supported signatures: PySide2.QtQml.qmlRegisterType(type, str, int, int, str) So I understand that its expecting a type, however, in this blogpost it does something similar: qmlRegisterType(PieChart, 'Charts', 1, 0,

Registering a type in QML using PySide2

守給你的承諾、 提交于 2020-08-08 06:27:30
问题 I am trying to create a new QML type by using Python, but I am having trouble with registering a QML type. However, I am getting an Error: TypeError: 'PySide2.QtQml.qmlRegisterType' called with wrong argument types: PySide2.QtQml.qmlRegisterType(module, str, int, int, str) Supported signatures: PySide2.QtQml.qmlRegisterType(type, str, int, int, str) So I understand that its expecting a type, however, in this blogpost it does something similar: qmlRegisterType(PieChart, 'Charts', 1, 0,

QML memory usage on big grid

邮差的信 提交于 2020-08-08 05:16:20
问题 I have a minesweeper-style game developed as a way of practicing QML. The issue I have is on the memory usage which grows quickly out of hands (>700 Mb) depending on the size of the grid. I made it sizeable up to 150*150 (bigger grid leads to crash as it's win32). The grid is built like this (with bits from Expose 2D C++ Game Board to QML using QAbstractItemModel) (the image is used to show a "bomb.png", the text to show the number of mines) : Flickable { id: flickable width: parent.width

QML memory usage on big grid

只愿长相守 提交于 2020-08-08 05:14:52
问题 I have a minesweeper-style game developed as a way of practicing QML. The issue I have is on the memory usage which grows quickly out of hands (>700 Mb) depending on the size of the grid. I made it sizeable up to 150*150 (bigger grid leads to crash as it's win32). The grid is built like this (with bits from Expose 2D C++ Game Board to QML using QAbstractItemModel) (the image is used to show a "bomb.png", the text to show the number of mines) : Flickable { id: flickable width: parent.width

PySide How to see QML errors in python console?

六月ゝ 毕业季﹏ 提交于 2020-08-07 07:56:13
问题 I have the following code: if __name__ == '__main__': os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load('./QML/main.qml') if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_()) As you can see, if `engine.load' fails all I'll see is a '-1' exit code, without any elaboration on why it failed and what the error happened. How can I print the QML error in the python console? There was a walkaround for this with

PySide How to see QML errors in python console?

孤街浪徒 提交于 2020-08-07 07:55:07
问题 I have the following code: if __name__ == '__main__': os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load('./QML/main.qml') if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_()) As you can see, if `engine.load' fails all I'll see is a '-1' exit code, without any elaboration on why it failed and what the error happened. How can I print the QML error in the python console? There was a walkaround for this with