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
24
QT_BEGIN_NAMESPACE
25
namespace
QmlLsp
{
26
27
class
QProcessScheduler
:
public
QObject
28
{
29
Q_OBJECT
30
public
:
31
using
Id
=
QByteArray
;
32
struct
Command
33
{
34
QString
program
;
35
QStringList
arguments
;
36
QProcessEnvironment
customEnvironment
=
QProcessEnvironment
::
systemEnvironment
();
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
}
43
Q_DECLARE_EQUALITY_COMPARABLE
(
Command
)
44
};
45
46
using
QueueElement
=
std
::
variant
<
Command
,
Id
>;
47
48
QProcessScheduler
();
49
~
QProcessScheduler
();
50
51
Q_SIGNALS
:
52
void
done
(
const
Id
&
id
);
53
54
public
Q_SLOTS
:
55
void
schedule
(
const
QList
<
Command
> &
commands
,
const
Id
&
id
);
56
57
private
Q_SLOTS
:
58
void
processNext
();
59
void
onErrorOccurred(QProcess::ProcessError error);
60
61
private
:
62
QQueue<QueueElement> m_queue;
63
QProcess m_process;
64
bool
m_isRunning =
false
;
65
};
66
67
}
// namespace QmlLsp
68
69
QT_END_NAMESPACE
70
71
#
endif
// QPROCESSSCHEDULER_P_H
QmlLsp::QProcessScheduler
Runs multiple processes sequentially via a QProcess, and signals once they are done.
Definition
qprocessscheduler_p.h:28
QmlLsp::QProcessScheduler::QProcessScheduler
QProcessScheduler()
Definition
qprocessscheduler.cpp:26
QmlLsp::QProcessScheduler::~QProcessScheduler
~QProcessScheduler()
Definition
qprocessscheduler.cpp:32
QPlatformGraphicsBufferHelper
\inmodule QtGui
QmlLsp
Definition
qmllsmain.cpp:50
QmlLsp::QProcessScheduler::Command
Definition
qprocessscheduler_p.h:33
QmlLsp::QProcessScheduler::Command::customEnvironment
QProcessEnvironment customEnvironment
Definition
qprocessscheduler_p.h:36
QmlLsp::QProcessScheduler::Command::arguments
QStringList arguments
Definition
qprocessscheduler_p.h:35
QmlLsp::QProcessScheduler::Command::comparesEqual
friend bool comparesEqual(const Command &a, const Command &b) noexcept
Definition
qprocessscheduler_p.h:38
QmlLsp::QProcessScheduler::Command::program
QString program
Definition
qprocessscheduler_p.h:34
qtdeclarative
src
qmlls
qprocessscheduler_p.h
Generated on
for Qt by
1.14.0