Fix tray visibility and message reception issues
Some checks failed
build / build-pip (push) Failing after 16s
build / build-win64 (push) Has been cancelled
build / build-macos (push) Has been cancelled

- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
kdusek
2025-12-07 22:39:07 +01:00
parent 7b695d7b7f
commit 5138303016
4060 changed files with 579123 additions and 23 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt6.QtTest.
sip-version = "6.14.0"
sip-abi-version = "13.8"
module-tags = ["Qt_6_10_0", "Linux"]
module-disabled-features = ["PyQt_OpenGL_ES2"]

View File

@@ -0,0 +1,54 @@
// QtTestmod.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%Module(name=PyQt6.QtTest, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Import QtWidgets/QtWidgetsmod.sip
%Copying
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt6.
This file may be used under the terms of the GNU General Public License
version 3.0 as published by the Free Software Foundation and appearing in
the file LICENSE included in the packaging of this file. Please review the
following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you do not wish to use this file under the terms of the GPL version 3.0
then you may purchase a commercial license. For more information contact
info@riverbankcomputing.com.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%End
%DefaultSupertype PyQt6.sip.simplewrapper
%Include qabstractitemmodeltester.sip
%Include qsignalspy.sip
%Include qtestkeyboard.sip
%Include qtestmouse.sip
%Include qtestsystem.sip

View File

@@ -0,0 +1,56 @@
// qabstractitemmodeltester.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QAbstractItemModelTester : public QObject
{
%TypeHeaderCode
// Qt v5.11.0 needs this.
#include <qabstractitemmodel.h>
#include <qabstractitemmodeltester.h>
%End
%ConvertToSubClassCode
sipType = (sipCpp->inherits("QAbstractItemModelTester") ? sipType_QAbstractItemModelTester : 0);
#if QT_VERSION < 0x060800
if (!sipType && sipCpp->inherits("QSignalSpy"))
sipType = sipType_QSignalSpy;
#endif
%End
public:
enum class FailureReportingMode
{
QtTest,
Warning,
Fatal,
};
QAbstractItemModelTester(QAbstractItemModel *model /KeepReference=1/, QObject *parent /TransferThis/ = 0);
QAbstractItemModelTester(QAbstractItemModel *model /KeepReference=1/, QAbstractItemModelTester::FailureReportingMode mode, QObject *parent /TransferThis/ = 0);
QAbstractItemModel *model() const;
QAbstractItemModelTester::FailureReportingMode failureReportingMode() const;
%If (Qt_6_4_0 -)
void setUseFetchMore(bool value);
%End
};

View File

@@ -0,0 +1,161 @@
// qsignalspy.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_8_0 -)
class QSignalSpy
{
%TypeHeaderCode
#include <qsignalspy.h>
%End
public:
QSignalSpy(SIP_PYOBJECT signal /TypeHint="QtCore.pyqtBoundSignal"/) [(const QObject *obj, const char *aSignal)];
%MethodCode
QObject *sender;
QByteArray signal_signature;
if ((sipError = pyqt6_qttest_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
sipCpp = new QSignalSpy(sender, signal_signature.constData());
else if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(0, a0);
%End
QSignalSpy(const QObject *obj, QMetaMethod signal);
~QSignalSpy();
bool isValid() const;
QByteArray signal() const;
bool wait(int timeout = 5000) /ReleaseGIL/;
Py_ssize_t __len__() const;
%MethodCode
sipRes = sipCpp->count();
%End
QList<QVariant> __getitem__(int i) const;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QList<QVariant>(sipCpp->at((int)idx));
%End
void __setitem__(int i, const QList<QVariant> &value);
%MethodCode
int len = sipCpp->count();
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
sipIsErr = 1;
else
(*sipCpp)[a0] = *a1;
%End
void __delitem__(int i);
%MethodCode
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
sipIsErr = 1;
else
sipCpp->removeAt(a0);
%End
private:
QSignalSpy(const QSignalSpy &);
};
%End
%If (- Qt_6_8_0)
class QSignalSpy : QObject
{
%TypeHeaderCode
#include <qsignalspy.h>
%End
public:
QSignalSpy(SIP_PYOBJECT signal /TypeHint="QtCore.pyqtBoundSignal"/) [(const QObject *obj, const char *aSignal)];
%MethodCode
QObject *sender;
QByteArray signal_signature;
if ((sipError = pyqt6_qttest_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
sipCpp = new sipQSignalSpy(sender, signal_signature.constData());
else if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(0, a0);
%End
QSignalSpy(const QObject *obj, const QMetaMethod &signal);
bool isValid() const;
QByteArray signal() const;
bool wait(int timeout = 5000) /ReleaseGIL/;
Py_ssize_t __len__() const;
%MethodCode
sipRes = sipCpp->count();
%End
QList<QVariant> __getitem__(int i) const;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QList<QVariant>(sipCpp->at((int)idx));
%End
void __setitem__(int i, const QList<QVariant> &value);
%MethodCode
int len = sipCpp->count();
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
sipIsErr = 1;
else
(*sipCpp)[a0] = *a1;
%End
void __delitem__(int i);
%MethodCode
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
sipIsErr = 1;
else
sipCpp->removeAt(a0);
%End
};
%End
%ModuleHeaderCode
// Imports from QtCore.
typedef sipErrorState (*pyqt6_qttest_get_pyqtsignal_parts_t)(PyObject *, QObject **, QByteArray &);
extern pyqt6_qttest_get_pyqtsignal_parts_t pyqt6_qttest_get_pyqtsignal_parts;
%End
%ModuleCode
// Imports from QtCore.
pyqt6_qttest_get_pyqtsignal_parts_t pyqt6_qttest_get_pyqtsignal_parts;
%End
%PostInitialisationCode
// Imports from QtCore.
pyqt6_qttest_get_pyqtsignal_parts = (pyqt6_qttest_get_pyqtsignal_parts_t)sipImportSymbol("pyqt6_get_pyqtsignal_parts");
Q_ASSERT(pyqt6_qttest_get_pyqtsignal_parts);
%End

View File

@@ -0,0 +1,59 @@
// qtestkeyboard.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
namespace QTest
{
%TypeHeaderCode
#include <qtestkeyboard.h>
%End
enum KeyAction
{
Press,
Release,
Click,
Shortcut,
};
void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyClicks(QWidget *widget, const QString &sequence, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keySequence(QWidget *widget, const QKeySequence &keySequence);
void simulateEvent(QWidget *widget, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay = -1);
void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, char ascii /Encoding="ASCII"/, Qt::KeyboardModifiers modifier, int delay = -1);
void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, QString text, Qt::KeyboardModifiers modifier, int delay = -1);
void keyEvent(QTest::KeyAction action, QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyEvent(QTest::KeyAction action, QWindow *window, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyClick(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyClick(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyPress(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyRelease(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keyRelease(QWindow *window, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1);
void keySequence(QWindow *window, const QKeySequence &keySequence);
};

View File

@@ -0,0 +1,39 @@
// qtestmouse.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
namespace QTest
{
%TypeHeaderCode
#include <qtestmouse.h>
%End
void mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseMove(QWidget *widget, QPoint pos = QPoint(), int delay = -1);
void mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers modifier = Qt::KeyboardModifiers(), QPoint pos = QPoint(), int delay = -1);
void mouseMove(QWindow *window, QPoint pos = QPoint(), int delay = -1);
};

View File

@@ -0,0 +1,34 @@
// qtestsystem.sip generated by MetaSIP
//
// This file is part of the QtTest Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
namespace QTest
{
%TypeHeaderCode
#include <qtestsystem.h>
%End
void qWait(int ms) /ReleaseGIL/;
bool qWaitForWindowActive(QWindow *window, int timeout = 5000) /ReleaseGIL/;
bool qWaitForWindowExposed(QWindow *window, int timeout = 5000) /ReleaseGIL/;
bool qWaitForWindowActive(QWidget *widget, int timeout = 5000) /ReleaseGIL/;
bool qWaitForWindowExposed(QWidget *widget, int timeout = 5000) /ReleaseGIL/;
};