Questions tagged [qquickitem]

The QQuickItem class provides the most basic of all visual items in QtQuick Module.

The QQuickItem class provides the most basic of all visual items in QtQuick Module.

All visual items in Qt Quick inherit from QQuickItem. Although a QQuickItem instance has no visual appearance, it defines all the attributes that are common across visual items, such as x and y position, width and height, anchoring and key handling support.

77 questions
2
votes
2 answers

How to get a valid instance of a QQuickItem on C++ side

Alright. I have searched a lot but haven't got a good solution yet. I am new to Qt. I have a class which is a QQuickItem like so, class MyQuickItemClass : public QQuickItem { Q_OBJECT SetInfo(SomeCppClass object) }; I do a qmlRegisterType…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
2
votes
1 answer

Clip children of custom qml item after custom shape

I have a custom QQuickItem which I created and I wanted to create a rounded cornered window. So I implemented a QQuickPaintedItem and exported to QML. The problem is that the item's children are expanding by the item's bounding rectangle, which is a…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
2
votes
1 answer

QT QML Items both in C++ and QML

My goal is to describe a qml item in a qml file and then use a corresponding C++ class to add to the visual representation of this item. I know it is possible to describe a qml item and use it in qml file and the communicate with it from c++ through…
PsiX
  • 1,661
  • 1
  • 17
  • 35
2
votes
1 answer

Where does the boundingRect of QQuickItem class get its values from?

http://doc.qt.io/qt-5/qquickitem.html QSGNode *MyItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *) { QSGSimpleRectNode *n = static_cast(node); if (!n) { n = new QSGSimpleRectNode(); …
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
2
votes
0 answers

Qt Rectangle over QQuickItem not rendered properly

I have a painful issue in QT5 using QQuickItem. I had to draw a 3D model using pure openGL in QML, so I created my own custom QQuickItem. Untill now everything works as expected: the 3D model is beautifully displayed in QML. The problem appears when…
Ispas Claudiu
  • 1,890
  • 2
  • 28
  • 54
2
votes
0 answers

recognize gesture in a QQuickPaintedItem

I want to create some gestures for my QQuickPaintedItem In the normal QWidgets we have the method gestureEvent(QGestureEvent *event) (look here) But how can I get these events in a QQuickItem?
501 - not implemented
  • 2,638
  • 4
  • 39
  • 74
2
votes
3 answers

QQuickItem instantiation from C++ and setup conundrum (not allowed to pass anything to the constructor)

I find myself in a pickle trying to dynamically instantiate custom QML elements from C++. So, to layout the problem: I have a light-weight Node object data structure that is abstracted from any UI. Because of the memory heavy QObject and derived, I…
dtech
  • 47,916
  • 17
  • 112
  • 190
1
vote
0 answers

How to wait layout sistem to determine item's size when exposing QML item to C++?

I am working on a spesific case about taking images from a running QML application. I do that by rendering QQuickItems(which is exposed from qml) on a off-screen window to grab their images. Exposing & passing part: (this can be done in main.cpp) …
dynerp
  • 76
  • 6
1
vote
0 answers

Why childrenRectChanged is not emitted, but calling childrenRect "fixes" it?

Goal I need to know when and how the collective geometry of the children of Foo, a subclass of QQuickItem, changes. Problem I have connected a lambda to the QQuickItem::childrenRectChanged signal, but it is never emitted. Strangely enough, if I call…
scopchanov
  • 7,966
  • 10
  • 40
  • 68
1
vote
0 answers

How to animate some property of custom `QQuickItem` based class using C++?

As we know, Scene Graph has special multithreaded v-sync aware render technology. Also QtQuick has special C++ classes specified with QSG* prefix names and are strongly recommended to be used only those classes inside QQuickItem. So is it ok to use…
S.M.Mousavi
  • 5,013
  • 7
  • 44
  • 59
1
vote
1 answer

QML Flickable with TextArea: property binding for contentY is overwritten - by whom?

I'm making a terminal widget. I want the Flickable to scroll down to the latest input when TextArea.text is updated. My code looks like as follows. ColumnLayout { anchors.fill: parent Flickable { id: scroller clip: true …
1
vote
2 answers

How to measure time taken for QML item to appear on the screen since it was loaded?

How can I measure time passed since the moment I have changed source or sourceComponent property of QML Loader to the moment visual item actually appeared on the screen (got painted)? Loader { id: _loader source: "MyVisualItem.qml" } I…
senx
  • 630
  • 9
  • 18
1
vote
1 answer

How to hook up to the onClick event of a QML item from C++ side

Scenario: I have a Qt app which runs on Qt 5.9.4 commercial edition. Its a QtQuick and QML based application which is running on iOS and Android. I have a QML item on the UI like this: SomeItem { text: qsTr("Some Item") objectName:…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
1
vote
1 answer

Equivalent among qml-child-items of the QObject::findChild function

T QObject::findChild allows you to search through the children a specific object by class and by name : QPushButton *button = parentWidget->findChild("button1", …
ymoreau
  • 3,402
  • 1
  • 22
  • 60
1
vote
0 answers

QQuickPaintedItem in a Flickable becomes blurry when the contentwidth is large

I have a class that inherits QQuickPaintedItem with which I override paint() to draw an audio waveform. Once the drawing is done I resize contentWidth of Flickable containing the qml element I create with qmlRegisterType. The larger contentWidth…
ALDSMQJF
  • 19
  • 5