Qt does not send the print screen key as a regular QKeyPress event, so we must use the Windows API
| 482 | #ifdef Q_OS_WIN |
| 483 | // Qt does not send the print screen key as a regular QKeyPress event, so we must use the Windows API |
| 484 | bool OptionsDialog::nativeEvent(const QByteArray &eventType, void *message, long *result) |
| 485 | { |
| 486 | if (eventType == "windows_generic_MSG") { |
| 487 | MSG *m = static_cast<MSG *>(message); |
| 488 | |
| 489 | if ((m->message == WM_KEYUP || m->message == WM_SYSKEYUP) && m->wParam == VK_SNAPSHOT) { |
| 490 | qApp->postEvent(qApp->focusWidget(), new QKeyEvent(QEvent::KeyPress, Qt::Key_Print, qApp->queryKeyboardModifiers())); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | return QDialog::nativeEvent(eventType, message, result); |
| 495 | } |
| 496 | #endif |
| 497 | |
| 498 | // |
nothing calls this directly
no outgoing calls
no test coverage detected