| 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(); |
nothing calls this directly
no outgoing calls
no test coverage detected