Hi everybody!
I have class CLVideoWindow inherited from QGraphicsItem.
I want to handle focusInEvent event and mousePressEvent.
I've reimplemented
void CLVideoWindow
::focusInEvent( QFocusEvent * event
) {
}
{
}
void CLVideoWindow::focusInEvent( QFocusEvent * event )
{
QGraphicsItem::focusInEvent(event);
}
void CLVideoWindow::mousePressEvent ( QGraphicsSceneMouseEvent * event )
{
QGraphicsItem::mousePressEvent(event);
}
To copy to clipboard, switch view to plain text mode
But this functions never gets called.
What am I missing ?
In CLVideoWindow constructor I do:
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::MouseButton::LeftButton);
setAcceptedMouseButtons(Qt::MouseButton::RightButton);
setAcceptHoverEvents(true);
setFlag(QGraphicsItem::ItemIsFocusable);
setAcceptedMouseButtons(Qt::MouseButton::LeftButton);
setAcceptedMouseButtons(Qt::MouseButton::RightButton);
To copy to clipboard, switch view to plain text mode
Thank you!
Bookmarks