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

QtCreator new project Qt Quick Controls vs. Qt Quick

I want to create new Qt Quick project in Qt Creator and I've pressed New project, selected application name and location in Wizard, but then I am confused at next wizard's step (Qt Quick Component Selection), as seen in screen-shot: Which set…
KernelPanic
  • 2,328
  • 7
  • 47
  • 90
10
votes
1 answer

Example large scale project using QML?

I was searching for a open software project (medium or large scale) that uses QML and could be taken as an example of QML/QtQuick usage in practice. There are indeed a lot of small examples that come with the documentation but are there any actively…
Vikas Bhargava
  • 691
  • 1
  • 9
  • 22
10
votes
3 answers

QML TableView with dynamic number of columns

I have been trying to use a QML TableView to display a QAbstractTableModel. The missing part of the equation seems to be that it is not possible to have a variable number of columns in the TableView, despite overriding QAbstractItemModel::roleNames…
sjdowling
  • 2,994
  • 2
  • 21
  • 31
10
votes
3 answers

ListView scrolling animation

I want to implement a scrolling animation for QML ListView. Here is a sample image: Can anybody advise me for implementing this? Thank you.
S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59
10
votes
2 answers

How to change the color (background, text) of header of TableView in Qt5?

I use TableView for my application in Qt5. It's possible to change color (background, text and alternate) of rows of this table, but there is no options for changing color of headers (titles). How to do that?
alr
  • 1,332
  • 3
  • 13
  • 23
10
votes
1 answer

How to show a context menu on right click in TableView rowDelegate

I want to show a context menu when right-clicking on TableView rows. I tried this code: import QtQuick 2.0 import QtQuick.Controls 1.0 TableView { id: tableView width: 300 height: 200 TableViewColumn { role: 'a'; title: 'a'; width: 50…
silviubogan
  • 3,343
  • 3
  • 31
  • 57
10
votes
3 answers

How to add and use a resource in QML?

I want to use a QtQuick Image object in a simple Qt project, and include the image in the project. I have added the image to the resource file. I have used debugging to be sure that the resource exists and is compiled into the application as…
DJClayworth
  • 26,349
  • 9
  • 53
  • 79
10
votes
2 answers

Are "var" and "variant" the same thing?

From what I understand, to make a property an array in QML you must specify it as the type variant or var: property var myArray:[] And this appears to be exactly the same as: property variant myArray:[] Is this true?
johnbakers
  • 24,158
  • 24
  • 130
  • 258
10
votes
5 answers

QtQuick2 dragging frameless window

I’m looking for a way of dragging frameless window in QtQuick2. I followed this thread on the forum Link but it gives me an error. Main difference in the code is that my code uses QtQuick2ApplicationViewer instead of QmlApplicationViewer and it…
Majster-pl
  • 148
  • 1
  • 1
  • 8
9
votes
1 answer

Parent is null in ListView delegate after upgrade to Qt 5.15

A ListView with a most simple delegate produces lots of warnings "21:35:31.911 warning T#16084047 unknown - qrc:/main.qml:15: TypeError: Cannot read property 'left' of null" if trying to set it's delegate anchors property and scrolling the list…
Ribtoks
  • 6,634
  • 1
  • 25
  • 37
9
votes
1 answer

Purpose and usage of ItemSelectionModel in QML

While skimming the QML Documentation, I found this commendable documented class: ItemSelectionModel There is the C++-Class QItemSelectionModel which provides some more detail on it's purpose to keep track on the selection of Items within a…
9
votes
1 answer

QML ListView, How to make list elements to not overlap the header, when scrolling

I have ListView with a header delegate enabled. I have a header positioning property set to "OverlayHeader". The header will stay in place when scrolling through the elements. However, the elements will overlap the header. Is there a way to…
EnriqueH73
  • 177
  • 1
  • 2
  • 8
9
votes
1 answer

How to change the cursor's shape without using MouseArea?

I looked over the similar threads but it didn't help much. I'm using QtQuick.Controls.Button in QML and I cannot change the cursor shape when hovering over the button! I want to achieve this without using MouseArea. What can be done? As I looked…
Ispas Claudiu
  • 1,890
  • 2
  • 28
  • 54
9
votes
5 answers

Flow layout with centered content

I have a row with items which should stack when the window width gets too small for displaying all items in a row, as shown in the following sketch: The Flow component stacks the items but they are not centered but aligned on the left or right…
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
9
votes
3 answers

C++ class exposed to QML error in fashion TypeError: Property '...' of object is not a function

I've successfully exposed a C++ class to QML. It is registered and found in Qt Creator. It's purpose is to connect to a database, as shown in following code: #ifndef UESQLDATABASE_H #define UESQLDATABASE_H #include #include…
KernelPanic
  • 2,328
  • 7
  • 47
  • 90