MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / focusOutEvent

Method focusOutEvent

ElaWidgetTools/ElaDoubleSpinBox.cpp:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 QAction* down = menu->addElaIconAction(ElaIconType::Minus, tr("减少"));
86 down->setEnabled(se & StepDownEnabled);
87 menu->addSeparator();
88
89 const QAbstractSpinBox* that = this;
90 const QPoint pos = (event->reason() == QContextMenuEvent::Mouse)
91 ? event->globalPos()
92 : mapToGlobal(QPoint(event->pos().x(), 0)) + QPoint(width() / 2, height() / 2);
93 const QAction* action = menu->exec(pos);
94 delete menu;
95 if (that && action)
96 {
97 if (action == up)
98 {
99 stepBy(1);
100 }
101 else if (action == down)
102 {
103 stepBy(-1);
104 }
105 }
106 event->accept();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected