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
0
votes
2 answers

Subclassing QGraphicsView, custom mouse events

I'm subclassing QGraphicsView and what I'd like to do is: if the MidButton is pressed while the mouse is moving then we do as if we were using the regular QGraphicsView course of action but with the left button pressed which is sliding the image. I…
Leo
  • 1,129
  • 4
  • 23
  • 38
0
votes
1 answer

Shifting a QGraphicsItem's "graphic"

I have a QGraphicsItem with a custom graphic as shown below in the top half of the figure, where the red circle is the shape() of the item: Is there a way to preserve the graphic but just shift it like shown in the bottom half of the figure?
JustinBlaber
  • 4,629
  • 2
  • 36
  • 57
0
votes
1 answer

Qt: QGraphicObject and QImage

I have a QGraphicsObject derived class that holds a QImage and ovveride paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) In the pain I succefully draw the QImage. The QGraphicsObject is an item of QGraphicsScene,…
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
0
votes
1 answer

QGraphicsView subclass and events

In my project I have a QGraphicsView and a QGraphicsScene. I need to add some extra events to my view so I've subclassed QGraphicsView. The problem is that when I set a mousePressEvent I override the drag mode ScrollHandDrag. My question is the…
Leo
  • 1,129
  • 4
  • 23
  • 38
0
votes
1 answer

Reposition graphics items on window resize

Ok, I basically have randomly placed graphics items on a graphics scene. I open a window and display these items. When I resize the window, I want this items to stay the same size but reposition proportionally to the window size. How I did this was…
JustinBlaber
  • 4,629
  • 2
  • 36
  • 57
0
votes
1 answer

How to measure how long drawing takes in QGraphicsView

I'm trying to figure out how long it takes my QGraphicsView to redraw. I have tried the following: QElapsedTimer timer; timer.start(); complexViewTransformation(); qDebug() << timer.elapsed(); The problem is that I am getting very small results…
Anthony
  • 8,570
  • 3
  • 38
  • 46
0
votes
0 answers

Access violation on clearing qt scene

I have a class which contains a QGraphicsScene. In some function I wish to "clear" this scene from all items (& then fill it up with new items). I tried the following code, but that gave me an access violation: NewScene->clear(); NewScene is…
paul23
  • 8,799
  • 12
  • 66
  • 149
0
votes
2 answers

Can't animate QTransform in qgraphicsItem

I'm trying do some 3D animation in GraphicsScene, for example, to rotate pictures in GraphicsScene (using class, subclassed from qPixmapItem and QObject, if it matters) with Animation framework. Everything works fine, until i want to rotate pictures…
undefined
  • 1,354
  • 1
  • 8
  • 19
0
votes
1 answer

Update a specific QGraphicsObject by moving other objects

I want to show a finite automata in a QGraphicsView. Subclassing QGraphicsItem I have a class representing state: Node which holds pointers to Link instances which specify moves between states. Each link also holds its origin and destination…
sorush-r
  • 10,490
  • 17
  • 89
  • 173
0
votes
1 answer

Overlaying image within larger image using QGraphicsView or QGraphicsScene

I'm new to Qt, so I might mangle this question. Having said that- I'm rendering an image within a subclassed QGraphicsView. I added the image to the scene as a Pixmap with addPixmap(). I'd like to overlay (blit) smaller images on top of the…
Mike O'Malley
  • 335
  • 1
  • 4
  • 17
0
votes
1 answer

A custom widget to display and select among multiple graphic views

I have a collection of images, dynamically generated through QGraphicsView widgets, and i'd like my users to choose between them. For that purpose, i would display inside a custom widget available images in some kind of grid and have users click the…
Benoît
  • 16,798
  • 8
  • 46
  • 66
0
votes
2 answers

Weird bug in Qt application

In my application, I have my re-implemented QGraphicsView checking for a mouseReleaseEvent(), and then telling the item at the position the mouse is at to handle the event. The QGraphicsItem for my view is made up of two other QGraphicsItems, and I…
Rikonator
  • 1,830
  • 16
  • 27
-1
votes
2 answers

How to read fixed-width data?

data looks like 212253820000025000.00000002500.00000000375.00111120211105202117 212456960000000750.00000000075.00000000011.25111120211102202117 212387470000010000.00000001000.00000000150.00111120211105202117 need to add separator…
Suri.B
  • 11
  • 1
-1
votes
1 answer

How to get current visible portion of QGraphicsView in Qt?

I have QGraphicsView, which has multiple QGraphicsItem's. On this view, I am applying some transformation using features like Zoom-in, zoom-out, fit -In etc. So before applying fit-in feature on my current view, I want to store view's current…
tushar
  • 313
  • 4
  • 10
-1
votes
2 answers

svg background for QGraphicsView C++

I would like to put an svg image as background to my QGraphicsView without repetition and preserving the ratio. Can you help me? Thanks.
tyler
  • 13
  • 6