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

Using c++ enum in QML as string

What I would like to do is use the below enum in c++: class MyClass : public QQuickItem { Q_OBJECT Q_PROPERTY(MyEnum enumValue READ getEnumValue) public: enum MyEnum{ MyEnumElement = 0 }; Q_ENUM(MyEnum) slots: …
Ayberk Özgür
  • 4,986
  • 4
  • 38
  • 58
8
votes
1 answer

How to create a generic object model for use in QML?

I would like to know if there is any macro or way how to register Qt model as property of QObject. For example, I have AnimalModel (http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html#qabstractitemmodel). I Know I can pass it to root…
Ludek Vodicka
  • 1,610
  • 1
  • 18
  • 33
8
votes
2 answers

QtQuick: how to override window close event?

My experience in Qt is about two weeks, excuse me if I happen to ask a stupid question. My program uses QtQuick-based GUI. I initialise it in my main.cpp #include #include #include…
krokoziabla
  • 695
  • 1
  • 6
  • 21
8
votes
4 answers

Populate GridLayout with Repeater

I try to add cells to my GridLayout by using a Repeater. My data is stored in a model and containing two properties per element: Title Value My goal is to get a GridLayout containing the Title in first cell and the Value in the second cell of each…
Marcus
  • 1,910
  • 2
  • 16
  • 27
8
votes
1 answer

Cannot assign to non-existent property

I am trying to make a very simple program to learn how to define custom QML types for reuse. I'm not sure why I'm getting the following error: Cannot assign to non-existent property "color" I have searched for an answer and have not found…
stuffatwork190
  • 147
  • 1
  • 1
  • 10
8
votes
2 answers

How to programmatically press QML Button?

I am building a dialog in QML. I have some TextField, but I'd like that if the user presses enter (accepted signal is emitted), the id: okButton is pressed, actually activating it visually for a moment. I see that the pressed property is read…
Zsolt Szatmari
  • 1,219
  • 1
  • 12
  • 29
8
votes
3 answers

Blurred Qt Quick Text

This is an example from Qt Quick examples inside Qt Creator, when I run the project all texts lost their quality and blurred, the attached picture describes clearly the problem. Qt Version: 5.4.1 Platform: Windows 7
Reza Ebrahimi
  • 3,623
  • 2
  • 27
  • 41
8
votes
2 answers

Do not repaint window during resize

My QML application (Qt 5.4) is based on a Window item. The application can be resized by the user. When the application is resized the content of the application is being resized respectively (with onWidthChanged and onHeightChanged). This is all…
daybyday
  • 163
  • 2
  • 7
8
votes
2 answers

Inner shadow on QML Rectangle

How do I implement a Rectangle in QML with an inner shadow? See example in link below: Create inner shadow in UIView UPDATE: Here's a simplified version of what I'm trying to do (which does not show any shadow): import QtQuick 2.0 import…
daybyday
  • 163
  • 2
  • 7
8
votes
5 answers

Android back button press doesn't trigger keys.onreleased qml

I am creating a program in Qt5.3 and Qtquick2.1. I am trying to capture back button press on android in my code using Keys.onReleased. But that event is not getting triggered. Also I have set the item focus to true. But still no success. Here is the…
AmarSneh
  • 103
  • 1
  • 6
8
votes
2 answers

QtQuick - button onClick event

Background story So I recently decided that I should try out Qt. I started making a QtQuick Apllication. In my designer view I have one button and a mouse area. What I want to do: When I click the button, I want to display a message box with some…
lyubolp
  • 349
  • 2
  • 5
  • 12
8
votes
4 answers

QML: move to next control in form

How can I move focus from one control to next one inside QML form? By default it works with Tab button but I need to change it to Enter. All the control are ordered with Gridlayout with 2 columns.
folibis
  • 12,048
  • 6
  • 54
  • 97
8
votes
3 answers

QML TableView access model properties from delegate

I have a TableView for which I've defined my own itemDelegate. Now, from within this delegate I can access the value for the column using styleData.value, but I'd also need to access the other properties in this same item but I can't find how to. I…
Pablote
  • 4,745
  • 9
  • 39
  • 46
8
votes
1 answer

What is the proper way of deploying C++ QML plugins on mobile device?

I've been playing a lot with the Box2D QML plugin and the things are looking really good. However, I wanted to deploy my sample app on Android (SGS2), but I can't seem to get it work. Whether I try to run it on AVD or on the device, it doesn't work.…
Amy
  • 1,814
  • 2
  • 23
  • 38
8
votes
4 answers

QML- Right Click Not Detected in MouseArea

I'm working on an image editor and specifically working on setting the current left or right button's associated color using a MouseArea (inside a Button type). The problem I'm having is that I can't seem to filter for particular buttons at all.…
Cave Dweller
  • 502
  • 2
  • 4
  • 17