I guess you meant QGraphicsScene::mousePressEvent
@Eva
May be if you tell what you want to do on click, we can help you better
I guess you meant QGraphicsScene::mousePressEvent
@Eva
May be if you tell what you want to do on click, we can help you better
actually I wanted to have something like when I click the mouse on the graphicsview, I will display a circle on that spot and remove any other previously over items items on the scene (except for the background).
which mousepressevent should I edit? the graphicsview, graphicsscene or the graphicellipse?
I have another problem. How can I prevent tiling of the Qpixmap in graphivew if my pixmap is smaller than the scene rect?
I manage to get the mouse press event to work. However I still have the tiled background issue.
I loaded map onto the graphicsview by using setbackgroundbrush. but I notice that it got tiled if the graphicsScene scene rect is bigger than the map.
How can I prevent this? I want to just white/ block out the areas that is not covered by the map.
Furthermore, I have this scrollbar which will change the size of the map (via matrix transform). I would like the white/black out area to not show after the map is large enough to cover the graphicsScene.
Dont set the brush. Draw the background yourself using QGraphicsScene::drawBackground or QGraphicsView::drawBackground
thx. by the way, is there any way to remove the background brush after involving setBackgroundBrush?
Bookmarks