qt 6.5.1 original

This commit is contained in:
kleuter
2023-10-29 23:33:08 +01:00
parent 71d22ab6b0
commit 85d238dfda
21202 changed files with 5499099 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qprocess_and_guieventloop Test:
#####################################################################
qt_internal_add_test(tst_qprocess_and_guieventloop
SOURCES
tst_qprocess_and_guieventloop.cpp
LIBRARIES
Qt::Gui
)
add_subdirectory(write-read-write)

View File

@ -0,0 +1,58 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtGui/QGuiApplication>
#include <QTest>
#include <QSignalSpy>
#include <QtCore/QProcess>
class tst_QProcess_and_GuiEventLoop : public QObject
{
Q_OBJECT
private slots:
void waitForAndEventLoop();
};
void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop()
{
#ifdef Q_OS_ANDROID
QSKIP("Not supported on Android");
#else
// based on testcase provided in QTBUG-39488
QByteArray msg = "Hello World";
QProcess process;
process.start("write-read-write/write-read-write", QStringList() << msg);
QVERIFY(process.waitForStarted(5000));
QVERIFY(process.waitForReadyRead(5000));
QCOMPARE(process.readAll().trimmed(), msg);
// run the GUI event dispatcher once
QSignalSpy spy(&process, SIGNAL(readyRead()));
qApp->processEvents(QEventLoop::AllEvents, 100);
// we mustn't have read anything in the event loop
QCOMPARE(spy.size(), 0);
// ensure the process hasn't died
QVERIFY(!process.waitForFinished(250));
// we mustn't have read anything during waitForFinished either
QCOMPARE(spy.size(), 0);
// release the child for the second write
process.write("\n");
QVERIFY(process.waitForFinished(5000));
QCOMPARE(int(process.exitStatus()), int(QProcess::NormalExit));
QCOMPARE(process.exitCode(), 0);
QCOMPARE(spy.size(), 1);
QCOMPARE(process.readAll().trimmed(), msg);
#endif
}
QTEST_MAIN(tst_QProcess_and_GuiEventLoop)
#include "tst_qprocess_and_guieventloop.moc"

View File

@ -0,0 +1,12 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## write-read-write Binary:
#####################################################################
qt_internal_add_executable(write-read-write
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
SOURCES
main.cpp
)

View File

@ -0,0 +1,22 @@
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <stdio.h>
int main(int, char **argv)
{
const char *msg = argv[1];
char buf[2];
puts(msg);
fflush(stdout);
// wait for a newline
const char *result = fgets(buf, sizeof buf, stdin);
if (result != buf)
return -1;
puts(msg);
fflush(stdout);
return 0;
}