qml

QML ScrollViewStyle width?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 07:21:14
问题 I'd like to make a ScrollView's scroll bar wider than the default value, but I don't see any width properties, even as part of the ScrollViewStyle element's frame component. 回答1: To make the scroll bar wider, you can change the following four properties in ScrollViewStyle with your custom components: handle , scrollBarBackground , decrementControl , and incrementControl (it may look weird if you do not change all of them). For example, ScrollView { style: ScrollViewStyle { handle: Rectangle {

“Some JS files act more like libraries - they […] never manipulate QML component instances directly” - middle ground?

…衆ロ難τιáo~ 提交于 2019-12-13 07:05:01
问题 Quote from Defining JavaScript Resources In QML: Some JavaScript files act more like libraries - they provide a set of helper functions that take input and compute output, but never manipulate QML component instances directly. What if I want a JS file that both: manipulates QML component instances (that are passed to it as arguments) doesn't get a copy of its code and data stored for every QML component instance that imports it? I could get the "no data stored on every instance" part by, well

How to change position in a ColumnLayout

六眼飞鱼酱① 提交于 2019-12-13 06:49:21
问题 I am a newbie in QML and I made a "accordion" item. I modified a not complete QML project for that. For that, I use PanelItems : Item { default property var contentItem: null property string title: "panel" id: root Layout.fillWidth: true height: 30 Layout.fillHeight: current property bool current: false ColumnLayout { anchors.fill: parent spacing: 0 Rectangle { Drag.active: dragArea.drag.active id: bar Layout.fillWidth: true height: 30 color: root.current ? "#81BEF7" : "#CEECF5" Text {

Is QQuickFramebufferItem the C++ equivalent of QML's Canvas 3D?

北城余情 提交于 2019-12-13 06:39:35
问题 What I want is a way to create a Qt Quick item drawn using custom OpenGL code. I seem to have found 2 ways: Subclass QQuickFramebufferItem and write my OpenGL code in C++ Create a Canvas3D item in QML and draw to it from Javascript Do these two ways really have the same purpose, with the main difference that they're used from different languages? 来源: https://stackoverflow.com/questions/39596473/is-qquickframebufferitem-the-c-equivalent-of-qmls-canvas-3d

QML QObject destroyed before being able to process a signal

天涯浪子 提交于 2019-12-13 05:59:18
问题 In QML, I'm using a C++ library that returns a QObject that does a process and emits a signal when is done. In javascript, I use the connect method of the signal being emitted ( success ) to attach an anonymous function that should handle the signal as the following piece of code shows: var requestResponse = apiClient.execute(reqInp); requestResponse.success.connect(function success(response) { var requestResponseJSON = JSON.parse(response.responseAsJsonString()); this.append(response

Is it possible to make a cycle swipe items in qml?

家住魔仙堡 提交于 2019-12-13 04:41:28
问题 I use swipeview in qml. I can swipe items from first to final and back. Is it possible to swipe from final to first immediatly ? I didn't find any information in docs. 回答1: You can do that with PathView. Qt Quick Controls 2's Tumbler can also be made to wrap because it uses PathView internally. 回答2: You can use PathView. Some codes like this: import QtQuick 2.0 Rectangle { width: 200 height: 200 ListModel { id: model ListElement { color: "red" } ListElement { color: "green" } ListElement {

Focusable Qml Components (Focus My Control On Tab)

可紊 提交于 2019-12-13 04:39:19
问题 i have created a custom button in qml, which i want to focus on pressing 'tab', i mean "jump to it on pressing tab if its on top of queue" by default qml has this functionality on button itself and some of other controls too but what about new components which does not exist,i saw a "FocusScope" control of qml but there is no documentation of using it and i am not sure how can i implement it, here is my control : import QtQuick 2.4 Item { id: button width: innerText.width + 10 height: 30

Blackberry 10 cascades qml methods

て烟熏妆下的殇ゞ 提交于 2019-12-13 04:21:56
问题 How to load a method when i click a button from one qml layout to other qml? as am having a editprofile button if i click the button means i want to show the values ,which i got from the webservice how to do this? can anyone send some idea.? Thanks 回答1: you need to implement this onCreationCompleted method onCreationCompleted: { // call the function, that you need to show first // first_display() } Hope this helps.!!! 回答2: It sounds like you are trying to pass data retrieved from a webservice

Display multiple MapPolygons via ListView and ListModel

好久不见. 提交于 2019-12-13 03:55:54
问题 I would like to display multiple MapPolygons. To structre it nicely, I would like to define the polygons in a separated file. After some googling around, I think an approach with ListView and ListModel could work. So far I tried to define the complete MapPolygon inside the ListElement{} . This produced an error, that a ListElement{} can not contain any nested elements. So I defiend a viarable path and color in the ListElement{} and tried to delegate those to a MapPolygon. This produces the

QML tree view from a model

元气小坏坏 提交于 2019-12-13 03:46:49
问题 I'm quite new to QML and I'm struggling to find any information how to render a tree model in a simple way (although horizontally, rather than vertically): Seems like QML only supports list data structures from models. Is there any way to do it? 回答1: Figured it out on my own. The trick is to use DelegateModel, Repeater and Row/Column layouts, not TreeView. Create a component which will show your current node using DelegateModel. Use a Repeater to create children - let the component