I have QGraphicsView that covers main window (its size and QGraphicsScene size are the same as the window).
I'm useing it to display animated hints.
I made it transparent for mouse events by
setAttribute(Qt::WA_TransparentForMouseEvents, false);
setAttribute(Qt::WA_TransparentForMouseEvents, false);
To copy to clipboard, switch view to plain text mode
I would like to make those hints clikable so I need to change thet attribute,
but then main window is covered from mouse events.
I tried to reimplement QGraphicsView::event
bool MyGraphicsView
::event(QEvent* event
) { m_parent->event(event);
}
bool MyGraphicsView::event(QEvent* event) {
m_parent->event(event);
return QGraphicsView::event(event);
}
To copy to clipboard, switch view to plain text mode
m_parent is QMainWindow
bool MainWindow
::event(QEvent *event
) { }
bool MainWindow::event(QEvent *event) {
return QMainWindow::event(event);
}
To copy to clipboard, switch view to plain text mode
but it crash on:
return QMainWindow::event(event);
To copy to clipboard, switch view to plain text mode
Yes, I can adjust QGraphicsView to some hints and cover only needed part of the window
but it is much of work.
Maybe Is there any trick?
Bookmarks