fix: do mouse gallery navigation on btn release

This commit is contained in:
Gary Wang
2021-10-08 19:31:19 +08:00
parent 3a442b35f6
commit 7a1816cbac
2 changed files with 15 additions and 11 deletions

View File

@ -263,9 +263,13 @@ void GraphicsView::mouseMoveEvent(QMouseEvent *event)
void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
{
QGraphicsItem *item = itemAt(event->pos());
if (!item) {
if (event->button() == Qt::ForwardButton || event->button() == Qt::BackButton) {
event->ignore();
} else {
QGraphicsItem *item = itemAt(event->pos());
if (!item) {
event->ignore();
}
}
return QGraphicsView::mouseReleaseEvent(event);