Hi,
I'm quite new to Qt. I have a problem with drawing on a QGraphicsView. I have added a working example in the zip file:
I create a MainWindow app in Designer, and add a GraphicsView to it. In the code from MainWindow.cpp I create a QGraphicsscene, draw 256 little green rectangles on it (the rectangles are an instance from my own made class Graphics, which implements QGraphicItem), and let the GraphicsViewer select the scene. And this all works fine.
But now I want to change the color of a rectangle when clicked on it. I know that I have to use te mousepressedEvent (propably in the Graphics class), and that I maybe should use the drawForeGround methode. But I don't really get how that works Anyone who can help me, and help me on the right way?
Thanx in advance,
Wirloff
Bookmarks