Questions tagged [qtquick2]

Qt Quick is a modern user interface technology that separates the declarative UI design and the imperative programming logic. Instead of the traditional C++ APIs of Qt, the presentation layer of the application is written with a Qt-specific declarative language called QML.

The Qt Quick module is the standard library for writing QML applications. While the Qt QML module provides the QML engine and language infrastructure, the Qt Quick module provides all the basic types necessary for creating user interfaces with QML. It provides a visual canvas and includes types for creating and animating visual components, receiving user input, creating data models and views and delayed object instantiation.

The Qt Quick module provides both a QML API which supplies QML types for creating user interfaces with the QML language, and a C++ API for extending QML applications with C++ code.

For more details, see the introduction to Qt Quick page in the Qt reference documentation.

2305 questions
11
votes
1 answer

Proper way to deploy QML applications on Windows

Recently I needed to create a deployment package for my Qt-QML application. This process is quite tedious, as you need to manually find and copy dependencies. As described in (official?) Qt Wiki: Copy the following into C:\Deployment\ - The…
Aleksei Petrenko
  • 6,698
  • 10
  • 53
  • 87
11
votes
2 answers

onClicked and onDoubleClicked both happen in QML

I have added onClick and onDoubleClick handlers to an item in QML, but both of the events get executed when I double click on the area. I don't know if it has something to do with checking if the clicks were generated by right mouse button. Also the…
Dumbo
  • 13,555
  • 54
  • 184
  • 288
11
votes
3 answers

Time Picker in QML

I need to give the user the possibility to select a date and time within a QML application. For selection dates there is the Calendar in QtQuick Controls. I haven't found a similar control to let the user select the time of day. On the internet…
Matthias Kuhn
  • 1,162
  • 2
  • 14
  • 42
11
votes
3 answers

QML - Display "Next" button to move to next TextField on a mobile keyboard

How can I force my keyboard layout to display the "Next" button in QML ? ( Like in a standard HTML form ) I don't want to display a "OK" button ( which means that you're about to validate the form .. )
Geoffroy
  • 173
  • 1
  • 10
11
votes
4 answers

Add elements dynamically to SplitView in QML

I am working with QML and I want to add elements to SplitView dynamically eg. onMouseClick, but so far I didn't find the answer. What I've found out so far is that the SplitView has it's default property set to it's first child's data property. So I…
user1913403
10
votes
1 answer

How to resize a QImage or QML Image to fit parent container without breaking the Image's aspect ratio

Scenario: I have an Image component in QML which contains a QImage of varied aspect ratios. Code: Window { id: app_window visible: true Rectangle { id: my_image_view_container width: app_window.width height: app_window.height …
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
10
votes
2 answers

Best way to access a cpp structure in QML

I need to pass structures between cpp and QML. If i use property i should create an individual set and get functions, My structure contains minimum 5 members so i felt it's not good to use set and get for all those members. Following is an example…
pra7
  • 834
  • 2
  • 21
  • 50
10
votes
1 answer

Render Qml using Vulkan

I have a Qt application that draws using Open GL. At some point I'm using a QQuickWindow associated to a QQuickRenderControl to draw a QML scene into a texture to later compose it in the final image. Now, I'm considering porting OpenGL to Vulkan and…
gabocalero
  • 473
  • 6
  • 15
10
votes
2 answers

Can I get the real width & height of a Text element?

I would like to get the real width & height of a Text element. If I use the paintedWidth & paintedHeight properties, I don't get it. For example: Rectangle { color: "green" width: a_text.paintedWidth height: a_text.paintedHeight …
qmldonkey
  • 271
  • 1
  • 2
  • 9
10
votes
4 answers

Protecting QML source code from plagiarism

The goal is to come up with a way to protect your QML code from plagiarism. It is a problem, since the way QML was designed and implemented seems to be inexplicably unprotected in this regard. The only QML types which are somewhat protected are…
dtech
  • 47,916
  • 17
  • 112
  • 190
10
votes
2 answers

qml run javascript code after state change

I have several states which I use only to change some properties: Item { id: props property int someProperty: 0 // ... states: [ State { name: "firstState" PropertyChange { target:…
lambdauser
  • 183
  • 1
  • 8
10
votes
3 answers

QML garbage collection deletes objects still in use

I've encountered this problem on several occasions, with objects created dynamically, regardless of whether they were created in QML or C++. The objects are deleted while still in use, causing hard crashes for no apparent reason. The objects are…
dtech
  • 47,916
  • 17
  • 112
  • 190
10
votes
1 answer

Load qmldir from QRC file

I'm trying to use the QML-material library in a Qt Quick Application. But when I try to use the import code it says module "Material" is not installed` import Material 0.1 I did also try this but that seems not to work: import…
Joery
  • 759
  • 4
  • 13
  • 33
10
votes
1 answer

After upgrade to qt 5.5.0 I got warning for QML imports

I just upgraded from 5.4.1 to 5.5.0 today. But when I build my android project I get these lines of warning in compile output: Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private Warning: QML import could not…
a.toraby
  • 3,232
  • 5
  • 41
  • 73
10
votes
2 answers

No update in ListView

I made a class derived from QAbstractListModel and re-implemented all the necessary functions. I create an object of it, fill in some initial data into the model (all beginInsertRows etc done) and then pass it (the object) to qml via…
Vedanshu
  • 2,230
  • 23
  • 33