qgraphicsitem Questions
1
This question is related to: Forcing QGraphicsItem To Stay Put
I'd like to have a QGraphicsItem on a fixed location when moving around in the scene.
The suggested solution is to override the voi...
Boucher asked 28/6, 2013 at 20:35
2
Solved
I'm looking for the most effective way to size a QGraphicsItem based on the length of a given QString, so that the text is always contained within the QGraphicsItem's boundaries. The idea is to kee...
Assumption asked 19/6, 2013 at 14:1
2
Solved
I have multiple QGraphicsItems in scene spread across different parts of scene. In application there are different modes in one of mode user can scroll the scene (palm drag mode).
To achieve scrol...
Mirellamirelle asked 17/10, 2012 at 6:12
3
Solved
Use case: This should be a fairly common problem. In a normal QMainWindow with QMdiArea lives an mdiChild with a QGraphicsView. This view displays a QGraphicsScene with QGraphicsItems inside. A rig...
Library asked 26/3, 2012 at 12:4
1
I create a custom QGraphicsItem. And overwrite the boundingRect() and paint().
QRectF myTile::boundingRect() const
{
return QRectF(xPos*10, yPos*10, 10, 10);
}
void myTile::paint(QPainter *paint...
Livelong asked 24/12, 2012 at 20:49
1
Solved
One amazing feature of QGraphicsView is its ability to scale itself with its scene's content (every QGraphicsItem inserted in the scene actually). The QPixmap that I have inserted scales correctly,...
Wilmoth asked 29/10, 2012 at 11:11
1
Solved
In a QGraphicsScene, I have a background set with a few QGraphicsItems on top of it. These graphics items are of arbitrary shape. I'd like to make another QGraphicsItem, i.e. a circle, which when p...
Ubald asked 15/6, 2012 at 17:6
1
Solved
According to the QGraphicsItem destructor documentation, "It is more efficient to remove the item from the QGraphicsScene before destroying the item."
Why is that? I can't think of how it could ma...
Klump asked 2/5, 2012 at 20:56
2
Solved
Probably a trick question, but I can't find the answer.
I need to know when a QGraphicsItem gets selected. There must be a method that's called.
I know QGraphicsItem::itemChange() but it's call...
Harbert asked 23/4, 2012 at 19:44
1
Solved
According to the Qt docs, it "Prepares the item for a geometry change. Call this function before changing the bounding rect of an item to keep QGraphicsScene's index up to date. prepareGeometryChan...
Leora asked 23/3, 2012 at 3:1
2
I want to detect when the mouse cursor moves in over a QGraphicsItem while a mouse button is pressed, i.e. the button is pressed before the mouse enters the item. My first idea was to use hoverEnte...
Scully asked 2/10, 2010 at 12:12
2
Solved
I created a simple program that demonstrates the runtime error I'm getting with my Qt application that uses multiple inheritance. The inheritance tree looks like:
QGraphicsItem (abstract)
\
QGra...
Amabil asked 24/12, 2011 at 18:22
3
Is there a way to restrict the area where a QGraphicsItem like QRect can be moved when setFlag(ItemIsMovable) is set?
I'm new to pyqt and trying to find a way to move an item with the mouse, and t...
Blessington asked 23/8, 2010 at 13:59
2
I have derived QGraphicsItem and QGraphicsScene classes. I want the items to be able to call scene() and get a derviedGraphicsItem * instead of a QGraphicsItem *, so I reimplemented QGraphicsScene:...
Ananna asked 21/6, 2011 at 20:8
2
Solved
I have a QGraphicsScene that is filled with QGraphicsItems, and the user is able to pan and zoom around to inspect all of the various QGraphicsItems. However, I would like to have a QGraphics...
Dworman asked 29/4, 2011 at 3:20
3
I am using Qt and C++ as my environment.
I draw a QGraphicsView in my UI, then create a scene and add lines to that it.
I run through an array of 5000 points and draw lines connecting each point.
Q...
Fabliau asked 15/10, 2010 at 13:18
1
Solved
I want to make something like a hud. I have a QGraphicsScene with a huge QPixmap, that I added to a much smaller QGraphicsView. Now I need to add some control elements, like QLabel, QPushButton and...
Encrust asked 10/9, 2010 at 9:37
2
Solved
How do I draw interactive widgets such as QButtons and Line Edits over a QGraphicsView?
For ex, I have selected a region over an image in an image editing app which displays an image with QGraphics...
Groundling asked 6/6, 2010 at 18:32
1
Solved
I have been toying with this piece of code:
QGraphicsLineItem * anotherLine = this->addLine(50,50, 100, 100);
qDebug() << anotherLine->scenePos();
QGraphicsLineItem * anotherLine2 = t...
Lecher asked 20/7, 2009 at 5:34
© 2022 - 2024 — McMap. All rights reserved.