Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qprocessscheduler_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPROCESSSCHEDULER_P_H
5#define QPROCESSSCHEDULER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19#include <QtCore/qprocess.h>
20#include <QtCore/qlist.h>
21#include <QtCore/qbytearray.h>
22#include <QtCore/qqueue.h>
23
24QT_BEGIN_NAMESPACE
25namespace QmlLsp {
26
28{
30public:
31 using Id = QByteArray;
32 struct Command
33 {
37
38 friend bool comparesEqual(const Command &a, const Command &b) noexcept
39 {
40 return a.program == b.program && a.arguments == b.arguments
41 && a.customEnvironment == b.customEnvironment;
42 }
44 };
45
47
50
52 void done(const Id &id);
53
54public Q_SLOTS:
55 void schedule(const QList<Command> &commands, const Id &id);
56
57private Q_SLOTS:
58 void processNext();
59 void onErrorOccurred(QProcess::ProcessError error);
60
61private:
62 QQueue<QueueElement> m_queue;
63 QProcess m_process;
64 bool m_isRunning = false;
65};
66
67} // namespace QmlLsp
68
69QT_END_NAMESPACE
70
71#endif // QPROCESSSCHEDULER_P_H
Runs multiple processes sequentially via a QProcess, and signals once they are done.
friend bool comparesEqual(const Command &a, const Command &b) noexcept