C++ (Qt)void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event){ Q_D(QAbstractItemView); QModelIndex index = indexAt(event->pos()); if (!index.isValid() || !d->isIndexEnabled(index) || (d->pressedIndex != index)) { QMouseEvent me(QEvent::MouseButtonPress, event->localPos(), event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers()); mousePressEvent(&me); return; } // signal handlers may change the model QPersistentModelIndex persistent = index; emit doubleClicked(persistent);...
C++ (Qt) void mouseDoubleClickEvent(QMouseEvent *e) { emit doubleClicked(indexAt(e->pos())); } bool eventFilter(QObject *o, QEvent *e) { if (o->inherits("QLabel") && e->type() == QEvent::MouseButtonDblClick) { auto me = static_cast<QMouseEvent *>(e); if (me->button() == Qt::LeftButton) { e->ignore(); return true; } } return QListView::eventFilter(o, e); }