Questions tagged [qgraphicsview]

A QGraphicsView is a class from the Qt toolkit which provides a widget for displaying the contents of a QGraphicsScene.

The QGraphicsView class is part of Qt's Graphics View Framework and is used to visualize the contents of a QGraphicsScene in a scrollable viewport.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

1128 questions
-1
votes
2 answers

How to draw on QGraphicScene in real time?

i'm having trouble with making app like Windows Paint. I wanted to draw on my window while holding mouse button. I know there's MouseMoveEvent but it has really poor refresh rate for me. Because of that i wanted to create my own event. I tried some…
Tojmak
  • 155
  • 1
  • 7
-1
votes
1 answer

Why QGraphicsProxyWidget does not resize properly after dropping into QGraphicsView?

I have a QListWidget and a QGraphicsView both subclassed to overwrite some of their members. I prepared a minimal verifiable example showing the problem I have. From the QListWidget I can drag and drop specific field represented by a QTableWidget…
Emanuele
  • 2,194
  • 6
  • 32
  • 71
-1
votes
1 answer

Infinite QGraphicsView::resizeEvent calls

I have a custom layout BoardLayout, which inherits QLayout. It is written in analogy to BorderLayout example (https://doc.qt.io/qt-5/qtwidgets-layouts-borderlayout-example.html), with a following setGeometry() method: void…
user87035
  • 11
  • 3
-1
votes
1 answer

How to print data when a Selectable GraphicsItem is clicked?

I have a JSON file which contains coordinate list and some other information. My JSON structure look like this; "annotations": [ { "type": "Box", "color": "red", …
Sravan JS
  • 41
  • 1
  • 7
-1
votes
1 answer

How to Zoom / Fit Image to GraphicsView

I read a lot of posts/threads but I can't get it to work. I'd like to fit every Image to a GraphicsView regardless if it is smaller or bigger then the view. What's wrong? void frmMain::on_btLoadImage_clicked() { QGraphicsScene *scene; …
L.W.
  • 11
  • 3
-1
votes
1 answer

QTabWidget with QGraphicsView

I have a QTabWidget and second page containing a QGraphicsView with scene. The scene canvas is larger than the QGraphicsView's viewport and I'm using QScrollBar to move objects on the scene. On the scene I place a lot of QGraphicsItem objects. I…
End1-1
  • 11
  • 1
  • 4
-1
votes
1 answer

Qt QGraphicsProxyWidget interaction with QGraphicsScene

I'm trying to make a QSplitter with a QTreeView on the left hand side and on the right hand side, a QGraphicsView. This is super easy and I have this working. Now my goal is to embed widgets in the scene of the QGraphicsView, using the…
Blanky
  • 63
  • 9
-1
votes
1 answer

How can I move a QGraphicsPixmapItem that reachs the right (end) of graphicView to the left (begining) side(like what is happening in the snake game)

I have a QGraphicsView widget which displays a pixmap item. The user can move the item. When the item reachs the right (or the left) end of the graphicView, I would like the item enters from the other side (with the same X and Y coordination (like…
-1
votes
1 answer

How to resize image to fit in graphic view

I have code that displays an image with its name on listWidget. In that case the image won't fit in the graphics view. I tested some of resizing methods. But the images won't resize. How can I resize images to fit in? Please take a look my…
Zin Oo
  • 5
  • 7
-1
votes
2 answers

Co-ordinates for rectItem wrt to other rectItem in qgraphicsScene

In a qgraphicsScene, we have 2 rectItems added. Let's say, the red rect is added first and it's topleft coordinates are (x1, y1) wrt to the qgraphicsscene. Now a second blue rect is added in the scene, which overlaps the red rect. Now how can I get…
-1
votes
1 answer

Error With subclass QGraphicsScene

I'm trying to add ellipses to my Scene in Qt, but i get this error: XXXXXX/mainwindow.cpp:20: error: ‘class mqlabel’ has no member named ‘setScene’ ui->imageLabel->setScene(scene); and this…
Josh Miles
  • 21
  • 1
  • 4
-1
votes
1 answer

How do you change a QGraphicsScene from another function?

My program has a QGraphicsView called SimulatorGV and it has a QGraphicsScene called Simulation. In the main function I have drawn a few rectangles and ellipses. I want to be able to draw on the same scene in another function too. In essence, how do…
Alarming
  • 137
  • 1
  • 3
  • 14
-1
votes
1 answer

QGraphicsEllipseItem how to catch events

I'm working on MAC OS X / Qt 5.3 widget application and I've run into a problem. I have QGraphicsView containing scene with movable QGraphicsEllipseItem, but I don't know how to catch the end of a move event. What I'm trying to do is trigger a…
mishan
  • 1,177
  • 3
  • 19
  • 42
-1
votes
1 answer

Draw the dimensions on QGraphicsItem

I'm drawing a QGraphicsPolygonItem like this: I need to have the dimensions information on the scene, like this: I'm using QGraphicsPolygonItem, QGraphicsScene and QGraphicsView.
Mahmoud Hassan
  • 598
  • 1
  • 3
  • 15
-1
votes
1 answer

converting scene coordinates to graph coordinates

I’m having a scene with (0, 0, 2000, 2000) coordinated as a rectangle. now I just want to plot some points on the scene like graph coordinates like (-x, +y , +x, -y) of the item on the scene . consider of having a Cartesian coordinate points…
Wagmare
  • 1,354
  • 1
  • 24
  • 58
1 2 3
75
76