| 88 | } |
| 89 | |
| 90 | void Process::sendInterrupt() |
| 91 | { |
| 92 | if (state() == QProcess::NotRunning) { |
| 93 | return; |
| 94 | } |
| 95 | #ifdef Q_OS_WIN |
| 96 | QString pipe; |
| 97 | QTextStream ts(&pipe); |
| 98 | ts << "\\\\.\\pipe\\minizinc-" << processId(); |
| 99 | auto pipeName = pipe.toStdString(); |
| 100 | HANDLE hNamedPipe = CreateFileA(pipeName.c_str(), GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); |
| 101 | if (hNamedPipe != INVALID_HANDLE_VALUE) { |
| 102 | DWORD bytesWritten; |
| 103 | WriteFile(hNamedPipe, nullptr, 0, &bytesWritten, nullptr); |
| 104 | CloseHandle(hNamedPipe); |
| 105 | } |
| 106 | #else |
| 107 | ::killpg(processId(), SIGINT); |
| 108 | #endif |
| 109 | } |
| 110 | |
| 111 | #if QT_VERSION >= 0x060000 |
| 112 | void Process::setpgid() |