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
1 answer

Painting a QGraphicsItem based on the QGraphicsView it is displayed in

I am writing an image processing application in Qt5. The imagery is natievly 16-bit colordepth, and needs to be adjusted to 8-bit for display. In the normal case, I analyze the data currently visible in the QGraphicsView and create a dynamic map to…
Chris Arguin
  • 11,850
  • 4
  • 34
  • 50
0
votes
0 answers

How to draw sin wave or simple 2DGraph in Qt cpp using QGraphicsView

Can any one help me in drawing simple 2D sin wave plot in Qt using QGraphicsView? after some googling i found some info here Using Qt To Draw the Graph of Sin(x). but i am restricted to use only QGraphicsView without Qpainter.Thanks
vishnu
  • 363
  • 3
  • 20
0
votes
1 answer

Add QRectGraphicsItem

I'm trying to learn Qt by developing a simple GUI. Part of what I need to do is add a rectangle to one of three QGraphicsView areas I have made. I used the following code MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new…
Batman
  • 3
  • 1
0
votes
1 answer

Detecting Mouse Event over Multiple Graphics View

I have a class "SceneWindow" which inherits QGraphicsScene. I have a mouse move event which emits the current x and y position of the mouse on the scene. In my main window class I have four graphicsview which I use to display different images. I…
Sid411
  • 703
  • 2
  • 9
  • 25
0
votes
1 answer

Position parentless scene item under another scene item

In my game, I'd like to fire rockets from a rocket launcher. The player holds a rocket launcher as a child item. The rockets must be parentless. I'm trying to position the rocket so that its back lines up with the back of the rocket launcher (the…
Mitch
  • 23,716
  • 9
  • 83
  • 122
0
votes
2 answers

How to make manually calculated orbital paths agree with Qt's ellipse drawing method?

I'm attempting to draw celestial bodies moving around on simplified, perfectly circular orbits. I'm also drawing the projected orbital paths these objects will take. However, the problem is that the actual path the objects take doesn't agree with…
Abu Dhabi
  • 311
  • 4
  • 13
0
votes
1 answer

What is the status of Qt's ItemViewsNG project?

A long time ago Digia announced "next generation" item views in upcoming versions of Qt, dubbed ItemViewsNG. As of version 5.2, it looks like all model/view controls are still based on the old QAbstractItemModel design. Specifically, I'm looking for…
Tony the Pony
  • 40,327
  • 71
  • 187
  • 281
0
votes
0 answers

How do I convert the rotated/resized line item coordinate (point P1)to local coordinate system?

I have a custom line item which is subclassed from QGraphicsLineItem. When mouse move event occurs on the line item edge, I rotate or resize the line accordingly. My problem is that before perfroming rotation or resizing, the line item exists in…
jeevan_reddy
  • 43
  • 1
  • 10
0
votes
0 answers

Issue saving QGraphicsScene to a PNG file

I have a QGraphicScene object that I can save to a PNG file just fine as long as I haven't made any modifications like a scroll or a zoom on the item. After performing a scroll or a zoom, the saved image becomes small with a lot of transparent…
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
0
votes
1 answer

Qt :: QGraphicsPixmapItem : overriding paint() method?

I want to override QGraphicsPixmapItem that can show an Image and can draw using QPainter on the same item. I have overridden the class and mouse event and paint methods.When ever i click button it successfully calls mouse and paint events but it…
Saurabh Gohil
  • 75
  • 1
  • 1
  • 9
0
votes
0 answers

Qt: QGraphicsView content not erased before drawForeground() is called

I'm facing an annoying issue using Qt QGraphicsView framework. I write a basic image viewer to display large B&W tiff images. Images are displayed using a QGraphicsPixmapItem and added to the scene. I also need to draw a colored rectangle around the…
Zyend
  • 572
  • 1
  • 4
  • 24
0
votes
0 answers

Draw part of rectangle intersecting in QGraphicsScene

I have a QGraphicsScene on which I show a video . I have another red colour rectangle which is QGraphicsItem. This rectangle (QGraphicsPixmapItem) lies on the image on QGraphicsScene. I have a yellow rectangular box (QGraphicsItem) which I use to…
Sid411
  • 703
  • 2
  • 9
  • 25
0
votes
2 answers

Scale a QGraphicsView without Scaling a QWidget that has been added to it

I have subclassed QGraphicsView to have some wheel events that make it zoom in and out. When the wheel is scrolled the zoom function is called which scales the GraphicsView if(zoom_in) { factor = 2.0; } else { factor =…
AngryDuck
  • 4,358
  • 13
  • 57
  • 91
0
votes
1 answer

Accessing coordinates within each curve of SVG

I am using Qt framework to develop a desktop application. I want to load, do some modification and save. So I basically need to access some coordinates within each curve (i.e. control points for Bezier curves, or just even vertices of polylines). I…
0
votes
1 answer

Ignore drawForeground() from the scene on the 2nd graphicsview in qt

I have my own QGraphicsScene and two QGraphicView’s. In the QGraphicsScene I use the drawForeground(QPainter *painter, const QRectF &rect) function to draw a grid. Now I want the grid only to be visible in the first, but not in the second view…is…
Captain GouLash
  • 1,257
  • 3
  • 20
  • 33