Reputation: 4459
Could any one gives some hint on the easy way to get a signal emitted when the QGraphicsitem is selected/unselected each time?
Upvotes: 4
Views: 1747
Reputation: 43662
You can use itemChange() to get notified of that (or emit your own signal if you really need it from there):
QVariant QGraphicsItem::itemChange ( GraphicsItemChange change, const QVariant & value ) [virtual protected]
more or less like (pseudocode)
QVariant QGraphicsItemSubclass::itemChange( GraphicsItemChange change,
const QVariant &value ) {
if ( change == QGraphicsItem::ItemSelectedChange ) {
if (value == true) {
// Handling selection.. / selection emission
Upvotes: 4