Thanks again,
Just looking at QGraphicsView and QGraphicsScene now. I take it my items would be of QGraphicsItem and I override the paint event to draw my item?
{
{
// do whatever
painter->drawRoundRect( 10, 10, 20, 20 );
}
};
class CBoxItem : public QGraphicsItem
{
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
// do whatever
painter->drawRoundRect( 10, 10, 20, 20 );
}
};
To copy to clipboard, switch view to plain text mode
May even derive from QGraphicsPolygonItem...
How do I know when a user clicks on one of the GraphicItems, is this part of the QGraphicsScene - i.e. mousePressEvent?
Regards,
Steve
Bookmarks