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

How to use a complex OpenGL as background in QGraphicsScene?

I'm trying to create a display with a complex OpenGL image and some spinboxes on the image. Using http://doc.qt.digia.com/qq/qq26-openglcanvas.html I'm able to have a two layers object (inheriting from QGraphicsScene) with a simple OpenGL image as…
user1235648
0
votes
0 answers

Using qt's graphicsitem cast fails on QGraphicsPolygonItem

I have written code in my implemented QGraphicsScene to cast into a custom class from what QGraphicsScene::itemAt returns. Interestingly, qgraphicsitem_cast always returns zero, but using dynamic_cast works fine. Why is this? void…
c0nn
  • 317
  • 3
  • 18
0
votes
1 answer

Qt wait for user to select items in QGraphicsScene

So I have 2 QGraphicsScenes with QGraphicsViews in my ui. In those QGraphicScenes are QGraphicsItems, now I want to make my program wait to let the user select one QGraphicsItem om each Scene, but how do I do this? I've tried things…
Cédric Vandelaer
  • 153
  • 1
  • 5
  • 13
0
votes
0 answers

Containing a Rectangle inside another Rectangle

I didn't find a previous question that seemed to suit what I am asking, but I may not be asking the right thing either. I have two rectangles, one larger and one smaller. The smaller one can be moved and resized, but I need it contained inside the…
ooklah
  • 491
  • 1
  • 5
  • 16
0
votes
1 answer

QGraphicsView not showing the picture

I have a "tooltip.png" file in my local directory. the code below works when i put it in int main() but doesn't work when i put it in my MainWindow class constructor: QGraphicsScene scene; QGraphicsView *view = new…
Aidin.T
  • 731
  • 3
  • 10
  • 25
0
votes
1 answer

Placing a QWebView Over an Existing QGraphicsView

I'm trying to place a QWebView on top of an existing window that is just a QGraphicsView containing a single QGraphicsScene. Is there any way to do this without creating a new window? My goal is just to overlay most of the screen and dim out the…
K. Barresi
  • 1,275
  • 1
  • 21
  • 46
0
votes
2 answers

Text position scaling

I'm now using QGraphicsView and QGraphicsScene for showing some charts. Depending on values of that charts (they are histograms) I change the scale. I also draw some text (they are derived from QGraphicsItem) for showing their values like this But…
nabroyan
  • 3,225
  • 6
  • 37
  • 56
0
votes
1 answer

QGraphicsView to pdf

I have a big scene successfully displayed in my window with the help of QGraphicsView/QGraphicsScene with scroll bars for navigation. Everything works fine. Now I would like now to render part of the scene in a pdf. The region to be render in the…
Ote
  • 301
  • 1
  • 5
  • 16
0
votes
2 answers

Painting on a QGraphicsScene without loosing the picture already on it. Qt C++

SO as the question says, i have a QGraphicsView on my UI. I have made a function that puts an image onto that QGraphicsView: // Read New Image from file QImage image(":/images/myFile.png"); /// Declare a pointer to a scene QGraphicsScene *scene =…
AngryDuck
  • 4,358
  • 13
  • 57
  • 91
0
votes
2 answers

Adding an image to QtGraphicsView?

Hi iv looked at other questions and solutions for this but none seem to help for my specific problem. Im simply trying to add a picture to my GraphicsView that i have added using Qt designer .cpp void test::populateScene() { QImage…
AngryDuck
  • 4,358
  • 13
  • 57
  • 91
0
votes
1 answer

zooming GraphicsView with wheelEvent

Im implementing the zooming of my QGraphicsView using wheelEvent void View::wheelEvent(QWheelEvent *e) { if (e->modifiers().testFlag(Qt::ControlModifier)){ // zoom only when CTRL key pressed int numSteps = e->delta() / 15 / 8; …
Wagmare
  • 1,354
  • 1
  • 24
  • 58
0
votes
1 answer

Access other item contents within a QGraphicsScene

I have a dialog.cpp file, it is within here I created my QGraphicsScene which uses the QGraphicsView. I created two classes that inherit QGraphicsPixmapItem, "Vehicle" and "Junction". Both of these objects are added to the same QGraphicsScene in my…
eddie-ryan
  • 285
  • 1
  • 5
  • 19
0
votes
1 answer

Using QGraphicsScene and Qt::X11Bypasswindowmanagerhint produces BadMatch Error in X11

I am developing an application for Linux (RHEL, Gnome, Compiz) in Qt 4.8 using a QGraphicsScene with QGraphicsViews for each monitor. Each QGraphicsView has the Qt::X11Bypasswindowmanagerhint window hint. In order to restore keyboard focus, I have…
jelinson
  • 845
  • 8
  • 15
0
votes
0 answers

QGraphicsView/QGraphicsScene rendering glitches

Let’s say I add an image to a scene and a line such that one of its endpoint is precisely on one of the corners of a pixel. When I zoom in or out the view I see that the endpoint of the line shifts relative to the background image.. As I change the…
borisz
  • 1
0
votes
1 answer

PySide: Resizable scene in QGraphicsView

I'm trying to find a way to mark the border of a QGraphicsScene, and make it resizable inside a QGraphicsView, to create something similar to Microsoft Paint. In other words, my current QGraphicsView looks like this: But my image is only this big,…
midrare
  • 2,371
  • 28
  • 48