MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / mouseDoubleClickEvent

Method mouseDoubleClickEvent

launcher/ui/instanceview/InstanceView.cpp:466–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void InstanceView::mouseDoubleClickEvent(QMouseEvent *event)
467{
468 executeDelayedItemsLayout();
469
470 QModelIndex index = indexAt(event->pos());
471 if (!index.isValid() || !(index.flags() & Qt::ItemIsEnabled) || (m_pressedIndex != index))
472 {
473 QMouseEvent me(
474 QEvent::MouseButtonPress,
475 event->localPos(),
476 event->windowPos(),
477 event->screenPos(),
478 event->button(),
479 event->buttons(),
480 event->modifiers()
481 );
482 mousePressEvent(&me);
483 return;
484 }
485 // signal handlers may change the model
486 QPersistentModelIndex persistent = index;
487 emit doubleClicked(persistent);
488
489#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
490 QStyleOptionViewItem option;
491 initViewItemOption(&option);
492#else
493 QStyleOptionViewItem option = viewOptions();
494#endif
495 if ((model()->flags(index) & Qt::ItemIsEnabled) && !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this))
496 {
497 emit activated(index);
498 }
499}
500
501void InstanceView::paintEvent(QPaintEvent *event)
502{

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.45
flagsMethod · 0.45

Tested by

no test coverage detected