I have QGraphicsLayoutItem placed inside a QGraphicsLinearLayout. This is added to my QGraphicsWidget.
void MyCustomQGraphicsWidget::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
{
if (mouseEvent->button() == Qt::LeftButton) {
qDebug() << "clicked inventory";
}
}
I am having trouble finding a way to get e.g. the index of the item clicked in the layout.