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

Scrolling QGraphicsView and QGraphicsScene

I have QGraphicsScene instance set to QGraphicsView on the GUI with scrollbars enabled and full view port update. But when I scroll my graphics view I get the items added to qgraphics scene disappeared on some point, though they are added in code…
St Sht
  • 19
  • 3
  • 11
0
votes
0 answers

Is it possible to have an item that is in one scene moved above another scene in Qt

I am currently learning Qt and I want to have 2 views with 2 seperate scenes. The second view is drawn above first one and only takes a corner of the first view. Is it possible for a custom graphicsitem using the move mouse to be above this second…
new002
  • 21
  • 4
0
votes
2 answers

Delete QGraphics Items from QGraphicsLinearLayout on QGraphicsScene

I'm having a really frustrating problem, trying to delete qgraphicsitems in my application. I have a menu controller which is responsible for adding buttons to a layout and adding them to the scene. These buttons are all connected with custom…
JonMorehouse
  • 1,313
  • 6
  • 14
  • 34
0
votes
1 answer

Trouble Connecting QPushButton Signal to QGraphicsView Slot

I'm having trouble connecting a signal in a QPushButton to a slot in my QGraphicsView. My Push Button Header: class Button : public QPushButton { Q_OBJECT public://public constructors / destructors Button(Game_state * game_state,…
JonMorehouse
  • 1,313
  • 6
  • 14
  • 34
0
votes
1 answer

Signal QGraphicsViewPaintEvent from QPushButton

I have a QPushButton embedded in my QGraphicsScene using a QProxyWidget. When I click the button, I want to change a global game state object and then signal the paint event of the view, to update the entire game. What would be the best way to…
JonMorehouse
  • 1,313
  • 6
  • 14
  • 34
0
votes
1 answer

Drawing on QGraphicsScene from a QGraphicsItem derived class

I am working on a RPG game in Qt, using the Graphics View Framework. I have create a class, "Player", which inherits QGraphicsItem. Now, i am trying to make an "attack" animation, so everytime i press the space key, there would be an animation in…
Kanghu
  • 561
  • 1
  • 10
  • 23
0
votes
1 answer

How to show pop menu on QGraphicsView?

How to show a pop up menu in Qt while right clicking the QGraphicsView? Please help
indira
  • 6,569
  • 18
  • 65
  • 80
0
votes
1 answer

How to implement Menu bar inside QGraphicsView?

I have a QGraphicsView which shows images dynamically. I also used fitInView feature to resize the window. Now I need to add the menu bar at the top of the QGraphicsView. How to implement this? Please help. I am new in Qt
indira
  • 6,569
  • 18
  • 65
  • 80
0
votes
1 answer

adding custom QGraphicsItem to Scene disable ScrollBarAsNeeded and alignment options

Custom item cpp: MapNode::MapNode(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent) { this->x = x; this->y = y; this->w = w; this->h = h; } QRectF MapNode::boundingRect() const { return QRectF(DeafultX, DeafultY,…
GoldenAxe
  • 838
  • 3
  • 9
  • 26
0
votes
1 answer

Best practice to handle multiple documents in QMdiArea?

I need to design and develop a kind of graphics piece of software, which can edit customized files containing graphical elements, etc. I expect the piece of software to contain many documents thanks to the QMdiArea which is actually my central…
Geoffrey R.
  • 1,907
  • 1
  • 19
  • 32
0
votes
1 answer

QGraphicscene strange behavior (don't update screen with negative numbers)

I have a QGraphicscene that don't update screen with negative numbers.The image explain all. http://s16.postimage.org/4b59m8hx1/problem.jpg That's the simple code. if (dinA){ //assume its always true int sx=dinA->getX(); int…
Tcz
  • 661
  • 5
  • 18
0
votes
1 answer

Qt/C++ Not displaying QGraphicview as QWidget

My project consists of operations between geometric figures on a cartesian plane.I would include a graph that have to be updated after each operation. Thats the source: http://pastebin.com/s5Fu9dHJ I've created the wrapper "disegna" (: public…
user1237549
0
votes
2 answers

How do I display a PGM file within a QGraphicsView?

I am trying to display a PGM file using the following test application. The code works with a PNG file, but not PGM: import sys from PyQt4.QtGui import * from PyQt4.QtCore import * import Image import ImageQt class MyView(QGraphicsView): def…
0
votes
1 answer

How to put several QImage in a QGraphicsView?

I have a scene where several items are added. The problem is that when the items are displayed, they are overlapping. Is there any way to indicate in the QGraphicsView or QGraphicsScene the position where each item should appear?
jackajack
  • 153
  • 1
  • 1
  • 11
0
votes
1 answer

How to identify certain QGraphicItems in a QGraphicsScene

I have several QGraphicItems in a QGraphicsScene. I want to modify only some of them when the QGraphicsView containing the scene gets resized. The reason is that I have painted a grid respective to the view. So how can I identify the items making up…
HWende
  • 1,705
  • 4
  • 18
  • 30