void MBubbleItem::removeInformationWidget(QGraphicsWidget *widget) { if (scene()) scene()->removeItem(widget); QStack<QGraphicsWidget*> stack = model()->informationWidgets(); int index = stack.indexOf(widget); if (index >= 0) { stack.remove(index); model()->setInformationWidgets(stack); } }