Questions tagged [qml]

QML (Qt Modeling Language) is a declarative language that allows user interfaces to be described in terms of their visual components and how they interact and relate with one another. It is a highly readable language, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings. It can be used to build fluid animated user interfaces that can be connected to any backend C++ libraries.

QML is a declarative language that allows user interfaces to be described in terms of their visual components and how they interact and relate with one another. It is a highly readable language that was designed to enable components to be interconnected in a dynamic manner, and it allows components to be easily reused and customized within a user interface. Using the QtQuick module, designers and developers can easily build fluid animated user interfaces in QML, and have the option of connecting these user interfaces to any back-end C++ libraries.

Resources

11756 questions
21
votes
4 answers

What are the real-world benefits of declarative-UI languages such as XAML and QML?

I'm currently evaluating QtQuick (Qt User Interface Creation Kit) which will be released as part of Qt 4.7. QML is the JavaScript-based declarative language behind QtQuick. It seems to be a very powerful concept, but I'm wondering if anybody that's…
Stu Mackellar
  • 11,510
  • 1
  • 38
  • 59
20
votes
5 answers

Is QML translated into native code at the compilation time or is it interpreted at runtime the way JavaScript is ran in web browsers?

Is QML translated into native code at the compilation time or is it interpreted at runtime almost the way JavaScript is ran in a web browser?
Ivan
  • 63,011
  • 101
  • 250
  • 382
20
votes
9 answers

QML Opacity Inheritance

In QML, how can I prevent a child element from inheriting the opacity from its parent? I want to set different opacity values for the parent and it's child element.
aqua boy
  • 419
  • 2
  • 4
  • 7
20
votes
4 answers

ListElement fields as properties?

Here is my code : import QtQuick 1.0 ListModel { property real firstValue: 2 property real secondValue: 3 property real thirdValue: 1 id: leftGrid ListElement { icon: "Images/1.png" value: leftGrid.firstValue …
Guillaume Slashy
  • 3,554
  • 8
  • 43
  • 68
20
votes
1 answer

Qt5 QML, when to use a ColumnLayout vs Column?

For example, this works: import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.2 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") function…
jkj yuio
  • 2,543
  • 5
  • 32
  • 49
20
votes
2 answers

Styling QML without manually marking each property to be styled

I know that QML does not support CSS styling like widgets do, and I have read up on alternative approaches to styling/theming: https://qt-project.org/wiki/QmlStyling http://www.slideshare.net/BurkhardStubert/practical-qml-key-navigation/34 Common…
jesperhh
  • 357
  • 1
  • 4
  • 10
20
votes
5 answers

QML - tracking global position of a component

I would like to track a global position of an object (or relative to one of it's ancestors) and bind it to some other item's position. I was thinking about using mapFromItem as follows: SomeObject { x: ancestor.mapFromItem(trackedObject,…
Konrad Madej
  • 1,271
  • 1
  • 11
  • 19
19
votes
6 answers

Full-screen desktop application with QML

I have experience with developing rich user interface application with flex and AS3. However the issue is its very hard to use existing c++ business logic with these flex apps. With the advent of QML, I am curious whether its possible to reuse the…
iceman
  • 4,211
  • 13
  • 65
  • 92
19
votes
7 answers

Qml text wrap (max width)

I would like to put text inside a bubble, and I want that my bubble be equal to the text width, but if the text length is too long, I would like the text to wrap automatically and be equal to the parent width. This code works but the text is not…
NicoMinsk
  • 1,716
  • 6
  • 28
  • 53
19
votes
4 answers

QML window resize/move flicker

I'm developing a simple QML application right now and I noticed that resizing and moving a QML window generates an ugly flicker compared to a QtWidgets window, for instance. So I created 2 test applications to show the…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
18
votes
5 answers

Qt 5.4/Qml: Prevent binding loop

I have a global singleton "Settings" which holds application settings. When I try to run the following code I get a QML CheckBox: Binding loop detected for property "checked": CheckBox { checked: Settings.someSetting …
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
18
votes
4 answers

QML: how to specify image file path relative to application folder

We are developing our first Qt/QML application (trying technology). While technology looks very promising at a glance, we have faced so many unexpected weird issues that almost give up at very beginning. Here one of such issue. We want the following…
Alexey Kryshen
  • 1,067
  • 2
  • 11
  • 15
18
votes
1 answer

Using a QAbstractTableModel with a Qml TableView only displays the 1st column

I'm trying to use a (class derived from) QAbstractTableModel with a Qml TableView; However, only the 1st column is displayed. The reason is QVariant MyModel::data(const QModelIndex &index, int role) isn't called for non-zero columns, but I don't…
Armaghast
  • 753
  • 1
  • 8
  • 14
17
votes
4 answers

How to get an instantiated delegate component from a GridView or ListView in QML

My conundrum, phrased generally, is: through some action outside the GridView, I want to figure out the coordinates of a particular delegate item in the GridView based only on a particular model item or index selected before. I've got a GridView…
chazomaticus
  • 15,476
  • 4
  • 30
  • 31
17
votes
3 answers

QML: How can I pass model properties to a delegate loaded inside a GridView (or ListView) delegate?

I'm attempting to build a reusable QML Component that internally hosts a GridView. Each element in the GridView has a set of behaviors (mostly display and mouse-based stuff) that is common throughout the application. However, what is displayed…
Jim Nelson
  • 1,688
  • 3
  • 15
  • 27