C++ (Qt)label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
C++ (Qt)QWidget *FeedItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex &/*index*/) const{ ImageWithLabelWidget *w = new ImageWithLabelWidget(parent); w->label->installEventFilter(parent->parent()); // listview return w;} class FeedListView : public QListView{protected: bool eventFilter(QObject *o, QEvent *e) { if (o->inherits("QLabel") && e->type() == QEvent::MouseButtonDblClick && static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton) { qApp->sendEvent(this, e); return true; } return QListView::eventFilter(o, e); }};
C++ (Qt)class FeedListView : public QListView{protected: bool eventFilter(QObject *o, QEvent *e) { if (o->inherits("QLabel") && e->type() == QEvent::MouseButtonDblClick) { QMouseEvent *me = static_cast<QMouseEvent *>(e); if (me->button() == Qt::LeftButton) { emit doubleClicked(indexAt(me->pos())); return true; } } return QListView::eventFilter(o, e); }};
C++ (Qt)qApp->sendEvent(this, e);
C++ (Qt)e->ignore();
qApp->postEvent(this, e->clone());