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
13
votes
1 answer

What is the difference between GridLayout and Grid

What is the point of having a GridLayout component, when there is a Grid component? From what I can tell, they seem to be doing the same thing. Grid: https://doc.qt.io/qt-5/qml-qtquick-grid.html GridLayout:…
bobbaluba
  • 3,584
  • 2
  • 31
  • 45
13
votes
4 answers

Is there any DatePicker control for Qt 5?

I'm writing my first QML/Javascript app for QtQuick 2.0. I need to place a DatePicker control, but I haven't found any control like that under QtQuick.Controls -and nowhere, in fact-. I'm starting to believe there is no way to call a 'native'…
cmolina
  • 973
  • 1
  • 11
  • 21
13
votes
2 answers

QML - MouseArea - propagating onPositionChanged

Is it possible to propagate a MouseArea's positionChanged event to an underlying one? I've tried to set the mouse.accepted to false for any existing signal handler of the top-most MouseArea as well as setting the propagateComposedEvents to true.…
Konrad Madej
  • 1,271
  • 1
  • 11
  • 19
13
votes
4 answers

How to create scrollbar in QtQuick 2.0?

I am trying to create a scrollbar in QtQuick 2.0, I found that Scrollbar component is available in QtQuick 1.0 but I can't find such component in QtQuick 2.0. How can I create scrollbar for ListView in QtQuick 2.0? Any help? Thanks in advance.
snehal
  • 1,798
  • 4
  • 17
  • 24
13
votes
3 answers

Exe file does not run without QtCreator

I installed Qt 5.0.1 for Windows 32-bit (MinGW 4.7, 823 MB) Then I created simple Quick 2 application and compiled it. Application is located in the its folder, and apllication run from QtCreator. And I want to run this exe file without QtCreator.…
Harrix
  • 547
  • 3
  • 8
  • 17
12
votes
1 answer

qt qml. Can a MouseArea see events, but pass them all to parent without affecting them?

An inner MouseArea gets the mouse events first. I would like to "see" these events, so as to set various properties, but not affect them. I would like the mouse events to propagate to any parent MouseArea. consider this code. I would like clicking…
jkj yuio
  • 2,543
  • 5
  • 32
  • 49
12
votes
5 answers

Menubars in QtQuick Controls 2

How can I have Menubars in QtQuick Controls 2? It used to be like this (in ApplicationWindow): menuBar: MenuBar { Menu { title: qsTr('File') MenuItem { text: qsTr('&Test') onTriggered: console.log('test') …
Sassan
  • 2,187
  • 2
  • 24
  • 43
12
votes
4 answers

How to find QML item by its string id?

I have a string id of an object I need to find in QML tree. For example: var idToFind = "myBtnId" Can I do something like the following? var objectThatINeed = myMainWindow.findObjectById(idToFind) As far as I understand I can use objectName for…
Werolik
  • 923
  • 1
  • 9
  • 23
12
votes
1 answer

QML Drag and Drop (free positioning)

There are a lot of QML Drag and Drop Examples out there, but none of them really helps me, because in all the examples you can drag an element into another, where it is centered and all other elements you drag above are laying over it. Is there a…
ndothenning
  • 137
  • 1
  • 1
  • 5
12
votes
1 answer

How to smooth the painting of a custom QML element?

I try now to create custom QML element, derived from QQuickItem. So I overrided QQuickItem::updatePaintNode and want now do draw a line. My code: QSGNode *StrikeLine::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) { …
folibis
  • 12,048
  • 6
  • 54
  • 97
12
votes
2 answers

Issue with drawing an Qml Item with raw OpenGL calls

I want to draw a single item in QtQuick scene using raw OpenGL calls. I have decided to take approach suggested in this question. I have created a Qt Quick item deriving from QQuickFramebufferObject and exposed it to QML as Renderer: (code is based…
pawel
  • 231
  • 2
  • 6
12
votes
3 answers

FileDialog in QTQuick (QML): Save file under given name

We're building a Qt Quick app, that must be able to save a file under a given name. In the FileDialog component you can only set a directory. This is not very user-friendly, since you don't want to type in a filename by hand every time you download…
Simon Warta
  • 10,850
  • 5
  • 40
  • 78
12
votes
3 answers

Change text color for QML controls

I am using some QML controls like GroupBox and CheckBox which have text associated with them. The default color of the text is black. However, I have these items on a dark background and would prefer using white for the text color. These items…
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
11
votes
4 answers

Difference between the qtquickcompiler and the new JIT .qmlc cache?

I'm a little bit confused about the qtquickcompiler, the JIT qml caching and what is available (and what is not) in the open source version of qt 5.8 (respectively 5.9). Basically, I want to protect my .qml and .js files from being readable in my…
gekko42
  • 368
  • 3
  • 14
11
votes
3 answers

How to create a round mouse area in QML

I have a basic custom button using a Rectangle with radius: width/2. Now I add a MouseArea to my button. However the MouseArea has a squared shape. That means the click event is also triggered when I click slightly outside the round button, i.e. in…
Varius
  • 469
  • 3
  • 17