Questions tagged [qqmlcomponent]

In the Qt framework, the QQmlComponent class encapsulates a QML (Qt Modeling Language) component definition.

In the Qt framework, the QQmlComponent class encapsulates a QML (Qt Modeling Language) component definition.

http://qt-project.org/doc/qt-5/qqmlcomponent.html

149 questions
1
vote
1 answer

Communication between 2 different objects in 2 different QML files

I have one main.qml file and I have other "example.qml" file. When I push a button from "example.qml" file I want to change a text in "main.qml" file. I tried defining the source of the text. I tried send signal. I tried using loader but always came…
1
vote
1 answer

qml use same rectangle component for multiple objects

I am trying to reduce the size of qml file by calling same rectangle component and changing only the required fields and keep the rest same. The part shown below is working but want to reduce the size. Basically, I dont want to make moisture…
Mandeep
  • 335
  • 3
  • 13
1
vote
1 answer

Create qml object dynamically from c++ object (by using setContextProperty)

I am trying to create a qml object dynamically in c++ using the object of c++ class. Below is the minimal code for my approach. Upon execution of this code and after clicking, the application is crashing(see the comment in main.qml). I have pasted…
nayab
  • 2,332
  • 1
  • 20
  • 34
1
vote
1 answer

Is it possible to create a Qml Component from C++?

Is there some way to create/append a QML Component from C++? Example, if i have this QML: Window { id: window objectName: "windowName" title: "windowName" width: 480 height: 800 Rectangle { id: frmHeader …
Jhonny Pinheiro
  • 308
  • 3
  • 19
1
vote
1 answer

Dynamically created Custom QML object not visible

I have a custom QML item called "Cell.qml" which I'd like to insert dynamically in my root window and make it visible. I also tried changing the z property, but I couldn't fix it, the object is still invisible (even tough the output of…
1
vote
1 answer

Injecting Properties into QML-Component

I am fairly new to Qt/PyQt and currently struggling with some basic functionality. What I'm trying to do is, to dynamically load QML-Views (*.qml) files from python and replace specific content on the fly. For example a checkbox gets checked and…
spooky
  • 75
  • 1
  • 6
1
vote
0 answers

Handling touch events in a QML game

Part of my game includes a table in which there is a ball rotating. There are also two rectangles like rackets that a player can use for the game. At first I used a simple rectangle with a mouse area filling the racket and some drag properties. It…
Franky
  • 1,181
  • 2
  • 11
  • 33
1
vote
1 answer

Cannot assign to non-existent property when creating signal and using that

I want to create an signal so I have an qml file with name TestCreateSignal.qml with content like this: import QtQuick 2.0 Rectangle { color: "red" width: 344 height: 233 signal sendMessage MouseArea { onClicked: …
mohsen
  • 1,763
  • 3
  • 17
  • 55
1
vote
0 answers

How to view QML component with variable settings in Qt designer?

Well I've applied some singleton style in my QML components and with those variable settings I cannot see the proper QML designer view. It's clear that Qt Designer is not able to read those variable values from my style file and render properly. Is…
anupx73
  • 398
  • 5
  • 18
1
vote
0 answers

QML image clicked pixel

I have an image which is loaded into a quick map item, well I just want to find pixels row and column when user clicks on image, how can I get it? thanks here is my code MapQuickItem{ id:yes anchorPoint.x: image.width/10 anchorPoint.y:…
Majid Hojati
  • 1,740
  • 4
  • 29
  • 61
1
vote
1 answer

How to most correctly / efficiently refresh an Item whose source has changed?

I have a loaded qml file from the file system that changes, however since the first time it is loaded it is also cached, it doesn't refresh even if the Loader is "reset" via setting the source component to undefined. A similar questions has been…
dtech
  • 47,916
  • 17
  • 112
  • 190
1
vote
1 answer

QML FileDialog set title from C++ code

I have the following qml file: import QtQuick 2.2 import QtQuick.Dialogs 1.2 FileDialog { property string myTitle: "Select file to open" property string myfilter: "All files (*)" id: fileDialog objectName: "fileDialogObj" title: myTitle …
mtb
  • 1,350
  • 16
  • 32
1
vote
1 answer

qml: Can not access styleData in slider componet

I need the value of slider's handle width, but even if I just copy the example code from Qt document, the debugger still tell me: Cannot read property 'handleWidth' of null What did I do wrong? My code as below import QtQuick 2.0 import…
Anna
  • 53
  • 1
  • 9
1
vote
0 answers

QML "TypeError: Type error" when sending new source data to Loader component

So .. First of all, I am using FLUX architecture. I have this base scene where it loads another scenes. The loader is located in a loader storage. Let's say I clicked a button, I will send action to the scene store which gets the message and send it…
Z Mars
  • 159
  • 1
  • 14
1
vote
0 answers

QML Render the same Entity in two Scene3Ds

How can I insert the same entity to be displayed into more than one Scene3Ds in QML? (it'll probably be abundantly clear that I'm pretty new to QML) I would like to create something similar to the Multi Viewport QML Example, except I would like to…
Matt
  • 1,928
  • 24
  • 44