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
1
vote
2 answers

Trying to understand usage of Item a bit better?

I'm going through a tutorial on QML and they've started using Item as the base for every component they create, after using Rectangle for the first portion of the tutorial. The thing is, color doesn't seem to be a valid property on Item. I don't…
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
0
votes
0 answers

How to get QQuickWindow from QQmlEngine or QQmlContext?

I have the QQmlEngine and QQmlContext pointer with me. Is it somehow possible to get the QQuickWindow pointer of in the Qt application?
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
0
votes
0 answers

Qt hover event with pressed mouse on QQuickItem

I am using several instances of QQuickPaintedItem class that listen to hoverEnterEvent and hoverLeaveEvent, as well as mousePressEvent and mouseReleaseEvent. I have a need to select or deselect items when the cursor passes over them with the mouse…
0
votes
0 answers

Py QQuickPaintedItem not calling paint

I have a QQuickPaintedItem in PyQt5, but the "paint" method is never being called. I see this related question: Paint method of QQuickPaintedItem not called In that question, the reason that paint is never being called is because the custom object…
DJMcMayhem
  • 7,285
  • 4
  • 41
  • 61
0
votes
0 answers

Cannot display QImage correctly on QQuickPaintedItem providing world tranform matrix

In Qt Quick project, I derived a custom class from QQuickPaintedItem and mapped screen coordinate system to Cartesian coordinate system by providing a transform matrix, now I want to display a png on the custom class with QPainter->drawImage,…
James Hao
  • 765
  • 2
  • 11
  • 40
0
votes
0 answers

Accessing delegates in QML from C++

I am trying to access the delegate component of the listview in C++ and want to alter it. Like in the code below, I am using QAbstractListModel to provide model to the listview and i have a delegate defined inside the listview which takes two String…
kaddy
  • 109
  • 11
0
votes
1 answer

How do I add click events to a QQuickItem?

New Qt user here (also not an avid C++ programmer, so excuse me if my terminology isn't spot on). I am learning how to develop my own digital instrument cluster. I have managed to create my own graphical objects (horizontal bar graph) using…
kubiej21
  • 700
  • 4
  • 14
  • 29
0
votes
1 answer

Implement Scrolling for QQuickView containing multiple QQuickPaintedItems

So recently I started a project where I want to display a graph showing relations between different datasets. The graph consists of Edges and Nodes, while both of these classes inherit QQuickPaintedItem and override the paint(QPainter* painter)…
Sören
  • 45
  • 4
0
votes
1 answer

To paint some small tiles on the screen, should I use QQuickItem or QQuickPaintedItem?

Essentially I need to load up a 4-color tilemap in memory that's exactly 16K in size, animate 2 of the tiles maybe 3 times a second, and render out a few tiles into a fairly small box, I'd say maybe 100 or so pixels wide and maybe 80 pixels tall…
June
  • 383
  • 3
  • 12
0
votes
2 answers

How to assign custom object to sourceItem?

A would like to visualize MapQuickItem depend on if condition. I have two custom objects ClusterMarker which is a Rectangle and PromotionMarker which is an Image object. I would like to assign them to MapQuickItem (which is delegate for MapItemView)…
Leonid
  • 73
  • 1
  • 6
0
votes
1 answer

Drawing directly with QPainter and drawing QPixmap give different results

There's a simple class based on QQuickPaintedItem: class PaintedItem : public QQuickPaintedItem { Q_OBJECT public: PaintedItem(); void paint(QPainter *painter) override; }; // ... PaintedItem::PaintedItem() { …
Nikita
  • 337
  • 1
  • 3
  • 12
0
votes
1 answer

Qt : How to grab a snapshot of a QQuickItem leaving out its child QQuickItems from the grabbed result

My question is a follow up on this discussion. Yes. Following way of grabToImage can get me a snapshot of any particular QQuickItem like parent_rect below. Rectangle { id: parent_rect width: 400 height: 400 Rectangle { id:…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
0
votes
1 answer

How to transform the center of a QQuickItem to a new center

I have a Qt QML application. Following is the complete code of the application: Code: import QtQuick 2.9 import QtQuick.Window 2.2 Window { id: app_main_window visible: true width: 800 height: 600 title: qsTr("Hello QML") …
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
0
votes
1 answer

Qt : How to monitor a Q_PROPERTY change on C++ side instead of QML

I am using Qt 5.9.3. I have following property declared in my app's main.qml Code: //main.qml MyQuickItem { property color nextColor onNextColorChanged: { console.log("The next color will be: " + nextColor.toString()) } } //…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
0
votes
1 answer

Qt QML - create my own shape in Qt Location

I'm currently working on a Qt Quick application that will provide a map viewer. I want to create irregular shapes (more than one shape) and then put them on the map. is it a good way to do this with QQuickPaintedItem (Writing QML Extensions with…
Behzad
  • 121
  • 1
  • 16