qml

How to remove spacing? QML ChartView

丶灬走出姿态 提交于 2019-12-19 06:32:30
问题 Does anyone know how to remove this spacing? Those lines below reduce them but not completely remove. margins.top: 0 margins.bottom: 0 margins.left: 0 margins.right: 0 UPDATE I added some code. May be this could help to identify my problem. Originally those blank spaces where arrows are located are for legend and tick values. I quess without changing a source code I can do nothing. ScopeView.qml import QtQuick 2.0 import QtCharts 2.1 ChartView { id: chartView animationOptions: ChartView

QML - Control border width and color on any one side of Rectangle element

时光总嘲笑我的痴心妄想 提交于 2019-12-19 05:03:51
问题 Currently i had a requirement of drawing a delegate rectangle with the help of ListView control. I was able to draw a series of rectangle either horizontal or vertical within the list view but the problem is with the border of the rectangle. The border width at the intersect point of the adjacent rectangle is of twice the width. The delegate rectangle is nothing but a Qt Quick Rectangle element. Is it possible to limit the border width on any one side of the rectangle alone? Is it possible to

How to use the QML/QtLocation module for displaying a large amount of offline data on a map?

断了今生、忘了曾经 提交于 2019-12-19 04:44:50
问题 I'm in the process of creating an offline Slippy Map using QML and their new QtLocation module (>=Qt5.4). I managed quite easily to display the tiles with an offline cache. Now I would like to add custom data to this map (a list of ~7000 airports). This huge list would have to be clustered depending on the zoom level (for performance and readability reasons, unless the QtLocation has built-in "optimizations"..?. What would be to most elegant/best way to achieve this, staying as close as

BusyIndicator does not show up

拈花ヽ惹草 提交于 2019-12-19 03:22:53
问题 I want to show a BusyIndicator while a long process is going on. The problem is it does not show up when I make it run and shows afterwards when the process is completed. According to the docs The busy indicator should be used to indicate activity while content is being loaded or the UI is blocked waiting for a resource to become available. I have created a minimal code that based upon the original code Window { id: win width: 300 height: 300 property bool run : false Rectangle { anchors.fill

QML binding to an array element

空扰寡人 提交于 2019-12-19 01:24:25
问题 I have a width property on a QML Rectangle that is set based on another Rectangle with an id of mainwindow and one of the array properties of mainwindow : width: mainwindow.width/mainwindow.numColsPerRow[positionRow] This works at the time my rectangle is setup; that is, the element inside the array numColsPerRow is correctly involved. However, after this Rectangle is setup, if I change the values inside numColsPerRow the width of this Rectangle does not have any effect. Does QML not allow

Populate GridLayout with Repeater

纵然是瞬间 提交于 2019-12-18 13:35:15
问题 I try to add cells to my GridLayout by using a Repeater . My data is stored in a model and containing two properties per element: Title Value My goal is to get a GridLayout containing the Title in first cell and the Value in the second cell of each row. GridLayout { id: someId columns: 2 rowSpacing: 5 columnSpacing: 5 anchors.margins: 5 anchors.left: parent.left anchors.right: parent.right Repeater { model: myModel Label { text: modelData.title } TextArea { text: modelData.value } } } But QML

How can I create a QML GridLayout with items of proportionate sizes?

早过忘川 提交于 2019-12-18 11:53:53
问题 Potentially related: https://stackoverflow.com/a/30860285/3363018 I've been trying to create a QML layout with items that span variable numbers of rows and columns. So, e.g., a rectangle that spans two rows and four columns, one to the right of it that spans one row and two columns, and one underneath that spans three rows and five columns. A generic attempt at creating this is below: import QtQuick 2.5 import QtQuick.Layouts 1.2 import QtQuick.Controls 1.4 ApplicationWindow { visible: true

Qt/QML : Send QImage From C++ to QML and Display The QImage On GUI

我的未来我决定 提交于 2019-12-18 10:43:04
问题 I created a class Publisher which periodically emits a QImage object. However I'm having a tough time drawing the QImage to a QML element. It appears that the Image and Canvas QML components require a QUrl instead of a QImage , but I'm not sure how to convert my QImage to a QUrl . Edit4: When I say QUrl, I don't mean I'm trying to convert an image to a URL. That's nonsense. I mean I want to generate a reference to this image, which is not on disk, and the data type that QML components are

How to apply opacity mask to a QML item?

守給你的承諾、 提交于 2019-12-18 06:18:16
问题 The look and feel I'm trying to go for is to have a solid color button, and text on it like "Hello World" where the text is completely transparent, and the background shows through the button. In other words, having text as a transparency mask on a button element. 回答1: Here is one way to do it: // TB.qml MouseArea { width: txt.contentWidth + 20 height: txt.contentHeight + 10 property alias text: txt.text property alias color: sh.color ShaderEffect { id: sh anchors.fill: parent property color

How to apply opacity mask to a QML item?

谁都会走 提交于 2019-12-18 06:17:09
问题 The look and feel I'm trying to go for is to have a solid color button, and text on it like "Hello World" where the text is completely transparent, and the background shows through the button. In other words, having text as a transparency mask on a button element. 回答1: Here is one way to do it: // TB.qml MouseArea { width: txt.contentWidth + 20 height: txt.contentHeight + 10 property alias text: txt.text property alias color: sh.color ShaderEffect { id: sh anchors.fill: parent property color