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
84
votes
2 answers

Difference between qt qml and qt quick

I'm confused with QML, QtQuick 1.0 and QtQuick 2.0. What's the difference between them? I use QtCreator 2.8.1 based on Qt 5.1.1. I want to develop a desktop program, which technology should I use?
骑天大圣
  • 854
  • 1
  • 6
  • 8
55
votes
9 answers

How to access C++ enum from QML?

class StyleClass : public QObject { public: typedef enum { STYLE_RADIAL, STYLE_ENVELOPE, STYLE_FILLED } Style; Style m_style; //... }; The .h file has the above code. How to access…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
45
votes
1 answer

error: Unknown module(s) in QT: qml quick - Qt Creator

I installed Qt Creator via the Software Manager on Linux Mint 18 (x86_64). I made a few sample projects, and some dependencies/packages/libraries/whatever were missing, so I installed the via apt. I made a QtQuick application and in Issues there is…
darijan2002
  • 1,485
  • 1
  • 10
  • 14
43
votes
8 answers

Image rounded corners in QML

To my surprise, the Image component has no radius property. I tried emulating the rounded corners by putting the image in a rounded Rectangle, but it does not clip the corners. Rectangle { anchors.right: rectContentBg.left anchors.top:…
Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
42
votes
1 answer

How can I access my Window object properties from C++ while using QQmlApplicationEngine?

I've been trying to learn QtQuick for GUI creation, but I've been having a hard time understanding how to interact with QML objects from the C++ part of my test program. Here's my simple QML file: import QtQuick 2.2 import QtQuick.Window 2.1 Window…
MrKatSwordfish
  • 1,504
  • 5
  • 18
  • 30
35
votes
7 answers

Different delegates for QML ListView

I would like to know if it's possible to use (several) different delegates for a QML ListView. Depending on the individual object in the ListView model, I would like to visualize the objects with different delegates. This piece of code explains…
dh1tw
  • 1,411
  • 2
  • 23
  • 29
34
votes
6 answers

QML: List all object members/properties in console

Is there any way to list all object members/properties in QML & Qt 5.1? Such as: var obj=myQObject; console.log(obj) // expected output: // obj { x:123..... } This would be very helpful for debugging.
tirth
  • 813
  • 1
  • 8
  • 16
32
votes
2 answers

What is the difference between QQmlApplicationEngine and QQuickView?

I'm using QQmlApplicationEngine as follows: QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); app.exec(); But now I want to enable multisampling for my app, and…
Stefan Monov
  • 11,332
  • 10
  • 63
  • 120
31
votes
9 answers

Accessing C++ QLists from QML

If I've got a list of things in C++, how do I expose that to QML (in Qt5 / QtQuick 2)? It seems like QML can only understand QObject-derived classes, which is an issue because QObjects can't be put in a QList or copied. How do I do this: struct…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
30
votes
2 answers

QML: Component vs Item as a container

What is the difference between Component and Item in QML ? The documentation is not absolutely clear here. What is the preferred type to use as a container for several widgets? Can it be replacable by Rectangle? For example, what is the difference…
Dmitry
  • 1,912
  • 2
  • 18
  • 29
29
votes
4 answers

How to include child mouse hover events in the parent MouseArea using QML?

I want to implement the following scenario in QML. Here is a sample/simplified delegate for ListView element: Component { Item { id: container MouseArea { anchors.fill: parent hoverEnabled: true …
S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59
28
votes
7 answers

CMAKE_PREFIX_PATH doesn't help CMake in finding Qt5

From here: https://stackoverflow.com/a/28327499/462608 I tried this: cmake_minimum_required(VERSION 2.8.12) project(qtquick_hello_cmake) set(CMAKE_PREFIX_PATH "/opt/Qt5.9.1/5.9.1/") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
26
votes
2 answers

What is the difference between Row and RowLayout?

This works as intended with Row, but not with RowLayout. Why? What is the difference between the two? ApplicationWindow { title: "Testing" width: 640 height: 480 //RowLayout { Row { anchors.fill: parent …
Patric
  • 763
  • 1
  • 8
  • 17
24
votes
4 answers

How to declare list property in QML

How do I declare a list property in QML (for use with Qt.labs.settings in my case): Settings { property list recentFiles: [] } Does not work. I've tried many other options: list, string[], etc. None seem to work.
Timmmm
  • 88,195
  • 71
  • 364
  • 509
22
votes
2 answers

How to find the latest versions of all QML modules

Usually my QML files start with import QtQuick 2.4 and other imports. How can I know which is the latest version of the imported modules without having to guess by type and build?
Uga Buga
  • 1,724
  • 3
  • 19
  • 38
1
2 3
99 100