Questions tagged [qgraphicswidget]

In the QT framework, QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

In the QT framework, QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

http://doc.qt.io/qt-5/qgraphicswidget.html

30 questions
4
votes
1 answer

Rendering a QGraphicsScene with QGraphicsVideoItem to QImage

This part is solved I want to render a QGraphicsScene with QGraphicsVideoItem to QImage. Everything works when the QGraphicsScene is just with a QGraphicsTextItem. However, if I replace QGraphicsTextItem with a QGraphicsVideoItem, it fails to get a…
3
votes
1 answer

How do I scale/resize a QGraphicsWidget based on the QGraphicScene?

I would like my QGraphicsWidget to scale its size based on the size of the scene. The QGraphicsWidget I have currently is a fixed size depending on the return value of sizeHint (QGraphicsWidget is always 200 x 200). Attached below is minimal…
Michael Japzon
  • 201
  • 1
  • 2
  • 10
2
votes
2 answers

Why is the selection border of a QGraphicsWidget not visible in QGraphicsScene?

I have added a widget to a graphic scene (QGraphicScene) through a QGraphicsProxyWidget. The problem is that when I select the item it's selected, but the selection border is not visible. Here is the code: QDial *dial= new QDial(); // Widget …
Sagar A W
  • 338
  • 1
  • 12
2
votes
1 answer

QGraphicesItem emit a signal upon hoverEnterEvent

What is the best method/practice for emitting a signal upon entering either a QGraphicsWidget or a QGraphicsItem ? In my MWE I would like to trigger a call to MainWindow.update, from Square.hoverEnterEvent, whenever the user mouse(s) over an item in…
Carel
  • 3,289
  • 2
  • 27
  • 44
1
vote
1 answer

How to fix "cannot initialize a variable of type 'QGraphicsProxyWidget *' with an rvalue of type 'QGraphicsLayoutItem *'"?

I want to parse the QGraphicsGridLayout, but getting this error. The thing is I was able to add QGraphicsProxyWidget as an item but not able to retrieve it. I want to know how to convert a QGraphicsLayoutItem* to QGraphicsProxyWidget* in this line…
surya sai
  • 11
  • 3
1
vote
1 answer

Readjust the Custom QGraphicsWIdget's size on inserting widget

I have created a custom QGraphicsWidget with the ability to resize the widget in the scene. I can also add predefined widgets such as buttons, labels, etc. to my custom widget. I now have two problems. The first being that the widget doesn't change…
JacksonPro
  • 3,135
  • 2
  • 6
  • 29
1
vote
1 answer

How to generate mouse click on QGraphicsWidget in QTest?

I want to test the functionality of pressing a button from my panel. The problem is that the button is not QPushButtons, but rather QGraphicWidget elements. How do I generate this button mouse-click to test its behavior? Buttons are not simple…
siadajpan
  • 55
  • 6
1
vote
1 answer

How to automatically set rect correctly in QGraphicsView?

I have a couple of different issues that I am trying to solve and I cannot figure out. I have not worked with QGraphicsView etc much before but I created a QGraphicsView that I am trying to load images in and I am trying to use a QSpinBox to…
Richard
  • 445
  • 1
  • 5
  • 21
1
vote
1 answer

Is it possible to embed a QWidget inside of a custom QGraphicsWidget?

I would like to embed a QWidget such as a push button or progress bar in my QGraphicswidget, but I have only seen examples of adding a QWidget to a QGraphicsScene i.e. m_scene->addWidget(new QPushButton("Test Test")); In my custom graphics widget I…
Michael Japzon
  • 201
  • 1
  • 2
  • 10
1
vote
1 answer

Drawing Text In a QGraphicsWidget::paint function

I'm trying to draw text inside a qgraphicswidget. The scale of the scene is -180 to 180 in the horizontal and -90 to +90 in the vertical (it's a world map). When i zoom in to individual items on the map, i want some text to show up. My code for the…
jasonlg3d
  • 484
  • 2
  • 7
  • 18
1
vote
1 answer

How to perform swap of QGraphicsItem(s) in QGraphicsView?

My idea in this project is to perform swap animation on items. Problem is however that when I perform swap on items for the first time they keep their position still, but when the other animation starts that involves already swapped items, those…
Vadixem
  • 99
  • 9
1
vote
1 answer

QGraphicsview + scene + QGroupBox movement issue

For past few days I was trying to solve the issue of widget movement. At some point I tried rewriting QComboBox classes with mouse signals but that did not work. As a work around I settled for parenting my widget to a QGraphicsWidget but once I try…
Dariusz
  • 960
  • 13
  • 36
1
vote
2 answers

How to get widgets (QGraphicsProxyWidget) of QGraphicsScene?

I am making use of a QGraphicsScene and I am adding regular widgets (QLineEdit, QComboBox, etc.) to it via implicitly created QGraphicsProxyWidget objects: m_pLineEdit = new QLineEdit("", 0); m_pProxy = m_pGraphicsScene->addWidget(m_pLineEdit); I…
Philip Allgaier
  • 3,505
  • 2
  • 26
  • 53
1
vote
1 answer

QGraphicsWidget as a child of QObject

is this possible to have a tree-like structure of QObjects and (for example) QGraphicsWidgets ? I mean, I cannot write initialization Lists like these: class MyButton : public QGraphicsWidget { Q_OBJECT public: MyButton(int buttonId, QObject…
Dennis S
  • 315
  • 3
  • 13
0
votes
0 answers

How to style the window decorations of a QGraphicsWidget with the Window flag?

This short program import sys from PySide6.QtCore import Qt from PySide6.QtWidgets import ( QApplication, QGraphicsScene, QGraphicsView, QGraphicsWidget, ) app = QApplication(sys.argv) scene = QGraphicsScene() view =…
JuanT
  • 69
  • 6
1
2