Fix tray visibility and message reception issues
Some checks failed
build / build-win64 (push) Waiting to run
build / build-macos (push) Waiting to run
build / build-pip (push) Failing after 16s

- 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.QtBluetooth.
sip-version = "6.14.0"
sip-abi-version = "13.8"
module-tags = ["Qt_6_10_0", "Linux"]
module-disabled-features = []

View File

@@ -0,0 +1,71 @@
// QtBluetoothmod.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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.QtBluetooth, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.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 qbluetooth.sip
%Include qbluetoothaddress.sip
%Include qbluetoothdevicediscoveryagent.sip
%Include qbluetoothdeviceinfo.sip
%Include qbluetoothhostinfo.sip
%Include qbluetoothlocaldevice.sip
%Include qbluetoothserver.sip
%Include qbluetoothservicediscoveryagent.sip
%Include qbluetoothserviceinfo.sip
%Include qbluetoothsocket.sip
%Include qbluetoothuuid.sip
%Include qlowenergyadvertisingdata.sip
%Include qlowenergyadvertisingparameters.sip
%Include qlowenergycharacteristic.sip
%Include qlowenergycharacteristicdata.sip
%Include qlowenergyconnectionparameters.sip
%Include qlowenergycontroller.sip
%Include qlowenergydescriptor.sip
%Include qlowenergydescriptordata.sip
%Include qlowenergyservice.sip
%Include qlowenergyservicedata.sip
%Include qpybluetooth_quint128.sip
%Include qpybluetooth_qlist.sip
%Include qpybluetooth_qmultihash.sip

View File

@@ -0,0 +1,55 @@
// qbluetooth.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
namespace QBluetooth
{
%TypeHeaderCode
#include <qbluetooth.h>
%End
enum class Security /BaseType=Flag/
{
NoSecurity,
Authorization,
Authentication,
Encryption,
Secure,
};
typedef QFlags<QBluetooth::Security> SecurityFlags;
enum class AttAccessConstraint /BaseType=Flag/
{
AttAuthorizationRequired,
AttAuthenticationRequired,
AttEncryptionRequired,
};
typedef QFlags<QBluetooth::AttAccessConstraint> AttAccessConstraints;
};
%End
%If (Qt_6_2_0 -)
typedef quint16 QLowEnergyHandle;
%End

View File

@@ -0,0 +1,59 @@
// qbluetoothaddress.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothAddress
{
%TypeHeaderCode
#include <qbluetoothaddress.h>
%End
public:
QBluetoothAddress();
explicit QBluetoothAddress(quint64 address);
explicit QBluetoothAddress(const QString &address);
QBluetoothAddress(const QBluetoothAddress &other);
~QBluetoothAddress();
bool isNull() const;
void clear();
quint64 toUInt64() const;
QString toString() const;
%If (Qt_6_6_0 -)
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
};
%End
%If (Qt_6_2_0 -)
bool operator<(const QBluetoothAddress &a, const QBluetoothAddress &b);
%End
%If (Qt_6_2_0 -)
bool operator==(const QBluetoothAddress &a, const QBluetoothAddress &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QBluetoothAddress &a, const QBluetoothAddress &b);
%End

View File

@@ -0,0 +1,81 @@
// qbluetoothdevicediscoveryagent.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothDeviceDiscoveryAgent : public QObject
{
%TypeHeaderCode
#include <qbluetoothdevicediscoveryagent.h>
%End
public:
enum Error
{
NoError,
InputOutputError,
PoweredOffError,
InvalidBluetoothAdapterError,
UnsupportedPlatformError,
UnsupportedDiscoveryMethod,
LocationServiceTurnedOffError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
UnknownError,
};
explicit QBluetoothDeviceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothDeviceDiscoveryAgent();
bool isActive() const;
QBluetoothDeviceDiscoveryAgent::Error error() const;
QString errorString() const;
QList<QBluetoothDeviceInfo> discoveredDevices() const;
public slots:
void start();
void start(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods method);
void stop();
signals:
void deviceDiscovered(const QBluetoothDeviceInfo &info);
void finished();
void errorOccurred(QBluetoothDeviceDiscoveryAgent::Error error);
void canceled();
void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields);
public:
enum DiscoveryMethod /BaseType=Flag/
{
NoMethod,
ClassicMethod,
LowEnergyMethod,
};
typedef QFlags<QBluetoothDeviceDiscoveryAgent::DiscoveryMethod> DiscoveryMethods;
void setLowEnergyDiscoveryTimeout(int msTimeout);
int lowEnergyDiscoveryTimeout() const;
static QBluetoothDeviceDiscoveryAgent::DiscoveryMethods supportedDiscoveryMethods();
};
%End

View File

@@ -0,0 +1,245 @@
// qbluetoothdeviceinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothDeviceInfo
{
%TypeHeaderCode
#include <qbluetoothdeviceinfo.h>
%End
public:
enum MajorDeviceClass
{
MiscellaneousDevice,
ComputerDevice,
PhoneDevice,
NetworkDevice,
AudioVideoDevice,
PeripheralDevice,
ImagingDevice,
WearableDevice,
ToyDevice,
HealthDevice,
UncategorizedDevice,
};
enum MinorMiscellaneousClass
{
UncategorizedMiscellaneous,
};
enum MinorComputerClass
{
UncategorizedComputer,
DesktopComputer,
ServerComputer,
LaptopComputer,
HandheldClamShellComputer,
HandheldComputer,
WearableComputer,
};
enum MinorPhoneClass
{
UncategorizedPhone,
CellularPhone,
CordlessPhone,
SmartPhone,
WiredModemOrVoiceGatewayPhone,
CommonIsdnAccessPhone,
};
enum MinorNetworkClass
{
NetworkFullService,
NetworkLoadFactorOne,
NetworkLoadFactorTwo,
NetworkLoadFactorThree,
NetworkLoadFactorFour,
NetworkLoadFactorFive,
NetworkLoadFactorSix,
NetworkNoService,
};
enum MinorAudioVideoClass
{
UncategorizedAudioVideoDevice,
WearableHeadsetDevice,
HandsFreeDevice,
Microphone,
Loudspeaker,
Headphones,
PortableAudioDevice,
CarAudio,
SetTopBox,
HiFiAudioDevice,
Vcr,
VideoCamera,
Camcorder,
VideoMonitor,
VideoDisplayAndLoudspeaker,
VideoConferencing,
GamingDevice,
};
enum MinorPeripheralClass
{
UncategorizedPeripheral,
KeyboardPeripheral,
PointingDevicePeripheral,
KeyboardWithPointingDevicePeripheral,
JoystickPeripheral,
GamepadPeripheral,
RemoteControlPeripheral,
SensingDevicePeripheral,
DigitizerTabletPeripheral,
CardReaderPeripheral,
};
enum MinorImagingClass
{
UncategorizedImagingDevice,
ImageDisplay,
ImageCamera,
ImageScanner,
ImagePrinter,
};
enum MinorWearableClass
{
UncategorizedWearableDevice,
WearableWristWatch,
WearablePager,
WearableJacket,
WearableHelmet,
WearableGlasses,
};
enum MinorToyClass
{
UncategorizedToy,
ToyRobot,
ToyVehicle,
ToyDoll,
ToyController,
ToyGame,
};
enum MinorHealthClass
{
UncategorizedHealthDevice,
HealthBloodPressureMonitor,
HealthThermometer,
HealthWeightScale,
HealthGlucoseMeter,
HealthPulseOximeter,
HealthDataDisplay,
HealthStepCounter,
};
enum ServiceClass /BaseType=Flag/
{
NoService,
PositioningService,
NetworkingService,
RenderingService,
CapturingService,
ObjectTransferService,
AudioService,
TelephonyService,
InformationService,
AllServices,
};
typedef QFlags<QBluetoothDeviceInfo::ServiceClass> ServiceClasses;
QBluetoothDeviceInfo();
QBluetoothDeviceInfo(const QBluetoothAddress &address, const QString &name, quint32 classOfDevice);
QBluetoothDeviceInfo(const QBluetoothUuid &uuid, const QString &name, quint32 classOfDevice);
QBluetoothDeviceInfo(const QBluetoothDeviceInfo &other);
~QBluetoothDeviceInfo();
bool isValid() const;
bool isCached() const;
void setCached(bool cached);
QBluetoothAddress address() const;
QString name() const;
QBluetoothDeviceInfo::ServiceClasses serviceClasses() const;
QBluetoothDeviceInfo::MajorDeviceClass majorDeviceClass() const;
quint8 minorDeviceClass() const;
qint16 rssi() const;
void setRssi(qint16 signal);
void setServiceUuids(const QList<QBluetoothUuid> &uuids);
QList<QBluetoothUuid> serviceUuids() const;
enum CoreConfiguration /BaseType=Flag/
{
UnknownCoreConfiguration,
LowEnergyCoreConfiguration,
BaseRateCoreConfiguration,
BaseRateAndLowEnergyCoreConfiguration,
};
typedef QFlags<QBluetoothDeviceInfo::CoreConfiguration> CoreConfigurations;
void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs);
QBluetoothDeviceInfo::CoreConfigurations coreConfigurations() const;
void setDeviceUuid(const QBluetoothUuid &uuid);
QBluetoothUuid deviceUuid() const;
enum class Field /BaseType=Flag/
{
None,
RSSI,
ManufacturerData,
%If (Qt_6_3_0 -)
ServiceData,
%End
All,
};
typedef QFlags<QBluetoothDeviceInfo::Field> Fields;
QList<unsigned short> manufacturerIds() const;
QMultiHash<quint16, QByteArray> manufacturerData() const;
QByteArray manufacturerData(quint16 manufacturerId) const;
bool setManufacturerData(quint16 manufacturerId, const QByteArray &data);
void setName(const QString &name);
%If (Qt_6_3_0 -)
QList<QBluetoothUuid> serviceIds() const;
%End
%If (Qt_6_3_0 -)
QMultiHash<QBluetoothUuid, QByteArray> serviceData() const;
%End
%If (Qt_6_3_0 -)
QByteArray serviceData(const QBluetoothUuid &serviceId) const;
%End
%If (Qt_6_3_0 -)
bool setServiceData(const QBluetoothUuid &serviceId, const QByteArray &data);
%End
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b);
%End

View File

@@ -0,0 +1,47 @@
// qbluetoothhostinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothHostInfo
{
%TypeHeaderCode
#include <qbluetoothhostinfo.h>
%End
public:
QBluetoothHostInfo();
QBluetoothHostInfo(const QBluetoothHostInfo &other);
~QBluetoothHostInfo();
QBluetoothAddress address() const;
void setAddress(const QBluetoothAddress &address);
QString name() const;
void setName(const QString &name);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QBluetoothHostInfo &a, const QBluetoothHostInfo &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QBluetoothHostInfo &a, const QBluetoothHostInfo &b);
%End

View File

@@ -0,0 +1,79 @@
// qbluetoothlocaldevice.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothLocalDevice : public QObject
{
%TypeHeaderCode
#include <qbluetoothlocaldevice.h>
%End
public:
enum Pairing
{
Unpaired,
Paired,
AuthorizedPaired,
};
enum HostMode
{
HostPoweredOff,
HostConnectable,
HostDiscoverable,
HostDiscoverableLimitedInquiry,
};
enum Error
{
NoError,
PairingError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
UnknownError,
};
explicit QBluetoothLocalDevice(QObject *parent /TransferThis/ = 0);
QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothLocalDevice();
bool isValid() const;
void requestPairing(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing);
QBluetoothLocalDevice::Pairing pairingStatus(const QBluetoothAddress &address) const;
void setHostMode(QBluetoothLocalDevice::HostMode mode);
QBluetoothLocalDevice::HostMode hostMode() const;
void powerOn();
QString name() const;
QBluetoothAddress address() const;
static QList<QBluetoothHostInfo> allDevices();
QList<QBluetoothAddress> connectedDevices() const;
signals:
void hostModeStateChanged(QBluetoothLocalDevice::HostMode state);
void pairingFinished(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing);
void errorOccurred(QBluetoothLocalDevice::Error error);
void deviceConnected(const QBluetoothAddress &address);
void deviceDisconnected(const QBluetoothAddress &address);
};
%End

View File

@@ -0,0 +1,101 @@
// qbluetoothserver.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothServer : public QObject
{
%TypeHeaderCode
#include <qbluetoothserver.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QBluetoothDeviceDiscoveryAgent, &sipType_QBluetoothDeviceDiscoveryAgent, -1, 1},
{sipName_QBluetoothLocalDevice, &sipType_QBluetoothLocalDevice, -1, 2},
{sipName_QBluetoothServer, &sipType_QBluetoothServer, -1, 3},
{sipName_QBluetoothServiceDiscoveryAgent, &sipType_QBluetoothServiceDiscoveryAgent, -1, 4},
{sipName_QBluetoothSocket, &sipType_QBluetoothSocket, -1, 5},
{sipName_QLowEnergyController, &sipType_QLowEnergyController, -1, 6},
{sipName_QLowEnergyService, &sipType_QLowEnergyService, -1, -1},
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
public:
enum Error
{
NoError,
UnknownError,
PoweredOffError,
InputOutputError,
ServiceAlreadyRegisteredError,
UnsupportedProtocolError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
};
QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothServer();
void close() /ReleaseGIL/;
bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0) /ReleaseGIL/;
QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()) /ReleaseGIL/;
bool isListening() const;
void setMaxPendingConnections(int numConnections);
int maxPendingConnections() const;
bool hasPendingConnections() const;
QBluetoothSocket *nextPendingConnection() /Factory/;
QBluetoothAddress serverAddress() const;
quint16 serverPort() const;
void setSecurityFlags(QBluetooth::SecurityFlags security);
QBluetooth::SecurityFlags securityFlags() const;
QBluetoothServiceInfo::Protocol serverType() const;
QBluetoothServer::Error error() const;
signals:
void newConnection();
void errorOccurred(QBluetoothServer::Error error);
};
%End

View File

@@ -0,0 +1,75 @@
// qbluetoothservicediscoveryagent.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothServiceDiscoveryAgent : public QObject
{
%TypeHeaderCode
#include <qbluetoothservicediscoveryagent.h>
%End
public:
enum Error
{
NoError,
InputOutputError,
PoweredOffError,
InvalidBluetoothAdapterError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
UnknownError,
};
enum DiscoveryMode
{
MinimalDiscovery,
FullDiscovery,
};
explicit QBluetoothServiceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothServiceDiscoveryAgent();
bool isActive() const;
QBluetoothServiceDiscoveryAgent::Error error() const;
QString errorString() const;
QList<QBluetoothServiceInfo> discoveredServices() const;
void setUuidFilter(const QList<QBluetoothUuid> &uuids);
void setUuidFilter(const QBluetoothUuid &uuid);
QList<QBluetoothUuid> uuidFilter() const;
bool setRemoteAddress(const QBluetoothAddress &address);
QBluetoothAddress remoteAddress() const;
public slots:
void start(QBluetoothServiceDiscoveryAgent::DiscoveryMode mode = QBluetoothServiceDiscoveryAgent::MinimalDiscovery);
void stop();
void clear();
signals:
void serviceDiscovered(const QBluetoothServiceInfo &info);
void finished();
void canceled();
void errorOccurred(QBluetoothServiceDiscoveryAgent::Error error);
};
%End

View File

@@ -0,0 +1,95 @@
// qbluetoothserviceinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothServiceInfo
{
%TypeHeaderCode
#include <qbluetoothserviceinfo.h>
%End
public:
enum AttributeId
{
ServiceRecordHandle,
ServiceClassIds,
ServiceRecordState,
ServiceId,
ProtocolDescriptorList,
BrowseGroupList,
LanguageBaseAttributeIdList,
ServiceInfoTimeToLive,
ServiceAvailability,
BluetoothProfileDescriptorList,
DocumentationUrl,
ClientExecutableUrl,
IconUrl,
AdditionalProtocolDescriptorList,
PrimaryLanguageBase,
ServiceName,
ServiceDescription,
ServiceProvider,
};
enum Protocol
{
UnknownProtocol,
L2capProtocol,
RfcommProtocol,
};
QBluetoothServiceInfo();
QBluetoothServiceInfo(const QBluetoothServiceInfo &other);
~QBluetoothServiceInfo();
bool isValid() const;
bool isComplete() const;
void setDevice(const QBluetoothDeviceInfo &info);
QBluetoothDeviceInfo device() const;
QVariant attribute(quint16 attributeId) const;
QList<unsigned short> attributes() const;
bool contains(quint16 attributeId) const;
void removeAttribute(quint16 attributeId);
QBluetoothServiceInfo::Protocol socketProtocol() const;
int protocolServiceMultiplexer() const;
int serverChannel() const;
QBluetoothServiceInfo::Sequence protocolDescriptor(QBluetoothUuid::ProtocolUuid protocol) const;
bool isRegistered() const;
bool registerService(const QBluetoothAddress &localAdapter = QBluetoothAddress());
bool unregisterService();
void setAttribute(quint16 attributeId, const QBluetoothUuid &value);
void setAttribute(quint16 attributeId, const QBluetoothServiceInfo::Sequence &value);
void setAttribute(quint16 attributeId, const QVariant &value);
void setServiceName(const QString &name);
QString serviceName() const;
void setServiceDescription(const QString &description);
QString serviceDescription() const;
void setServiceProvider(const QString &provider);
QString serviceProvider() const;
void setServiceAvailability(quint8 availability);
quint8 serviceAvailability() const;
void setServiceUuid(const QBluetoothUuid &uuid);
QBluetoothUuid serviceUuid() const;
QList<QBluetoothUuid> serviceClassUuids() const;
};
%End

View File

@@ -0,0 +1,140 @@
// qbluetoothsocket.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothSocket : public QIODevice
{
%TypeHeaderCode
#include <qbluetoothsocket.h>
%End
public:
enum class SocketState
{
UnconnectedState,
ServiceLookupState,
ConnectingState,
ConnectedState,
BoundState,
ClosingState,
ListeningState,
};
enum class SocketError
{
NoSocketError,
UnknownSocketError,
RemoteHostClosedError,
HostNotFoundError,
ServiceNotFoundError,
NetworkError,
UnsupportedProtocolError,
OperationError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
};
QBluetoothSocket(QBluetoothServiceInfo::Protocol socketType, QObject *parent /TransferThis/ = 0);
explicit QBluetoothSocket(QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothSocket();
void abort();
virtual void close() /ReleaseGIL/;
virtual bool isSequential() const;
virtual qint64 bytesAvailable() const;
virtual qint64 bytesToWrite() const;
virtual bool canReadLine() const;
void connectToService(const QBluetoothAddress &address, QBluetoothUuid::ServiceClassUuid uuid, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
void connectToService(const QBluetoothAddress &address, quint16 port, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
void connectToService(const QBluetoothServiceInfo &service, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite) /ReleaseGIL/;
void disconnectFromService() /ReleaseGIL/;
QString localName() const;
QBluetoothAddress localAddress() const;
quint16 localPort() const;
QString peerName() const;
QBluetoothAddress peerAddress() const;
quint16 peerPort() const;
bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState state = QBluetoothSocket::SocketState::ConnectedState, QIODeviceBase::OpenMode mode = QIODeviceBase::ReadWrite);
int socketDescriptor() const;
QBluetoothServiceInfo::Protocol socketType() const;
QBluetoothSocket::SocketState state() const;
QBluetoothSocket::SocketError error() const;
QString errorString() const;
signals:
void connected();
void disconnected();
void errorOccurred(QBluetoothSocket::SocketError error);
void stateChanged(QBluetoothSocket::SocketState state);
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="bytes",ReleaseGIL/ [qint64 (char *data, qint64 maxSize)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QBluetoothSocket::readData(s, a0) : sipCpp->readData(s, a0);
#else
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(const char *data /Array/, qint64 maxSize /ArraySize/) /ReleaseGIL/;
void setSocketState(QBluetoothSocket::SocketState state);
void setSocketError(QBluetoothSocket::SocketError error);
void doDeviceDiscovery(const QBluetoothServiceInfo &service, QIODeviceBase::OpenMode openMode);
public:
void setPreferredSecurityFlags(QBluetooth::SecurityFlags flags);
QBluetooth::SecurityFlags preferredSecurityFlags() const;
};
%End

View File

@@ -0,0 +1,361 @@
// qbluetoothuuid.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QBluetoothUuid : public QUuid
{
%TypeHeaderCode
#include <qbluetoothuuid.h>
%End
public:
enum class ProtocolUuid
{
Sdp,
Udp,
Rfcomm,
Tcp,
TcsBin,
TcsAt,
Att,
Obex,
Ip,
Ftp,
Http,
Wsp,
Bnep,
Upnp,
Hidp,
HardcopyControlChannel,
HardcopyDataChannel,
HardcopyNotification,
Avctp,
Avdtp,
Cmtp,
UdiCPlain,
McapControlChannel,
McapDataChannel,
L2cap,
};
enum class ServiceClassUuid
{
ServiceDiscoveryServer,
BrowseGroupDescriptor,
PublicBrowseGroup,
SerialPort,
LANAccessUsingPPP,
DialupNetworking,
IrMCSync,
ObexObjectPush,
OBEXFileTransfer,
IrMCSyncCommand,
Headset,
AudioSource,
AudioSink,
AV_RemoteControlTarget,
AdvancedAudioDistribution,
AV_RemoteControl,
AV_RemoteControlController,
HeadsetAG,
PANU,
NAP,
GN,
DirectPrinting,
ReferencePrinting,
BasicImage,
ImagingResponder,
ImagingAutomaticArchive,
ImagingReferenceObjects,
Handsfree,
HandsfreeAudioGateway,
DirectPrintingReferenceObjectsService,
ReflectedUI,
BasicPrinting,
PrintingStatus,
HumanInterfaceDeviceService,
HardcopyCableReplacement,
HCRPrint,
HCRScan,
SIMAccess,
PhonebookAccessPCE,
PhonebookAccessPSE,
PhonebookAccess,
HeadsetHS,
MessageAccessServer,
MessageNotificationServer,
MessageAccessProfile,
GNSS,
GNSSServer,
Display3D,
Glasses3D,
Synchronization3D,
MPSProfile,
MPSService,
PnPInformation,
GenericNetworking,
GenericFileTransfer,
GenericAudio,
GenericTelephony,
VideoSource,
VideoSink,
VideoDistribution,
HDP,
HDPSource,
HDPSink,
GenericAccess,
GenericAttribute,
ImmediateAlert,
LinkLoss,
TxPower,
CurrentTimeService,
ReferenceTimeUpdateService,
NextDSTChangeService,
Glucose,
HealthThermometer,
DeviceInformation,
HeartRate,
PhoneAlertStatusService,
BatteryService,
BloodPressure,
AlertNotificationService,
HumanInterfaceDevice,
ScanParameters,
RunningSpeedAndCadence,
CyclingSpeedAndCadence,
CyclingPower,
LocationAndNavigation,
EnvironmentalSensing,
BodyComposition,
UserData,
WeightScale,
BondManagement,
ContinuousGlucoseMonitoring,
};
enum class CharacteristicType
{
DeviceName,
Appearance,
PeripheralPrivacyFlag,
ReconnectionAddress,
PeripheralPreferredConnectionParameters,
ServiceChanged,
AlertLevel,
TxPowerLevel,
DateTime,
DayOfWeek,
DayDateTime,
ExactTime256,
DSTOffset,
TimeZone,
LocalTimeInformation,
TimeWithDST,
TimeAccuracy,
TimeSource,
ReferenceTimeInformation,
TimeUpdateControlPoint,
TimeUpdateState,
GlucoseMeasurement,
BatteryLevel,
TemperatureMeasurement,
TemperatureType,
IntermediateTemperature,
MeasurementInterval,
BootKeyboardInputReport,
SystemID,
ModelNumberString,
SerialNumberString,
FirmwareRevisionString,
HardwareRevisionString,
SoftwareRevisionString,
ManufacturerNameString,
IEEE1107320601RegulatoryCertificationDataList,
CurrentTime,
MagneticDeclination,
ScanRefresh,
BootKeyboardOutputReport,
BootMouseInputReport,
GlucoseMeasurementContext,
BloodPressureMeasurement,
IntermediateCuffPressure,
HeartRateMeasurement,
BodySensorLocation,
HeartRateControlPoint,
AlertStatus,
RingerControlPoint,
RingerSetting,
AlertCategoryIDBitMask,
AlertCategoryID,
AlertNotificationControlPoint,
UnreadAlertStatus,
NewAlert,
SupportedNewAlertCategory,
SupportedUnreadAlertCategory,
BloodPressureFeature,
HIDInformation,
ReportMap,
HIDControlPoint,
Report,
ProtocolMode,
ScanIntervalWindow,
PnPID,
GlucoseFeature,
RecordAccessControlPoint,
RSCMeasurement,
RSCFeature,
SCControlPoint,
CSCMeasurement,
CSCFeature,
SensorLocation,
CyclingPowerMeasurement,
CyclingPowerVector,
CyclingPowerFeature,
CyclingPowerControlPoint,
LocationAndSpeed,
Navigation,
PositionQuality,
LNFeature,
LNControlPoint,
Elevation,
Pressure,
Temperature,
Humidity,
TrueWindSpeed,
TrueWindDirection,
ApparentWindSpeed,
ApparentWindDirection,
GustFactor,
PollenConcentration,
UVIndex,
Irradiance,
Rainfall,
WindChill,
HeatIndex,
DewPoint,
DescriptorValueChanged,
AerobicHeartRateLowerLimit,
AerobicThreshold,
Age,
AnaerobicHeartRateLowerLimit,
AnaerobicHeartRateUpperLimit,
AnaerobicThreshold,
AerobicHeartRateUpperLimit,
DateOfBirth,
DateOfThresholdAssessment,
EmailAddress,
FatBurnHeartRateLowerLimit,
FatBurnHeartRateUpperLimit,
FirstName,
FiveZoneHeartRateLimits,
Gender,
HeartRateMax,
Height,
HipCircumference,
LastName,
MaximumRecommendedHeartRate,
RestingHeartRate,
SportTypeForAerobicAnaerobicThresholds,
ThreeZoneHeartRateLimits,
TwoZoneHeartRateLimits,
VO2Max,
WaistCircumference,
Weight,
DatabaseChangeIncrement,
UserIndex,
BodyCompositionFeature,
BodyCompositionMeasurement,
WeightMeasurement,
WeightScaleFeature,
UserControlPoint,
MagneticFluxDensity2D,
MagneticFluxDensity3D,
Language,
BarometricPressureTrend,
};
enum class DescriptorType
{
UnknownDescriptorType,
CharacteristicExtendedProperties,
CharacteristicUserDescription,
ClientCharacteristicConfiguration,
ServerCharacteristicConfiguration,
CharacteristicPresentationFormat,
CharacteristicAggregateFormat,
ValidRange,
ExternalReportReference,
ReportReference,
EnvironmentalSensingConfiguration,
EnvironmentalSensingMeasurement,
EnvironmentalSensingTriggerSetting,
};
QBluetoothUuid();
QBluetoothUuid(QBluetoothUuid::ProtocolUuid uuid);
QBluetoothUuid(QBluetoothUuid::ServiceClassUuid uuid);
QBluetoothUuid(QBluetoothUuid::CharacteristicType uuid);
QBluetoothUuid(QBluetoothUuid::DescriptorType uuid);
explicit QBluetoothUuid(quint32 uuid);
%If (Qt_6_6_0 -)
QBluetoothUuid(quint128 uuid, QSysInfo::Endian order = QSysInfo::BigEndian);
%End
%If (- Qt_6_6_0)
explicit QBluetoothUuid(quint128 uuid);
%End
explicit QBluetoothUuid(const QString &uuid);
QBluetoothUuid(const QBluetoothUuid &uuid);
QBluetoothUuid(const QUuid &uuid);
~QBluetoothUuid();
int minimumSize() const;
quint16 toUInt16(bool *ok = 0) const;
quint32 toUInt32(bool *ok = 0) const;
quint128 toUInt128() const;
static QString serviceClassToString(QBluetoothUuid::ServiceClassUuid uuid);
static QString protocolToString(QBluetoothUuid::ProtocolUuid uuid);
static QString characteristicToString(QBluetoothUuid::CharacteristicType uuid);
static QString descriptorToString(QBluetoothUuid::DescriptorType uuid);
%If (Qt_6_7_0 -)
// This is reimplemented because the == and != operators prevent the
// super-class's implementation from being inherited.
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
};
%End
%If (Qt_6_2_0 -)
QDataStream &operator<<(QDataStream &s, const QBluetoothUuid &uuid) /ReleaseGIL/;
%End
%If (Qt_6_2_0 -)
QDataStream &operator>>(QDataStream &s, QBluetoothUuid &uuid /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_2_0 -)
bool operator==(const QBluetoothUuid &a, const QBluetoothUuid &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QBluetoothUuid &a, const QBluetoothUuid &b);
%End

View File

@@ -0,0 +1,66 @@
// qlowenergyadvertisingdata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyAdvertisingData
{
%TypeHeaderCode
#include <qlowenergyadvertisingdata.h>
%End
public:
QLowEnergyAdvertisingData();
QLowEnergyAdvertisingData(const QLowEnergyAdvertisingData &other);
~QLowEnergyAdvertisingData();
void setLocalName(const QString &name);
QString localName() const;
static quint16 invalidManufacturerId();
void setManufacturerData(quint16 id, const QByteArray &data);
quint16 manufacturerId() const;
QByteArray manufacturerData() const;
void setIncludePowerLevel(bool doInclude);
bool includePowerLevel() const;
enum Discoverability
{
DiscoverabilityNone,
DiscoverabilityLimited,
DiscoverabilityGeneral,
};
void setDiscoverability(QLowEnergyAdvertisingData::Discoverability mode);
QLowEnergyAdvertisingData::Discoverability discoverability() const;
void setServices(const QList<QBluetoothUuid> &services);
QList<QBluetoothUuid> services() const;
void setRawData(const QByteArray &data);
QByteArray rawData() const;
void swap(QLowEnergyAdvertisingData &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyAdvertisingData &data1, const QLowEnergyAdvertisingData &data2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyAdvertisingData &data1, const QLowEnergyAdvertisingData &data2);
%End

View File

@@ -0,0 +1,88 @@
// qlowenergyadvertisingparameters.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyAdvertisingParameters
{
%TypeHeaderCode
#include <qlowenergyadvertisingparameters.h>
%End
public:
QLowEnergyAdvertisingParameters();
QLowEnergyAdvertisingParameters(const QLowEnergyAdvertisingParameters &other);
~QLowEnergyAdvertisingParameters();
enum Mode
{
AdvInd,
AdvScanInd,
AdvNonConnInd,
};
void setMode(QLowEnergyAdvertisingParameters::Mode mode);
QLowEnergyAdvertisingParameters::Mode mode() const;
class AddressInfo
{
%TypeHeaderCode
#include <qlowenergyadvertisingparameters.h>
%End
public:
AddressInfo(const QBluetoothAddress &addr, QLowEnergyController::RemoteAddressType t);
AddressInfo();
QBluetoothAddress address;
QLowEnergyController::RemoteAddressType type;
};
enum FilterPolicy
{
IgnoreWhiteList,
UseWhiteListForScanning,
UseWhiteListForConnecting,
UseWhiteListForScanningAndConnecting,
};
void setWhiteList(const QList<QLowEnergyAdvertisingParameters::AddressInfo> &whiteList, QLowEnergyAdvertisingParameters::FilterPolicy policy);
QList<QLowEnergyAdvertisingParameters::AddressInfo> whiteList() const;
QLowEnergyAdvertisingParameters::FilterPolicy filterPolicy() const;
void setInterval(quint16 minimum, quint16 maximum);
int minimumInterval() const;
int maximumInterval() const;
void swap(QLowEnergyAdvertisingParameters &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyAdvertisingParameters &p1, const QLowEnergyAdvertisingParameters &p2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyAdvertisingParameters &p1, const QLowEnergyAdvertisingParameters &p2);
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyAdvertisingParameters::AddressInfo &ai1, const QLowEnergyAdvertisingParameters::AddressInfo &ai2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyAdvertisingParameters::AddressInfo &a, const QLowEnergyAdvertisingParameters::AddressInfo &b);
%End

View File

@@ -0,0 +1,68 @@
// qlowenergycharacteristic.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyCharacteristic
{
%TypeHeaderCode
#include <qlowenergycharacteristic.h>
%End
public:
enum PropertyType /BaseType=Flag/
{
Unknown,
Broadcasting,
Read,
WriteNoResponse,
Write,
Notify,
Indicate,
WriteSigned,
ExtendedProperty,
};
typedef QFlags<QLowEnergyCharacteristic::PropertyType> PropertyTypes;
QLowEnergyCharacteristic();
QLowEnergyCharacteristic(const QLowEnergyCharacteristic &other);
~QLowEnergyCharacteristic();
QString name() const;
QBluetoothUuid uuid() const;
QByteArray value() const;
QLowEnergyCharacteristic::PropertyTypes properties() const;
QLowEnergyDescriptor descriptor(const QBluetoothUuid &uuid) const;
QList<QLowEnergyDescriptor> descriptors() const;
bool isValid() const;
QLowEnergyDescriptor clientCharacteristicConfiguration() const;
static const QByteArray CCCDDisable;
static const QByteArray CCCDEnableNotification;
static const QByteArray CCCDEnableIndication;
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyCharacteristic &a, const QLowEnergyCharacteristic &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyCharacteristic &a, const QLowEnergyCharacteristic &b);
%End

View File

@@ -0,0 +1,61 @@
// qlowenergycharacteristicdata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyCharacteristicData
{
%TypeHeaderCode
#include <qlowenergycharacteristicdata.h>
%End
public:
QLowEnergyCharacteristicData();
QLowEnergyCharacteristicData(const QLowEnergyCharacteristicData &other);
~QLowEnergyCharacteristicData();
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
QByteArray value() const;
void setValue(const QByteArray &value);
QLowEnergyCharacteristic::PropertyTypes properties() const;
void setProperties(QLowEnergyCharacteristic::PropertyTypes properties);
QList<QLowEnergyDescriptorData> descriptors() const;
void setDescriptors(const QList<QLowEnergyDescriptorData> &descriptors);
void addDescriptor(const QLowEnergyDescriptorData &descriptor);
void setReadConstraints(QBluetooth::AttAccessConstraints constraints);
QBluetooth::AttAccessConstraints readConstraints() const;
void setWriteConstraints(QBluetooth::AttAccessConstraints constraints);
QBluetooth::AttAccessConstraints writeConstraints() const;
void setValueLength(int minimum, int maximum);
int minimumValueLength() const;
int maximumValueLength() const;
bool isValid() const;
void swap(QLowEnergyCharacteristicData &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyCharacteristicData &cd1, const QLowEnergyCharacteristicData &cd2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyCharacteristicData &cd1, const QLowEnergyCharacteristicData &cd2);
%End

View File

@@ -0,0 +1,51 @@
// qlowenergyconnectionparameters.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyConnectionParameters
{
%TypeHeaderCode
#include <qlowenergyconnectionparameters.h>
%End
public:
QLowEnergyConnectionParameters();
QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other);
~QLowEnergyConnectionParameters();
void setIntervalRange(double minimum, double maximum);
double minimumInterval() const;
double maximumInterval() const;
void setLatency(int latency);
int latency() const;
void setSupervisionTimeout(int timeout);
int supervisionTimeout() const;
void swap(QLowEnergyConnectionParameters &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2);
%End

View File

@@ -0,0 +1,125 @@
// qlowenergycontroller.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyController : public QObject
{
%TypeHeaderCode
#include <qlowenergycontroller.h>
%End
public:
enum Error
{
NoError,
UnknownError,
UnknownRemoteDeviceError,
NetworkError,
InvalidBluetoothAdapterError,
ConnectionError,
AdvertisingError,
RemoteHostClosedError,
AuthorizationError,
%If (Qt_6_4_0 -)
MissingPermissionsError,
%End
%If (Qt_6_5_0 -)
RssiReadError,
%End
};
enum ControllerState
{
UnconnectedState,
ConnectingState,
ConnectedState,
DiscoveringState,
DiscoveredState,
ClosingState,
AdvertisingState,
};
enum RemoteAddressType
{
PublicAddress,
RandomAddress,
};
virtual ~QLowEnergyController();
QBluetoothAddress localAddress() const;
QBluetoothAddress remoteAddress() const;
QLowEnergyController::ControllerState state() const;
QLowEnergyController::RemoteAddressType remoteAddressType() const;
void setRemoteAddressType(QLowEnergyController::RemoteAddressType type);
void connectToDevice();
void disconnectFromDevice();
void discoverServices();
QList<QBluetoothUuid> services() const;
QLowEnergyService *createServiceObject(const QBluetoothUuid &service, QObject *parent /TransferThis/ = 0) /Factory/;
QLowEnergyController::Error error() const;
QString errorString() const;
QString remoteName() const;
int mtu() const;
signals:
void connected();
void disconnected();
void stateChanged(QLowEnergyController::ControllerState state);
void errorOccurred(QLowEnergyController::Error newError);
void serviceDiscovered(const QBluetoothUuid &newService);
void discoveryFinished();
void connectionUpdated(const QLowEnergyConnectionParameters &parameters);
void mtuChanged(int mtu);
public:
enum Role
{
CentralRole,
PeripheralRole,
};
static QLowEnergyController *createCentral(const QBluetoothDeviceInfo &remoteDevice, QObject *parent /TransferThis/ = 0) /Factory/;
static QLowEnergyController *createCentral(const QBluetoothDeviceInfo &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0) /Factory/;
static QLowEnergyController *createPeripheral(const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0) /Factory/;
static QLowEnergyController *createPeripheral(QObject *parent /TransferThis/ = 0) /Factory/;
void startAdvertising(const QLowEnergyAdvertisingParameters &parameters, const QLowEnergyAdvertisingData &advertisingData, const QLowEnergyAdvertisingData &scanResponseData = QLowEnergyAdvertisingData());
void stopAdvertising();
QLowEnergyService *addService(const QLowEnergyServiceData &service, QObject *parent /TransferThis/ = 0) /Factory/;
void requestConnectionUpdate(const QLowEnergyConnectionParameters &parameters);
QLowEnergyController::Role role() const;
QBluetoothUuid remoteDeviceUuid() const;
%If (Qt_6_5_0 -)
void readRssi();
%End
signals:
%If (Qt_6_5_0 -)
void rssiRead(qint16 rssi);
%End
private:
QLowEnergyController(const QBluetoothDeviceInfo &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent = 0);
QLowEnergyController(const QBluetoothAddress &localDevice, QObject *parent = 0);
};
%End

View File

@@ -0,0 +1,48 @@
// qlowenergydescriptor.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyDescriptor
{
%TypeHeaderCode
#include <qlowenergydescriptor.h>
%End
public:
QLowEnergyDescriptor();
QLowEnergyDescriptor(const QLowEnergyDescriptor &other);
~QLowEnergyDescriptor();
bool isValid() const;
QByteArray value() const;
QBluetoothUuid uuid() const;
QString name() const;
QBluetoothUuid::DescriptorType type() const;
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b);
%End

View File

@@ -0,0 +1,56 @@
// qlowenergydescriptordata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyDescriptorData
{
%TypeHeaderCode
#include <qlowenergydescriptordata.h>
%End
public:
QLowEnergyDescriptorData();
QLowEnergyDescriptorData(const QBluetoothUuid &uuid, const QByteArray &value);
QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other);
~QLowEnergyDescriptorData();
QByteArray value() const;
void setValue(const QByteArray &value);
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
bool isValid() const;
void setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints());
bool isReadable() const;
QBluetooth::AttAccessConstraints readConstraints() const;
void setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints());
bool isWritable() const;
QBluetooth::AttAccessConstraints writeConstraints() const;
void swap(QLowEnergyDescriptorData &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyDescriptorData &d1, const QLowEnergyDescriptorData &d12);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyDescriptorData &d1, const QLowEnergyDescriptorData &d2);
%End

View File

@@ -0,0 +1,107 @@
// qlowenergyservice.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyService : public QObject /NoDefaultCtors/
{
%TypeHeaderCode
#include <qlowenergyservice.h>
%End
public:
enum DiscoveryMode
{
FullDiscovery,
SkipValueDiscovery,
};
enum ServiceType /BaseType=Flag/
{
PrimaryService,
IncludedService,
};
typedef QFlags<QLowEnergyService::ServiceType> ServiceTypes;
enum ServiceError
{
NoError,
OperationError,
CharacteristicWriteError,
DescriptorWriteError,
CharacteristicReadError,
DescriptorReadError,
UnknownError,
};
enum ServiceState
{
InvalidService,
DiscoveryRequired,
ServiceDiscovered,
LocalService,
RemoteService,
RemoteServiceDiscovering,
RemoteServiceDiscovered,
DiscoveringService,
};
enum WriteMode
{
WriteWithResponse,
WriteWithoutResponse,
WriteSigned,
};
virtual ~QLowEnergyService();
QList<QBluetoothUuid> includedServices() const;
QLowEnergyService::ServiceTypes type() const;
QLowEnergyService::ServiceState state() const;
QLowEnergyCharacteristic characteristic(const QBluetoothUuid &uuid) const;
QList<QLowEnergyCharacteristic> characteristics() const;
QBluetoothUuid serviceUuid() const;
QString serviceName() const;
void discoverDetails(QLowEnergyService::DiscoveryMode mode = QLowEnergyService::FullDiscovery);
QLowEnergyService::ServiceError error() const;
bool contains(const QLowEnergyCharacteristic &characteristic) const;
bool contains(const QLowEnergyDescriptor &descriptor) const;
void writeCharacteristic(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue, QLowEnergyService::WriteMode mode = QLowEnergyService::WriteWithResponse);
void writeDescriptor(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue);
signals:
void stateChanged(QLowEnergyService::ServiceState newState);
void characteristicChanged(const QLowEnergyCharacteristic &info, const QByteArray &value);
void characteristicWritten(const QLowEnergyCharacteristic &info, const QByteArray &value);
void descriptorWritten(const QLowEnergyDescriptor &info, const QByteArray &value);
void errorOccurred(QLowEnergyService::ServiceError error);
public:
void readCharacteristic(const QLowEnergyCharacteristic &characteristic);
void readDescriptor(const QLowEnergyDescriptor &descriptor);
signals:
void characteristicRead(const QLowEnergyCharacteristic &info, const QByteArray &value);
void descriptorRead(const QLowEnergyDescriptor &info, const QByteArray &value);
};
%End

View File

@@ -0,0 +1,62 @@
// qlowenergyservicedata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth 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_2_0 -)
class QLowEnergyServiceData
{
%TypeHeaderCode
#include <qlowenergyservicedata.h>
%End
public:
QLowEnergyServiceData();
QLowEnergyServiceData(const QLowEnergyServiceData &other);
~QLowEnergyServiceData();
enum ServiceType
{
ServiceTypePrimary,
ServiceTypeSecondary,
};
QLowEnergyServiceData::ServiceType type() const;
void setType(QLowEnergyServiceData::ServiceType type);
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
QList<QLowEnergyService *> includedServices() const;
void setIncludedServices(const QList<QLowEnergyService *> &services);
void addIncludedService(QLowEnergyService *service);
QList<QLowEnergyCharacteristicData> characteristics() const;
void setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics);
void addCharacteristic(const QLowEnergyCharacteristicData &characteristic);
bool isValid() const;
void swap(QLowEnergyServiceData &other);
};
%End
%If (Qt_6_2_0 -)
bool operator==(const QLowEnergyServiceData &sd1, const QLowEnergyServiceData &sd2);
%End
%If (Qt_6_2_0 -)
bool operator!=(const QLowEnergyServiceData &sd1, const QLowEnergyServiceData &sd2);
%End

View File

@@ -0,0 +1,133 @@
// This is the SIP interface definition for the QList based mapped types
// specific to the QtBluetooth 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_2_0 -)
// QBluetoothServiceInfo::Sequence is actually a sub-class of QList<QVariant>.
// Note that QBluetoothServiceInfo::Alternative is identical and they are both
// syntactic sugar. By ignoring methods using the latter then everything works
// as expected.
%MappedType QBluetoothServiceInfo::Sequence
/TypeHintIn="Iterable[QVariant]", TypeHintOut="List[QVariant]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qbluetoothserviceinfo.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
QVariant *t = new QVariant(sipCpp->at(i));
PyObject *tobj = sipConvertFromNewType(t, sipType_QVariant,
sipTransferObj);
if (!tobj)
{
delete t;
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, tobj);
}
return l;
%End
%ConvertToTypeCode
PyObject *iter = PyObject_GetIter(sipPy);
if (!sipIsErr)
{
PyErr_Clear();
Py_XDECREF(iter);
return (iter && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
}
if (!iter)
{
*sipIsErr = 1;
return 0;
}
QBluetoothServiceInfo::Sequence *ql = new QBluetoothServiceInfo::Sequence;
for (Py_ssize_t i = 0; ; ++i)
{
PyErr_Clear();
PyObject *itm = PyIter_Next(iter);
if (!itm)
{
if (PyErr_Occurred())
{
delete ql;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
break;
}
int state;
QVariant *t = reinterpret_cast<QVariant *>(
sipForceConvertToType(itm, sipType_QVariant, sipTransferObj,
SIP_NOT_NONE, &state, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"index %zd has type '%s' but '_TYPE_' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete ql;
Py_DECREF(iter);
return 0;
}
ql->append(*t);
sipReleaseType(t, sipType_QVariant, state);
Py_DECREF(itm);
}
Py_DECREF(iter);
*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End
};
%End

View File

@@ -0,0 +1,183 @@
// This is the SIP interface definition for the QNultiHash based mapped types.
//
// 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_2_0 -)
template<quint16, _TYPE_>
%MappedType QMultiHash<quint16, _TYPE_>
/TypeHint="Dict[int, _TYPE_]", TypeHintValue="{}"/
{
%TypeHeaderCode
#include <QMultiHash>
%End
%ConvertFromTypeCode
PyObject *d = PyDict_New();
if (!d)
return 0;
QMultiHash<quint16, _TYPE_>::const_iterator it = sipCpp->constBegin();
QMultiHash<quint16, _TYPE_>::const_iterator end = sipCpp->constEnd();
while (it != end)
{
PyObject *kobj = PyLong_FromLong(it.key());
if (!kobj)
{
Py_DECREF(d);
return 0;
}
QList<_TYPE_> values = sipCpp->values(it.key());
PyObject *py_values = PyList_New(values.size());
if (!py_values)
{
Py_DECREF(kobj);
Py_DECREF(d);
return 0;
}
int rc = PyDict_SetItem(d, kobj, py_values);
Py_DECREF(py_values);
Py_DECREF(kobj);
if (rc < 0)
{
Py_DECREF(d);
return 0;
}
for (int i = 0; i < values.size(); ++i)
{
_TYPE_ *v = new _TYPE_(values.at(i));
PyObject *vobj = sipConvertFromNewType(v, sipType__TYPE_,
sipTransferObj);
if (!vobj)
{
delete v;
Py_DECREF(d);
return 0;
}
PyList_SetItem(py_values, i, vobj);
}
++it;
}
return d;
%End
};
%End
%If (Qt_6_3_0 -)
template<_TYPE1_, _TYPE2_>
%MappedType QMultiHash<_TYPE1_, _TYPE2_>
/TypeHint="Dict[_TYPE1_, _TYPE2_]", TypeHintValue="{}"/
{
%TypeHeaderCode
#include <QMultiHash>
%End
%ConvertFromTypeCode
PyObject *d = PyDict_New();
if (!d)
return 0;
QMultiHash<_TYPE1_, _TYPE2_>::const_iterator it = sipCpp->constBegin();
QMultiHash<_TYPE1_, _TYPE2_>::const_iterator end = sipCpp->constEnd();
while (it != end)
{
_TYPE1_ *k = new _TYPE1_(it.key());
PyObject *kobj = sipConvertFromNewType(k, sipType__TYPE1_,
sipTransferObj);
if (!kobj)
{
delete k;
Py_DECREF(d);
return 0;
}
QList<_TYPE2_> values = sipCpp->values(it.key());
PyObject *py_values = PyList_New(values.size());
if (!py_values)
{
Py_DECREF(kobj);
Py_DECREF(d);
return 0;
}
int rc = PyDict_SetItem(d, kobj, py_values);
Py_DECREF(py_values);
Py_DECREF(kobj);
if (rc < 0)
{
Py_DECREF(d);
return 0;
}
for (int i = 0; i < values.size(); ++i)
{
_TYPE2_ *v = new _TYPE2_(values.at(i));
PyObject *vobj = sipConvertFromNewType(v, sipType__TYPE2_,
sipTransferObj);
if (!vobj)
{
delete v;
Py_DECREF(d);
return 0;
}
PyList_SetItem(py_values, i, vobj);
}
++it;
}
return d;
%End
};
%End

View File

@@ -0,0 +1,131 @@
// This is the SIP interface definition for the quint128 mapped type.
//
// 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_2_0 -)
%MappedType quint128 /TypeHint="Tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]"/
{
%TypeHeaderCode
#include <qbluetoothuuid.h>
%End
%ConvertFromTypeCode
PyObject *t = PyTuple_New(16);
if (!t)
return 0;
#if defined(QT_SUPPORTS_INT128)
// This was added in Qt v6.6.0.
quint128 value = *sipCpp;
#endif
for (Py_ssize_t i = 0; i < 16; ++i)
{
// Convert to a Python long to make sure it doesn't get interpreted as
// a signed value.
#if defined(QT_SUPPORTS_INT128)
PyObject *pobj = PyLong_FromUnsignedLong(value & 255);
value >>= 8;
#else
PyObject *pobj = PyLong_FromUnsignedLong(sipCpp->data[i]);
#endif
if (!pobj)
{
Py_DECREF(t);
return 0;
}
PyTuple_SetItem(t, i, pobj);
}
return t;
%End
%ConvertToTypeCode
if (!sipIsErr)
return (PySequence_Check(sipPy) && !PyUnicode_Check(sipPy));
Py_ssize_t len = PySequence_Size(sipPy);
if (len != 16)
{
// A negative length should only be an internal error so let the
// original exception stand.
if (len >= 0)
PyErr_Format(PyExc_TypeError,
"sequence has %zd elements but 16 elements are expected",
len);
*sipIsErr = 1;
return 0;
}
quint128 *qv = new quint128;
for (Py_ssize_t i = 15; i >= 0; --i)
{
PyObject *itm = PySequence_GetItem(sipPy, i);
if (!itm)
{
delete qv;
*sipIsErr = 1;
return 0;
}
PyErr_Clear();
unsigned long val = PyLong_AsUnsignedLongMask(itm);
if (PyErr_Occurred())
{
PyErr_Format(PyExc_TypeError,
"element %zd has type '%s' but 'int' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete qv;
*sipIsErr = 1;
return 0;
}
#if defined(QT_SUPPORTS_INT128)
// This was added in Qt v6.6.0.
(*qv) <<= 8;
(*qv) |= (val & 255);
#else
qv->data[i] = val;
#endif
Py_DECREF(itm);
}
*sipCppPtr = qv;
return sipGetState(sipTransferObj);
%End
};
%End

View File

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

View File

@@ -0,0 +1,226 @@
// QtCoremod.sip generated by MetaSIP
//
// This file is part of the QtCore 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.QtCore, call_super_init=True, default_VirtualErrorHandler=PyQt6, keyword_arguments="Optional", use_limited_api=True, py_ssize_t_clean=True)
%Timeline {Qt_6_0_0 Qt_6_1_0 Qt_6_2_0 Qt_6_3_0 Qt_6_4_0 Qt_6_5_0 Qt_6_6_0 Qt_6_7_0 Qt_6_8_0 Qt_6_9_0 Qt_6_10_0}
%Platforms {Android iOS Linux macOS WebAssembly Windows}
%Feature PyQt_Accessibility
%Feature PyQt_SessionManager
%Feature PyQt_SSL
%Feature PyQt_qreal_double
%Feature PyQt_PrintDialog
%Feature PyQt_Printer
%Feature PyQt_PrintPreviewWidget
%Feature PyQt_PrintPreviewDialog
%Feature PyQt_RawFont
%Feature PyQt_OpenGL
%Feature PyQt_OpenGL_ES2
%Feature PyQt_Process
%Feature PyQt_WebChannel
%Feature PyQt_DTLS
%Feature PyQt_Permissions
%Feature PyQt_XCB
%Feature PyQt_Wayland
%Feature PyQt_Vulkan
%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
%Plugin PyQt6
%DefaultEncoding "ASCII"
%Include(name=pyqt-internal.sip5, optional=True)
%Include(name=pyqt-gpl.sip5, optional=True)
%Include(name=pyqt-commercial.sip5, optional=True)
%DefaultSupertype PyQt6.sip.simplewrapper
int PYQT_VERSION;
const char *PYQT_VERSION_STR;
%ModuleCode
static int PYQT_VERSION = 0x060a01;
static const char *PYQT_VERSION_STR = "6.10.1";
%End
%Include qglobal.sip
%Include qtenvironmentvariables.sip
%Include qtversion.sip
%Include qnamespace.sip
%Include qabstractanimation.sip
%Include qabstracteventdispatcher.sip
%Include qabstractitemmodel.sip
%Include qabstractnativeeventfilter.sip
%Include qabstractproxymodel.sip
%Include qanimationgroup.sip
%Include qbasictimer.sip
%Include qbitarray.sip
%Include qbuffer.sip
%Include qbytearray.sip
%Include qbytearrayalgorithms.sip
%Include qbytearraymatcher.sip
%Include qcalendar.sip
%Include qcborcommon.sip
%Include qcborstreamreader.sip
%Include qcborstreamwriter.sip
%Include qchar.sip
%Include qcollator.sip
%Include qcommandlineoption.sip
%Include qcommandlineparser.sip
%Include qconcatenatetablesproxymodel.sip
%Include qcoreapplication.sip
%Include qcoreevent.sip
%Include qcryptographichash.sip
%Include qdatastream.sip
%Include qdatetime.sip
%Include qdeadlinetimer.sip
%Include qdir.sip
%Include qdiriterator.sip
%Include qeasingcurve.sip
%Include qelapsedtimer.sip
%Include qeventloop.sip
%Include qfile.sip
%Include qfiledevice.sip
%Include qfileinfo.sip
%Include qfileselector.sip
%Include qfilesystemwatcher.sip
%Include qidentityproxymodel.sip
%Include qiodevice.sip
%Include qiodevicebase.sip
%Include qitemselectionmodel.sip
%Include qjsondocument.sip
%Include qjsonparseerror.sip
%Include qjsonvalue.sip
%Include qlibrary.sip
%Include qlibraryinfo.sip
%Include qline.sip
%Include qlocale.sip
%Include qlockfile.sip
%Include qlogging.sip
%Include qloggingcategory.sip
%Include qmargins.sip
%Include qmessageauthenticationcode.sip
%Include qmetaobject.sip
%Include qmetatype.sip
%Include qmimedata.sip
%Include qmimedatabase.sip
%Include qmimetype.sip
%Include qmutex.sip
%Include qnumeric.sip
%Include qobject.sip
%Include qobjectcleanuphandler.sip
%Include qobjectdefs.sip
%Include qoperatingsystemversion.sip
%Include qparallelanimationgroup.sip
%Include qpauseanimation.sip
%Include qpermissions.sip
%Include qpropertyanimation.sip
%Include qpluginloader.sip
%Include qpoint.sip
%Include qprocess.sip
%Include qrandom.sip
%Include qrangemodel.sip
%Include qreadwritelock.sip
%Include qrect.sip
%Include qregularexpression.sip
%Include qresource.sip
%Include qrunnable.sip
%Include qsavefile.sip
%Include qsemaphore.sip
%Include qsequentialanimationgroup.sip
%Include qsettings.sip
%Include qsharedmemory.sip
%Include qsignalmapper.sip
%Include qsize.sip
%Include qsocketnotifier.sip
%Include qsortfilterproxymodel.sip
%Include qstandardpaths.sip
%Include qstorageinfo.sip
%Include qstringconverter_base.sip
%Include qstringconverter.sip
%Include qstringlistmodel.sip
%Include qsysinfo.sip
%Include qsystemsemaphore.sip
%Include qtemporarydir.sip
%Include qtemporaryfile.sip
%Include qtextboundaryfinder.sip
%Include qtextstream.sip
%Include qthread.sip
%Include qthreadpool.sip
%Include qtimeline.sip
%Include qtimer.sip
%Include qtimezone.sip
%Include qtipccommon.sip
%Include qtranslator.sip
%Include qtransposeproxymodel.sip
%Include qtyperevision.sip
%Include qtypes.sip
%Include qurl.sip
%Include qurlquery.sip
%Include quuid.sip
%Include qvariant.sip
%Include qvariantanimation.sip
%Include qversionnumber.sip
%Include qwaitcondition.sip
%Include qxmlstream.sip
%Include qyieldcpu.sip
%Include qpycore_qset.sip
%Include qpycore_std_chrono_duration.sip
%Include qpycore_qhash.sip
%Include qmutexlocker.sip
%Include qpycore_qrangemodel.sip
%Include qjsonarray.sip
%Include qstringview.sip
%Include qpycore_virtual_error_handler.sip
%Include qpycore_qlist.sip
%Include qflags.sip
%Include qstringlist.sip
%Include qbytearrayview.sip
%Include qpycore_qmap.sip
%Include qanystringview.sip
%Include qwineventnotifier.sip
%Include qbytearraylist.sip
%Include qjsonobject.sip
%Include qpycore_std_optional.sip
%Include qstring.sip
%Include qpycore_std_pair.sip
%Include qpycore_native_interface.sip

View File

@@ -0,0 +1 @@
%License(type="gpl")

View File

@@ -0,0 +1,82 @@
// qabstractanimation.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QAbstractAnimation : public QObject
{
%TypeHeaderCode
#include <qabstractanimation.h>
%End
public:
enum Direction
{
Forward,
Backward,
};
enum State
{
Stopped,
Paused,
Running,
};
enum DeletionPolicy
{
KeepWhenStopped,
DeleteWhenStopped,
};
QAbstractAnimation(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractAnimation();
QAbstractAnimation::State state() const;
QAnimationGroup *group() const;
QAbstractAnimation::Direction direction() const;
void setDirection(QAbstractAnimation::Direction direction);
int currentTime() const;
int currentLoopTime() const;
int loopCount() const;
void setLoopCount(int loopCount);
int currentLoop() const;
virtual int duration() const = 0;
int totalDuration() const;
signals:
void finished();
void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
void currentLoopChanged(int currentLoop);
void directionChanged(QAbstractAnimation::Direction);
public slots:
void start(QAbstractAnimation::DeletionPolicy policy = QAbstractAnimation::KeepWhenStopped);
void pause();
void resume();
void setPaused(bool);
void stop();
void setCurrentTime(int msecs);
protected:
virtual bool event(QEvent *event);
virtual void updateCurrentTime(int currentTime) = 0;
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
virtual void updateDirection(QAbstractAnimation::Direction direction);
};

View File

@@ -0,0 +1,67 @@
// qabstracteventdispatcher.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
// Qt v6.8 introduced QAbstractEventDispatcherV2 as a temporary class intended to
// aid porting to Qt7 (where all timers will be based on std::chrono). We choose
// not to implement them as PyQt is likely to use Python ints anyway.
class QAbstractEventDispatcher : public QObject /Abstract/
{
%TypeHeaderCode
#include <qabstracteventdispatcher.h>
%End
public:
struct TimerInfo
{
%TypeHeaderCode
#include <qabstracteventdispatcher.h>
%End
int timerId;
int interval;
Qt::TimerType timerType;
TimerInfo(int id, int i, Qt::TimerType t);
};
explicit QAbstractEventDispatcher(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractEventDispatcher();
static QAbstractEventDispatcher *instance(QThread *thread = 0);
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0 /ReleaseGIL/;
int registerTimer(qint64 interval, Qt::TimerType timerType, QObject *object);
virtual void registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object) = 0;
virtual bool unregisterTimer(int timerId) = 0;
virtual bool unregisterTimers(QObject *object) = 0;
virtual QList<QAbstractEventDispatcher::TimerInfo> registeredTimers(QObject *object) const = 0;
virtual void wakeUp() = 0;
virtual void interrupt() = 0;
virtual void startingUp();
virtual void closingDown();
virtual int remainingTime(int timerId) = 0;
void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result /Out/);
signals:
void aboutToBlock();
void awake();
};

View File

@@ -0,0 +1,446 @@
// qabstractitemmodel.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QModelIndex
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
QModelIndex();
int row() const;
int column() const;
QVariant data(int role = Qt::DisplayRole) const;
Qt::ItemFlags flags() const;
SIP_PYOBJECT internalPointer() const;
%MethodCode
sipRes = reinterpret_cast<PyObject *>(sipCpp->internalPointer());
if (!sipRes)
sipRes = Py_None;
Py_INCREF(sipRes);
%End
SIP_PYOBJECT internalId() const /TypeHint="int"/;
%MethodCode
// Python needs to treat the result as an unsigned value (which may not happen
// on 64 bit systems). Instead we get the real value as it is stored (as a
// void *) and let Python convert that.
sipRes = PyLong_FromVoidPtr(sipCpp->internalPointer());
%End
const QAbstractItemModel *model() const;
bool isValid() const;
QModelIndex parent() const;
QModelIndex sibling(int arow, int acolumn) const;
QModelIndex siblingAtColumn(int column) const;
QModelIndex siblingAtRow(int row) const;
%If (- Qt_6_8_0)
bool operator==(const QModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator<(const QModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QModelIndex &other) const;
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
class QPersistentModelIndex
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
QPersistentModelIndex();
QPersistentModelIndex(const QModelIndex &index);
QPersistentModelIndex(const QPersistentModelIndex &other);
~QPersistentModelIndex();
int row() const;
int column() const;
QVariant data(int role = Qt::DisplayRole) const;
Qt::ItemFlags flags() const;
QModelIndex parent() const;
QModelIndex sibling(int row, int column) const;
const QAbstractItemModel *model() const;
bool isValid() const;
void swap(QPersistentModelIndex &other /Constrained/);
operator QModelIndex() const;
%If (- Qt_6_8_0)
bool operator<(const QPersistentModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator==(const QPersistentModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator==(const QModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QPersistentModelIndex &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QModelIndex &other) const;
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
typedef QList<QModelIndex> QModelIndexList;
class QAbstractItemModel : public QObject
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
enum LayoutChangeHint
{
NoLayoutChangeHint,
VerticalSortHint,
HorizontalSortHint,
};
explicit QAbstractItemModel(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractItemModel();
bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const = 0;
virtual QModelIndex parent(const QModelIndex &child) const = 0;
QObject *parent() const;
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const = 0;
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const = 0;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
virtual QMap<int, QVariant> itemData(const QModelIndex &index) const;
virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
virtual QStringList mimeTypes() const;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual Qt::DropActions supportedDropActions() const;
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual void fetchMore(const QModelIndex &parent);
virtual bool canFetchMore(const QModelIndex &parent) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
virtual QModelIndex buddy(const QModelIndex &index) const;
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const;
virtual QSize span(const QModelIndex &index) const;
signals:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles = QList<int>());
void headerDataChanged(Qt::Orientation orientation, int first, int last);
void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
void layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void rowsInserted(const QModelIndex &parent, int first, int last);
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
void rowsRemoved(const QModelIndex &parent, int first, int last);
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void columnsInserted(const QModelIndex &parent, int first, int last);
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
void columnsRemoved(const QModelIndex &parent, int first, int last);
void modelAboutToBeReset();
void modelReset();
public slots:
virtual bool submit();
virtual void revert();
protected:
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const;
bool decodeData(int row, int column, const QModelIndex &parent, QDataStream &stream);
void beginInsertRows(const QModelIndex &parent, int first, int last);
void endInsertRows();
void beginRemoveRows(const QModelIndex &parent, int first, int last);
void endRemoveRows();
void beginInsertColumns(const QModelIndex &parent, int first, int last);
void endInsertColumns();
void beginRemoveColumns(const QModelIndex &parent, int first, int last);
void endRemoveColumns();
QModelIndexList persistentIndexList() const;
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to);
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to);
public:
bool insertRow(int row, const QModelIndex &parent = QModelIndex());
bool insertColumn(int column, const QModelIndex &parent = QModelIndex());
bool removeRow(int row, const QModelIndex &parent = QModelIndex());
bool removeColumn(int column, const QModelIndex &parent = QModelIndex());
virtual Qt::DropActions supportedDragActions() const;
virtual QHash<int, QByteArray> roleNames() const;
protected:
QModelIndex createIndex(int row, int column, SIP_PYOBJECT object = 0) const [QModelIndex (int row, int column, const void *object = 0)];
%MethodCode
// The Qt API is broken (and won't be fixed as it would break binary
// compatibility) regarding the internal id of a model index on different
// architectures (32 vs 64 bits). We choose to work around the breakage as it
// is fairly subtle and continues to catch people out. Instead of letting Qt
// convert betweed an integer id and a pointer id (the internal format used by
// Qt) we let Python do it.
void *ptr;
if (a2)
{
// Try and convert it to a Python long and fallback to the object's
// address if it fails.
ptr = PyLong_AsVoidPtr(a2);
if (PyErr_Occurred())
{
PyErr_Clear();
ptr = a2;
}
}
else
{
ptr = 0;
}
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipRes = new QModelIndex(sipCpp->createIndex(a0, a1, ptr));
#else
sipRes = new QModelIndex(sipCpp->sipProtect_createIndex(a0, a1, ptr));
#endif
%End
signals:
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow);
void rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row);
void columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn);
void columnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column);
protected:
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow);
void endMoveRows();
bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn);
void endMoveColumns();
void beginResetModel() /ReleaseGIL/;
void endResetModel() /ReleaseGIL/;
protected slots:
virtual void resetInternalData();
public:
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const;
virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild);
virtual bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild);
bool moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild);
bool moveColumn(const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild);
enum class CheckIndexOption /BaseType=Flag/
{
NoOption,
IndexIsValid,
DoNotUseParent,
ParentIsInvalid,
};
typedef QFlags<QAbstractItemModel::CheckIndexOption> CheckIndexOptions;
bool checkIndex(const QModelIndex &index, QAbstractItemModel::CheckIndexOptions options = QAbstractItemModel::CheckIndexOption::NoOption) const;
virtual bool clearItemData(const QModelIndex &index);
virtual void multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const;
};
class QAbstractTableModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
explicit QAbstractTableModel(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractTableModel();
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
QObject *parent() const;
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
private:
virtual bool hasChildren(const QModelIndex &parent) const;
virtual QModelIndex parent(const QModelIndex &child) const;
};
class QAbstractListModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
explicit QAbstractListModel(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractListModel();
virtual QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
QObject *parent() const;
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
private:
virtual int columnCount(const QModelIndex &parent) const;
virtual bool hasChildren(const QModelIndex &parent) const;
virtual QModelIndex parent(const QModelIndex &child) const;
};
class QModelRoleData
{
%TypeHeaderCode
#include <qabstractitemmodel.h>
%End
public:
explicit QModelRoleData(int role);
int role() const;
const QVariant &data() const;
void setData(const QVariant &data);
void clearData();
};
class QModelRoleDataSpan
{
%TypeHeaderCode
// The capsule destructor for a QModelRoleData array.
static void qpycore_gc_modelroledata(PyObject *mrd_obj);
%End
%TypeCode
// The capsule destructor for a QModelRoleData array.
static void qpycore_gc_modelroledata(PyObject *mrd_obj)
{
delete reinterpret_cast<QList<QModelRoleData>* >(PyCapsule_GetPointer(mrd_obj, NULL));
}
%End
public:
QModelRoleDataSpan();
QModelRoleDataSpan(QModelRoleData &modelRoleData);
QModelRoleDataSpan(QList<QModelRoleData> modelRoleData);
%MethodCode
PyObject *a0cap = PyCapsule_New(a0, NULL, qpycore_gc_modelroledata);
if (a0cap)
{
sipSetUserObject((sipSimpleWrapper *)sipSelf, a0cap);
sipCpp = new QModelRoleDataSpan(*a0);
}
%End
qsizetype size() const;
qsizetype length() const /__len__/;
QModelRoleData *data() const;
QModelRoleData *begin() const;
QModelRoleData *end() const;
QModelRoleData &operator[](qsizetype index) const;
QVariant *dataForRole(int role) const;
};
%If (Qt_6_8_0 -)
bool operator>=(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>=(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>=(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>=(const QModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>(const QModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<(const QModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QPersistentModelIndex &lhs, const QModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QModelIndex &lhs, const QModelIndex &rhs);
%End

View File

@@ -0,0 +1,36 @@
// qabstractnativeeventfilter.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QAbstractNativeEventFilter
{
%TypeHeaderCode
#include <qabstractnativeeventfilter.h>
%End
public:
QAbstractNativeEventFilter();
virtual ~QAbstractNativeEventFilter();
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result /Out/) = 0;
private:
QAbstractNativeEventFilter(const QAbstractNativeEventFilter &);
};

View File

@@ -0,0 +1,67 @@
// qabstractproxymodel.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QAbstractProxyModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qabstractproxymodel.h>
%End
public:
explicit QAbstractProxyModel(QObject *parent /TransferThis/ = 0);
virtual ~QAbstractProxyModel();
virtual void setSourceModel(QAbstractItemModel *sourceModel /KeepReference/);
QAbstractItemModel *sourceModel() const;
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const = 0;
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const = 0;
virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const;
virtual QItemSelection mapSelectionFromSource(const QItemSelection &selection) const;
virtual bool submit();
virtual void revert();
virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
virtual QMap<int, QVariant> itemData(const QModelIndex &index) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
virtual QModelIndex buddy(const QModelIndex &index) const;
virtual bool canFetchMore(const QModelIndex &parent) const;
virtual void fetchMore(const QModelIndex &parent);
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
virtual QSize span(const QModelIndex &index) const;
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/;
virtual QStringList mimeTypes() const;
virtual Qt::DropActions supportedDropActions() const;
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
signals:
void sourceModelChanged();
public:
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual Qt::DropActions supportedDragActions() const;
virtual bool clearItemData(const QModelIndex &index);
virtual QHash<int, QByteArray> roleNames() const;
};

View File

@@ -0,0 +1,43 @@
// qanimationgroup.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QAnimationGroup : public QAbstractAnimation
{
%TypeHeaderCode
#include <qanimationgroup.h>
%End
public:
QAnimationGroup(QObject *parent /TransferThis/ = 0);
virtual ~QAnimationGroup();
QAbstractAnimation *animationAt(int index) const;
int animationCount() const;
int indexOfAnimation(QAbstractAnimation *animation) const;
void addAnimation(QAbstractAnimation *animation /Transfer/);
void insertAnimation(int index, QAbstractAnimation *animation /Transfer/);
void removeAnimation(QAbstractAnimation *animation /TransferBack/);
QAbstractAnimation *takeAnimation(int index) /TransferBack/;
void clear();
protected:
virtual bool event(QEvent *event);
};

View File

@@ -0,0 +1,92 @@
// This is the SIP interface definition for the QAnyStringView mapped type.
//
// 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_4_0 -)
%MappedType QAnyStringView /AllowNone, TypeHint="Union[QByteArray, QString]",TypeHintValue="''"/
{
%TypeHeaderCode
#include <qanystringview.h>
%End
%TypeCode
struct PyQtAnyStringState
{
const sipTypeDef *instance_type; // The instance's generated type.
void *instance; // Either the QByteArray or QString.
int instance_state; // The state of the instance conversion.
};
%End
%ConvertToTypeCode
if (sipIsErr == NULL)
return sipCanConvertToType(sipPy, sipType_QString, 0) ||
sipCanConvertToType(sipPy, sipType_QByteArray, SIP_NOT_NONE);
PyQtAnyStringState *state = new PyQtAnyStringState;
if (sipCanConvertToType(sipPy, sipType_QString, 0))
{
QString *qs = reinterpret_cast<QString *>(
sipConvertToType(sipPy, sipType_QString, sipTransferObj, 0,
&state->instance_state, sipIsErr));
if (*sipIsErr)
return 0;
*sipCppPtr = new QAnyStringView(*qs);
state->instance_type = sipType_QString;
state->instance = qs;
}
else
{
QByteArray *qba = reinterpret_cast<QByteArray *>(
sipConvertToType(sipPy, sipType_QByteArray, sipTransferObj,
SIP_NOT_NONE, &state->instance_state, sipIsErr));
if (*sipIsErr)
return 0;
*sipCppPtr = new QAnyStringView(*qba);
state->instance_type = sipType_QByteArray;
state->instance = qba;
}
*sipUserStatePtr = state;
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
return qpycore_PyObject_FromQString(sipCpp->toString());
%End
%ReleaseCode
delete sipCpp;
PyQtAnyStringState *state = reinterpret_cast<PyQtAnyStringState *>(sipUserState);
sipReleaseType(state->instance, state->instance_type, state->instance_state);
delete state;
%End
};
%End

View File

@@ -0,0 +1,48 @@
// qbasictimer.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QBasicTimer
{
%TypeHeaderCode
#include <qbasictimer.h>
%End
public:
QBasicTimer();
~QBasicTimer();
bool isActive() const;
int timerId() const;
void start(int msec, Qt::TimerType timerType, QObject *obj);
void start(int msec, QObject *obj);
void stop();
void swap(QBasicTimer &other /Constrained/);
%If (Qt_6_8_0 -)
int id() const;
%MethodCode
sipRes = qToUnderlying<Qt::TimerId>(sipCpp->id());
%End
%End
private:
QBasicTimer(const QBasicTimer &);
};

View File

@@ -0,0 +1,95 @@
// qbitarray.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QBitArray
{
%TypeHeaderCode
#include <qbitarray.h>
%End
%TypeCode
// This is needed by __hash__().
#include <qhash.h>
%End
public:
QBitArray();
QBitArray(qsizetype size, bool value = false);
QBitArray(const QBitArray &other);
qsizetype size() const;
qsizetype count() const /__len__/;
qsizetype count(bool on) const;
bool isEmpty() const;
bool isNull() const;
void resize(qsizetype size);
void detach();
bool isDetached() const;
void clear();
QBitArray &operator&=(const QBitArray &);
QBitArray &operator|=(const QBitArray &);
QBitArray &operator^=(const QBitArray &);
%If (- Qt_6_7_0)
// This was changed to be a global operator in Qt v6.7 but this isn't supported by SIP v6.8.
QBitArray operator~() const;
%End
%If (- Qt_6_8_0)
bool operator==(const QBitArray &a) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QBitArray &a) const;
%End
void fill(bool val, qsizetype first, qsizetype last);
bool fill(bool val, qsizetype size = -1);
void truncate(qsizetype pos);
bool testBit(qsizetype i) const;
void setBit(qsizetype i);
void setBit(qsizetype i, bool val);
void clearBit(qsizetype i);
bool toggleBit(qsizetype i);
bool operator[](qsizetype i) const;
bool at(qsizetype i) const;
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
void swap(QBitArray &other /Constrained/);
SIP_PYOBJECT bits() const /TypeHint="bytes"/;
%MethodCode
return PyBytes_FromStringAndSize(sipCpp->bits(), (sipCpp->size() + 7) / 8);
%End
static QBitArray fromBits(const char *data /Encoding="None"/, Py_ssize_t len) [QBitArray (const char *data, qsizetype len)];
quint32 toUInt32(QSysInfo::Endian endianness, bool *ok = 0) const;
};
QBitArray operator&(const QBitArray &, const QBitArray &);
QBitArray operator|(const QBitArray &, const QBitArray &);
QBitArray operator^(const QBitArray &, const QBitArray &);
QDataStream &operator<<(QDataStream &, const QBitArray &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QBitArray & /Constrained/) /ReleaseGIL/;
%If (Qt_6_8_0 -)
bool operator!=(const QBitArray &lhs, const QBitArray &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QBitArray &lhs, const QBitArray &rhs);
%End

View File

@@ -0,0 +1,114 @@
// qbuffer.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QBuffer : public QIODevice
{
%TypeHeaderCode
#include <qbuffer.h>
%End
public:
explicit QBuffer(QObject *parent /TransferThis/ = 0);
QBuffer(QByteArray *byteArray /Constrained/, QObject *parent /TransferThis/ = 0);
virtual ~QBuffer();
QByteArray &buffer();
const QByteArray &data() const;
void setBuffer(QByteArray *a /Constrained/);
void setData(const QByteArray &data);
%If (- Qt_6_5_0)
void setData(const char *adata /Array/, int alen /ArraySize/);
%End
%If (Qt_6_5_0 -)
void setData(const char *data /Array/, qsizetype len /ArraySize/);
%End
virtual bool open(QIODeviceBase::OpenMode openMode);
virtual void close();
virtual qint64 size() const;
virtual qint64 pos() const;
virtual bool seek(qint64 off);
virtual bool atEnd() const;
virtual bool canReadLine() const;
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxlen)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QBuffer::readData(s, a0) : sipCpp->readData(s, a0);
#else
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipRes = sipSelfWasArg ?
sipCpp->QBuffer::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
#else
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
#endif
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
};

View File

@@ -0,0 +1,503 @@
// qbytearray.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qbytearray.h>
%End
class QByteArray /TypeHintIn="Union[QByteArray, bytes, bytearray, memoryview]"/
{
%TypeHeaderCode
#include <qbytearray.h>
%End
%TypeCode
// This is needed by __hash__().
#include <qhash.h>
// Convenience function for converting a QByteArray to a Python str object.
static PyObject *QByteArrayToPyStr(QByteArray *ba)
{
char *data = ba->data();
if (data)
// QByteArrays may have embedded '\0's so set the size explicitly.
return PyBytes_FromStringAndSize(data, ba->size());
return PyBytes_FromString("");
}
%End
%ConvertToTypeCode
// Accept anything that implements the buffer protocol (including QByteArray
// itself).
if (sipIsErr == NULL)
return sipGetBufferInfo(sipPy, NULL);
// If it is already a QByteArray then use it rather than make an unnecessary
// copy of the data.
if (sipCanConvertToType(sipPy, sipType_QByteArray, SIP_NO_CONVERTORS))
{
*sipCppPtr = reinterpret_cast<QByteArray *>(
sipConvertToType(sipPy, sipType_QByteArray, sipTransferObj,
SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
}
// Create a QByteArray from the data.
sipBufferInfoDef buffer_info;
if (sipGetBufferInfo(sipPy, &buffer_info) > 0)
{
// Check that the buffer is compatible with one defined by
// PyBuffer_FillInfo() as used by QByteArray and the standard Python byte
// objects.
if (buffer_info.bi_format == NULL || buffer_info.bi_format[0] == 'B')
{
*sipCppPtr = new QByteArray(
reinterpret_cast<const char *>(buffer_info.bi_buf),
(qsizetype)buffer_info.bi_len);
sipReleaseBufferInfo(&buffer_info);
// We don't support transfer of ownership.
return SIP_TEMPORARY;
}
PyErr_Format(PyExc_TypeError, "unsupported buffer format '%s'",
buffer_info.bi_format);
sipReleaseBufferInfo(&buffer_info);
}
*sipIsErr = 1;
return 0;
%End
%BIGetBufferCode
// We may be building against a debug Python build.
#if defined(Py_LIMITED_API)
Q_UNUSED(sipSelf);
sipBuffer->bd_buffer = sipCpp->data();
sipBuffer->bd_length = sipCpp->size();
sipBuffer->bd_readonly = 0;
sipRes = 0;
#else
sipRes = PyBuffer_FillInfo(sipBuffer, sipSelf, sipCpp->data(),
sipCpp->size(), 0, sipFlags);
#endif
%End
%PickleCode
sipRes = Py_BuildValue("(y#)", sipCpp->data(), static_cast<Py_ssize_t>(sipCpp->size()));
%End
public:
QByteArray();
QByteArray(qsizetype size, char c /Encoding="None"/);
QByteArray(const QByteArray &a);
~QByteArray();
void resize(qsizetype size);
%If (Qt_6_4_0 -)
void resize(qsizetype size, char c);
%End
QByteArray &fill(char c /Encoding="None"/, qsizetype size = -1);
void clear();
qsizetype indexOf(QByteArrayView bv, qsizetype from = 0) const;
// In Qt v6.2 this was replaced by two separate overloads. However we need to keep the optional keyword argument.
qsizetype lastIndexOf(QByteArrayView bv, qsizetype from = -1) const;
qsizetype count(QByteArrayView bv) const;
QByteArray left(qsizetype len) const;
QByteArray right(qsizetype len) const;
QByteArray mid(qsizetype index, qsizetype length = -1) const;
QByteArray first(qsizetype n) const;
QByteArray last(qsizetype n) const;
bool startsWith(QByteArrayView bv) const;
bool endsWith(QByteArrayView bv) const;
void truncate(qsizetype pos);
void chop(qsizetype n);
QByteArray toLower() const;
QByteArray toUpper() const;
QByteArray trimmed() const;
QByteArray simplified() const;
QByteArray leftJustified(qsizetype width, char fill /Encoding="None"/ = ' ', bool truncate = false) const;
QByteArray rightJustified(qsizetype width, char fill /Encoding="None"/ = ' ', bool truncate = false) const;
QByteArray &prepend(QByteArrayView a);
QByteArray &prepend(qsizetype count, char c /Encoding="None"/);
QByteArray &append(QByteArrayView a);
QByteArray &append(qsizetype count, char c /Encoding="None"/);
QByteArray &insert(qsizetype i, QByteArrayView data);
QByteArray &insert(qsizetype i, qsizetype count, char c /Encoding="None"/);
QByteArray &remove(qsizetype index, qsizetype len);
QByteArray &replace(QByteArrayView before, QByteArrayView after);
QByteArray &replace(qsizetype index, qsizetype len, QByteArrayView s);
QList<QByteArray> split(char sep /Encoding="None"/) const;
QByteArray &operator+=(QByteArrayView a);
bool operator==(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp == *a0);
%End
bool operator!=(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp != *a0);
%End
bool operator<(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp < *a0);
%End
bool operator>(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp > *a0);
%End
bool operator<=(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp <= *a0);
%End
bool operator>=(const QString &s2) const;
%MethodCode
// Needed for Qt v6.8 and later.
sipRes = (*sipCpp >= *a0);
%End
short toShort(bool *ok = 0, int base = 10) const;
ushort toUShort(bool *ok = 0, int base = 10) const;
int toInt(bool *ok = 0, int base = 10) const;
uint toUInt(bool *ok = 0, int base = 10) const;
long toLong(bool *ok = 0, int base = 10) const;
ulong toULong(bool *ok = 0, int base = 10) const;
qlonglong toLongLong(bool *ok = 0, int base = 10) const;
qulonglong toULongLong(bool *ok = 0, int base = 10) const;
float toFloat(bool *ok = 0) const;
double toDouble(bool *ok = 0) const;
QByteArray toBase64(QByteArray::Base64Options options = QByteArray::Base64Encoding) const;
QByteArray &setNum(double n /Constrained/, char format = 'g', int precision = 6);
QByteArray &setNum(SIP_PYOBJECT n /TypeHint="int"/, int base = 10);
%MethodCode
qlonglong val = sipLong_AsLongLong(a0);
if (!PyErr_Occurred())
{
sipRes = &sipCpp->setNum(val, a1);
}
else
{
// If it is positive then it might fit an unsigned long long.
qulonglong uval = sipLong_AsUnsignedLongLong(a0);
if (!PyErr_Occurred())
{
sipRes = &sipCpp->setNum(uval, a1);
}
else
{
sipError = (PyErr_ExceptionMatches(PyExc_OverflowError)
? sipErrorFail : sipErrorContinue);
}
}
%End
static QByteArray number(double n /Constrained/, char format = 'g', int precision = 6);
static QByteArray number(SIP_PYOBJECT n /TypeHint="int"/, int base = 10);
%MethodCode
qlonglong val = sipLong_AsLongLong(a0);
if (!PyErr_Occurred())
{
sipRes = new QByteArray(QByteArray::number(val, a1));
}
else
{
// If it is positive then it might fit an unsigned long long.
qulonglong uval = sipLong_AsUnsignedLongLong(a0);
if (!PyErr_Occurred())
{
sipRes = new QByteArray(QByteArray::number(uval, a1));
}
else
{
sipError = (PyErr_ExceptionMatches(PyExc_OverflowError)
? sipErrorFail : sipErrorContinue);
}
}
%End
static QByteArray fromBase64(const QByteArray &base64, QByteArray::Base64Options options = QByteArray::Base64Encoding);
static QByteArray fromHex(const QByteArray &hexEncoded);
qsizetype count() const;
qsizetype length() const;
bool isNull() const;
qsizetype size() const /__len__/;
char at(qsizetype i) const /Encoding="None"/;
char operator[](qsizetype i) const /Encoding="None"/;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->size());
if (idx < 0)
sipIsErr = 1;
else
sipRes = sipCpp->operator[]((qsizetype)idx);
%End
QByteArray operator[](SIP_PYSLICE slice) const;
%MethodCode
Py_ssize_t start, stop, step, slicelength;
if (sipConvertFromSliceObject(a0, sipCpp->size(), &start, &stop, &step, &slicelength) < 0)
{
sipIsErr = 1;
}
else
{
sipRes = new QByteArray();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
sipRes->append(sipCpp->at((qsizetype)start));
start += step;
}
}
%End
int __contains__(const QByteArrayView bv) const;
%MethodCode
sipRes = sipCpp->contains(*a0);
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
SIP_PYOBJECT __str__() const /TypeHint="str"/;
%MethodCode
sipRes = QByteArrayToPyStr(sipCpp);
PyObject *repr = PyObject_Repr(sipRes);
if (repr)
{
Py_DECREF(sipRes);
sipRes = repr;
}
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QByteArray()");
}
else
{
PyObject *str = QByteArrayToPyStr(sipCpp);
if (str)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtCore.QByteArray(%R)", str);
Py_DECREF(str);
}
}
%End
QByteArray operator*(int m) const;
%MethodCode
sipRes = new QByteArray();
while (a0-- > 0)
*sipRes += *sipCpp;
%End
QByteArray &operator*=(int m);
%MethodCode
QByteArray orig(*sipCpp);
sipCpp->clear();
while (a0-- > 0)
*sipCpp += orig;
%End
bool isEmpty() const;
SIP_PYOBJECT data() /TypeHint="bytes"/;
%MethodCode
// QByteArrays may contain embedded '\0's so set the size explicitly.
char *res = sipCpp->data();
qsizetype len = sipCpp->size();
if (res)
{
if ((sipRes = PyBytes_FromStringAndSize(res, (Py_ssize_t)len)) == NULL)
sipIsErr = 1;
}
else
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
%End
qsizetype capacity() const;
void reserve(qsizetype size);
void squeeze();
void push_back(QByteArrayView a);
void push_front(QByteArrayView a);
bool contains(QByteArrayView bv) const;
QByteArray toHex(char separator /Encoding="None"/ = '\x00') const;
QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(), const QByteArray &include = QByteArray(), char percent = '%') const;
static QByteArray fromPercentEncoding(const QByteArray &input, char percent = '%');
QByteArray repeated(qsizetype times) const;
void swap(QByteArray &other /Constrained/);
enum Base64Option /BaseType=Flag/
{
Base64Encoding,
Base64UrlEncoding,
KeepTrailingEquals,
OmitTrailingEquals,
IgnoreBase64DecodingErrors,
AbortOnBase64DecodingErrors,
};
typedef QFlags<QByteArray::Base64Option> Base64Options;
QByteArray chopped(qsizetype len) const;
int compare(QByteArrayView a, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool isUpper() const;
bool isLower() const;
enum class Base64DecodingStatus
{
Ok,
IllegalInputLength,
IllegalCharacter,
IllegalPadding,
};
static QByteArray::FromBase64Result fromBase64Encoding(const QByteArray &base64, QByteArray::Base64Options options = QByteArray::Base64Encoding);
class FromBase64Result
{
%TypeHeaderCode
#include <qbytearray.h>
%End
public:
QByteArray decoded;
QByteArray::Base64DecodingStatus decodingStatus;
void swap(QByteArray::FromBase64Result &other /Constrained/);
operator bool() const;
%MethodCode
// This is required because SIP doesn't handle operator bool() properly.
sipRes = sipCpp->operator bool();
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
QByteArray sliced(qsizetype pos) const;
QByteArray sliced(qsizetype pos, qsizetype n) const;
%If (Qt_6_3_0 -)
bool isValidUtf8() const;
%End
%If (Qt_6_4_0 -)
QByteArray percentDecoded(char percent = '%') const;
%End
%If (Qt_6_5_0 -)
QByteArray &removeAt(qsizetype pos);
%End
%If (Qt_6_5_0 -)
QByteArray &removeFirst();
%End
%If (Qt_6_5_0 -)
QByteArray &removeLast();
%End
%If (Qt_6_6_0 -)
QByteArray &assign(QByteArrayView v);
%End
%If (Qt_6_8_0 -)
QByteArray &slice(qsizetype pos, qsizetype n);
%End
%If (Qt_6_8_0 -)
QByteArray &slice(qsizetype pos);
%End
%If (Qt_6_8_0 -)
qsizetype max_size() const;
%End
%If (Qt_6_8_0 -)
static qsizetype maxSize();
%End
%If (Qt_6_10_0 -)
QByteArray nullTerminated() const;
%End
%If (Qt_6_10_0 -)
QByteArray &nullTerminate();
%End
};
bool operator==(const QByteArray &a1, const QByteArray &a2);
bool operator!=(const QByteArray &a1, const QByteArray &a2);
bool operator<(const QByteArray &a1, const QByteArray &a2);
bool operator<=(const QByteArray &a1, const QByteArray &a2);
bool operator>(const QByteArray &a1, const QByteArray &a2);
bool operator>=(const QByteArray &a1, const QByteArray &a2);
%If (Qt_6_5_0 -)
QByteArray operator+(const QByteArray &a1, const QByteArray &a2);
%End
%If (- Qt_6_5_0)
const QByteArray operator+(const QByteArray &a1, const QByteArray &a2);
%End
QDataStream &operator<<(QDataStream &, const QByteArray & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QByteArray & /Constrained/) /ReleaseGIL/;
QByteArray qCompress(const uchar *data /Array/, qsizetype nbytes /ArraySize/, int compressionLevel = -1);
QByteArray qCompress(const QByteArray &data, int compressionLevel = -1);
QByteArray qUncompress(const uchar *data /Array/, qsizetype nbytes /ArraySize/);
QByteArray qUncompress(const QByteArray &data);
%If (- Qt_6_2_0)
quint16 qChecksum(QByteArrayView data, Qt::ChecksumType standard = Qt::ChecksumIso3309);
%End
bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs);
bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs);

View File

@@ -0,0 +1,31 @@
// qbytearrayalgorithms.sip generated by MetaSIP
//
// This file is part of the QtCore 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_2_0 -)
%ModuleCode
#include <qbytearrayalgorithms.h>
%End
%End
%If (Qt_6_2_0 -)
quint16 qChecksum(QByteArrayView data, Qt::ChecksumType standard = Qt::ChecksumIso3309);
%End

View File

@@ -0,0 +1,124 @@
// This is the SIP interface definition for the QByteArrayList mapped type.
//
// 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.
%MappedType QByteArrayList
/TypeHintIn="Iterable[QByteArray]", TypeHintOut="List[QByteArray]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qstringlist.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
QByteArray *t = new QByteArray(sipCpp->at(i));
PyObject *tobj = sipConvertFromNewType(t, sipType_QByteArray,
sipTransferObj);
if (!tobj)
{
delete t;
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, tobj);
}
return l;
%End
%ConvertToTypeCode
PyObject *iter = PyObject_GetIter(sipPy);
if (!sipIsErr)
{
PyErr_Clear();
Py_XDECREF(iter);
return (iter && !PyUnicode_Check(sipPy));
}
if (!iter)
{
*sipIsErr = 1;
return 0;
}
QByteArrayList *ql = new QByteArrayList;
for (Py_ssize_t i = 0; ; ++i)
{
PyErr_Clear();
PyObject *itm = PyIter_Next(iter);
if (!itm)
{
if (PyErr_Occurred())
{
delete ql;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
break;
}
int state;
QByteArray *t = reinterpret_cast<QByteArray *>(
sipForceConvertToType(itm, sipType_QByteArray, sipTransferObj,
SIP_NOT_NONE, &state, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"index %zd has type '%s' but 'str' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete ql;
Py_DECREF(iter);
return 0;
}
ql->append(*t);
sipReleaseType(t, sipType_QByteArray, state);
Py_DECREF(itm);
}
Py_DECREF(iter);
*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End
};

View File

@@ -0,0 +1,56 @@
// qbytearraymatcher.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QByteArrayMatcher
{
%TypeHeaderCode
#include <qbytearraymatcher.h>
%End
public:
%If (Qt_6_3_0 -)
QByteArrayMatcher(const char *pattern /Encoding="None"/, qsizetype length = -1);
%End
%If (- Qt_6_3_0)
QByteArrayMatcher(const char *pattern /Encoding="None"/, qsizetype length);
%End
%If (Qt_6_3_0 -)
explicit QByteArrayMatcher(QByteArrayView pattern);
%End
%If (- Qt_6_3_0)
%If (Qt_6_4_0 -)
explicit QByteArrayMatcher(const QByteArray &pattern);
%End
%End
QByteArrayMatcher();
QByteArrayMatcher(const QByteArrayMatcher &other);
~QByteArrayMatcher();
void setPattern(const QByteArray &pattern);
%If (Qt_6_3_0 -)
qsizetype indexIn(QByteArrayView data, qsizetype from = 0) const;
%End
%If (- Qt_6_3_0)
qsizetype indexIn(const QByteArray &ba, qsizetype from = 0) const;
%End
qsizetype indexIn(const char *str /Encoding="None"/, qsizetype len, qsizetype from = 0) const;
QByteArray pattern() const;
};

View File

@@ -0,0 +1,67 @@
// This is the SIP interface definition for the QByteArrayView mapped type.
//
// 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.
%MappedType QByteArrayView /TypeHint="QByteArray"/
{
%TypeHeaderCode
#include <qbytearrayview.h>
%End
%ConvertToTypeCode
if (sipIsErr == NULL)
{
// Note that we choose to use QByteArray's implementation of the buffer
// protocol.
return sipGetBufferInfo(sipPy, NULL);
}
sipBufferInfoDef *buffer_info = (sipBufferInfoDef *)sipMalloc(
sizeof (sipBufferInfoDef));
if (buffer_info)
{
if (sipGetBufferInfo(sipPy, buffer_info) > 0)
{
*sipCppPtr = new QByteArrayView(
reinterpret_cast<const unsigned char *>(buffer_info->bi_buf),
(qsizetype)buffer_info->bi_len);
*sipUserStatePtr = buffer_info;
// We don't support transfer of ownership.
return SIP_TEMPORARY;
}
sipFree(buffer_info);
}
*sipIsErr = 1;
return 0;
%End
%ReleaseCode
delete sipCpp;
sipBufferInfoDef *buffer_info = reinterpret_cast<sipBufferInfoDef *>(sipUserState);
sipReleaseBufferInfo(buffer_info);
sipFree(buffer_info);
%End
};

View File

@@ -0,0 +1,99 @@
// qcalendar.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCalendar
{
%TypeHeaderCode
#include <qcalendar.h>
%End
public:
enum
{
Unspecified,
};
struct YearMonthDay
{
%TypeHeaderCode
#include <qcalendar.h>
%End
YearMonthDay();
YearMonthDay(int year, int month = 1, int day = 1);
bool isValid() const;
int year;
int month;
int day;
};
enum class System
{
Gregorian,
Julian,
Milankovic,
Jalali,
IslamicCivil,
};
QCalendar();
explicit QCalendar(QCalendar::System system);
%If (Qt_6_4_0 -)
explicit QCalendar(QAnyStringView name);
%End
%If (- Qt_6_4_0)
explicit QCalendar(const char *name /Encoding="Latin-1"/) [(QLatin1String name)];
%MethodCode
// This is currently the only occurence of a QLatin1String argument.
sipCpp = new QCalendar(QLatin1String(a0));
%End
%End
int daysInMonth(int month, int year = QCalendar::Unspecified) const;
int daysInYear(int year) const;
int monthsInYear(int year) const;
bool isDateValid(int year, int month, int day) const;
bool isLeapYear(int year) const;
bool isGregorian() const;
bool isLunar() const;
bool isLuniSolar() const;
bool isSolar() const;
bool isProleptic() const;
bool hasYearZero() const;
int maximumDaysInMonth() const;
int minimumDaysInMonth() const;
int maximumMonthsInYear() const;
QString name() const;
QDate dateFromParts(int year, int month, int day) const;
QDate dateFromParts(const QCalendar::YearMonthDay &parts) const;
QCalendar::YearMonthDay partsFromDate(QDate date) const;
int dayOfWeek(QDate date) const;
QString monthName(const QLocale &locale, int month, int year = QCalendar::Unspecified, QLocale::FormatType format = QLocale::LongFormat) const;
QString standaloneMonthName(const QLocale &locale, int month, int year = QCalendar::Unspecified, QLocale::FormatType format = QLocale::LongFormat) const;
QString weekDayName(const QLocale &locale, int day, QLocale::FormatType format = QLocale::LongFormat) const;
QString standaloneWeekDayName(const QLocale &locale, int day, QLocale::FormatType format = QLocale::LongFormat) const;
QString dateTimeToString(QStringView format, const QDateTime &datetime, QDate dateOnly, QTime timeOnly, const QLocale &locale) const;
static QStringList availableCalendars();
%If (Qt_6_7_0 -)
QDate matchCenturyToWeekday(const QCalendar::YearMonthDay &parts, int dow) const;
%End
};

View File

@@ -0,0 +1,99 @@
// qcborcommon.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qcborcommon.h>
%End
// Handwritten implementation of QCborSimpleType.
// Cast-XML has a bug which means that it places this definition in qmetatype.h
// (where it is first declared).
enum class QCborSimpleType : quint8 {
False /PyName=False_/,
True /PyName=True_/,
Null,
Undefined
};
struct QCborError
{
%TypeHeaderCode
#include <qcborcommon.h>
%End
enum Code
{
UnknownError,
AdvancePastEnd,
InputOutputError,
GarbageAtEnd,
EndOfFile,
UnexpectedBreak,
UnknownType,
IllegalType,
IllegalNumber,
IllegalSimpleType,
InvalidUtf8String,
DataTooLarge,
NestingTooDeep,
UnsupportedType,
NoError,
};
// Error code access
// This class is currently undocumented. Access to the error code is via a
// cast (which SIP doesn't support) or a badly named instance variable. To be
// safe we implement a more Qt-typical solution.
QCborError::Code code() const;
%MethodCode
sipRes = sipCpp->c;
%End
QString toString() const;
};
enum class QCborKnownTags
{
DateTimeString,
UnixTime_t,
PositiveBignum,
NegativeBignum,
Decimal,
Bigfloat,
COSE_Encrypt0,
COSE_Mac0,
COSE_Sign1,
ExpectedBase64url,
ExpectedBase64,
ExpectedBase16,
EncodedCbor,
Url,
Base64url,
Base64,
RegularExpression,
MimeMessage,
Uuid,
COSE_Encrypt,
COSE_Mac,
COSE_Sign,
Signature,
};

View File

@@ -0,0 +1,164 @@
// qcborstreamreader.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCborStreamReader
{
%TypeHeaderCode
#include <qcborstreamreader.h>
%End
public:
enum Type : quint8
{
UnsignedInteger,
NegativeInteger,
ByteString,
ByteArray,
TextString,
String,
Array,
Map,
Tag,
SimpleType,
HalfFloat,
Float16,
Float,
Double,
Invalid,
};
enum StringResultCode
{
EndOfString,
Ok,
Error,
};
QCborStreamReader();
explicit QCborStreamReader(const QByteArray &data);
explicit QCborStreamReader(QIODevice *device);
~QCborStreamReader();
void setDevice(QIODevice *device);
QIODevice *device() const;
void addData(const QByteArray &data);
void reparse();
void clear();
void reset();
%If (Qt_6_7_0 -)
QCborError lastError() const;
%End
%If (- Qt_6_7_0)
QCborError lastError();
%End
qint64 currentOffset() const;
bool isValid() const;
int containerDepth() const;
QCborStreamReader::Type parentContainerType() const;
bool hasNext() const;
bool next(int maxRecursion = 10000);
QCborStreamReader::Type type() const;
bool isUnsignedInteger() const;
bool isNegativeInteger() const;
bool isInteger() const;
bool isByteArray() const;
bool isString() const;
bool isArray() const;
bool isMap() const;
bool isTag() const;
bool isSimpleType() const;
bool isFloat16() const;
bool isFloat() const;
bool isDouble() const;
bool isInvalid() const;
bool isSimpleType(QCborSimpleType st) const;
bool isFalse() const;
bool isTrue() const;
bool isBool() const;
bool isNull() const;
bool isUndefined() const;
bool isLengthKnown() const;
quint64 length() const /__len__/;
bool isContainer() const;
bool enterContainer();
bool leaveContainer();
SIP_PYTUPLE readString() /TypeHint="Tuple[str, QCborStreamReader.StringResultCode]"/;
%MethodCode
QCborStreamReader::StringResult<QString> res = sipCpp->readString();
QString *qs = new QString;
if (res.status != QCborStreamReader::Error)
*qs = res.data;
sipRes = sipBuildResult(NULL, "NF", qs, sipType_QString, NULL, res.status, sipType_QCborStreamReader_StringResultCode);
%End
SIP_PYTUPLE readByteArray() /TypeHint="Tuple[QByteArray, QCborStreamReader.StringResultCode]"/;
%MethodCode
QCborStreamReader::StringResult<QByteArray> res = sipCpp->readByteArray();
QByteArray *qba = new QByteArray;
if (res.status != QCborStreamReader::Error)
*qba = res.data;
sipRes = sipBuildResult(NULL, "NF", qba, sipType_QByteArray, NULL, res.status, sipType_QCborStreamReader_StringResultCode);
%End
%If (Qt_6_7_0 -)
SIP_PYTUPLE readUtf8String() /TypeHint="Tuple[QByteArray, QCborStreamReader.StringResultCode]"/;
%MethodCode
QCborStreamReader::StringResult<QByteArray> res = sipCpp->readUtf8String();
QByteArray *qba = new QByteArray;
if (res.status != QCborStreamReader::Error)
*qba = res.data;
sipRes = sipBuildResult(NULL, "NF", qba, sipType_QByteArray, NULL, res.status, sipType_QCborStreamReader_StringResultCode);
%End
%End
bool toBool() const;
quint64 toUnsignedInteger() const;
QCborSimpleType toSimpleType() const;
double toDouble() const;
qint64 toInteger() const;
%If (Qt_6_7_0 -)
bool readAndAppendToString(QString &dst);
%End
%If (Qt_6_7_0 -)
bool readAndAppendToUtf8String(QByteArray &dst);
%End
%If (Qt_6_7_0 -)
bool readAndAppendToByteArray(QByteArray &dst);
%End
%If (Qt_6_7_0 -)
QString readAllString();
%End
%If (Qt_6_7_0 -)
QByteArray readAllUtf8String();
%End
%If (Qt_6_7_0 -)
QByteArray readAllByteArray();
%End
private:
QCborStreamReader(const QCborStreamReader &);
};

View File

@@ -0,0 +1,86 @@
// qcborstreamwriter.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCborStreamWriter
{
%TypeHeaderCode
#include <qcborstreamwriter.h>
%End
public:
explicit QCborStreamWriter(QIODevice *device);
explicit QCborStreamWriter(QByteArray *data /Constrained/);
~QCborStreamWriter();
void setDevice(QIODevice *device);
QIODevice *device() const;
%If (- Qt_6_10_0)
void append(const QByteArray &ba);
%End
%If (Qt_6_10_0 -)
void append(QByteArrayView ba);
%End
void append(QStringView str);
void append(QCborKnownTags tag);
void append(QCborSimpleType st);
void append(bool b /Constrained/);
void append(double d /Constrained/);
void append(SIP_PYOBJECT /TypeHint="int"/);
%MethodCode
static PyObject *zero = 0;
if (!zero)
zero = PyLong_FromLong(0);
if (PyObject_RichCompareBool(a0, zero, Py_LT) > 0)
{
PyErr_Clear();
qint64 val = sipLong_AsLongLong(a0);
if (PyErr_Occurred())
sipError = sipErrorFail;
else
sipCpp->append(val);
}
else
{
PyErr_Clear();
quint64 val = sipLong_AsUnsignedLongLong(a0);
if (PyErr_Occurred())
sipError = sipErrorFail;
else
sipCpp->append(val);
}
%End
void appendNull();
void appendUndefined();
void startArray();
void startArray(quint64 count);
bool endArray();
void startMap();
void startMap(quint64 count);
bool endMap();
private:
QCborStreamWriter(const QCborStreamWriter &);
};

View File

@@ -0,0 +1,270 @@
// qchar.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QChar /TypeHint="str"/
{
%TypeHeaderCode
#include <qchar.h>
%End
%ConvertToTypeCode
if (sipIsErr == NULL)
return PyUnicode_Check(sipPy);
// TODO: review replacing with something more efficient.
QString qs = qpycore_PyObject_AsQString(sipPy);
if (qs.size() != 1)
{
PyErr_SetString(PyExc_ValueError, "string of length 1 expected");
*sipIsErr = 1;
return 0;
}
*sipCppPtr = new QChar(qs.at(0));
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
// TODO: replace with...
// return PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND, sipCpp, 1);
return qpycore_PyObject_FromQString(QString(*sipCpp));
%End
public:
enum Script
{
Script_Unknown,
Script_Inherited,
Script_Common,
Script_Latin,
Script_Greek,
Script_Cyrillic,
Script_Armenian,
Script_Hebrew,
Script_Arabic,
Script_Syriac,
Script_Thaana,
Script_Devanagari,
Script_Bengali,
Script_Gurmukhi,
Script_Gujarati,
Script_Oriya,
Script_Tamil,
Script_Telugu,
Script_Kannada,
Script_Malayalam,
Script_Sinhala,
Script_Thai,
Script_Lao,
Script_Tibetan,
Script_Myanmar,
Script_Georgian,
Script_Hangul,
Script_Ethiopic,
Script_Cherokee,
Script_CanadianAboriginal,
Script_Ogham,
Script_Runic,
Script_Khmer,
Script_Mongolian,
Script_Hiragana,
Script_Katakana,
Script_Bopomofo,
Script_Han,
Script_Yi,
Script_OldItalic,
Script_Gothic,
Script_Deseret,
Script_Tagalog,
Script_Hanunoo,
Script_Buhid,
Script_Tagbanwa,
Script_Coptic,
Script_Limbu,
Script_TaiLe,
Script_LinearB,
Script_Ugaritic,
Script_Shavian,
Script_Osmanya,
Script_Cypriot,
Script_Braille,
Script_Buginese,
Script_NewTaiLue,
Script_Glagolitic,
Script_Tifinagh,
Script_SylotiNagri,
Script_OldPersian,
Script_Kharoshthi,
Script_Balinese,
Script_Cuneiform,
Script_Phoenician,
Script_PhagsPa,
Script_Nko,
Script_Sundanese,
Script_Lepcha,
Script_OlChiki,
Script_Vai,
Script_Saurashtra,
Script_KayahLi,
Script_Rejang,
Script_Lycian,
Script_Carian,
Script_Lydian,
Script_Cham,
Script_TaiTham,
Script_TaiViet,
Script_Avestan,
Script_EgyptianHieroglyphs,
Script_Samaritan,
Script_Lisu,
Script_Bamum,
Script_Javanese,
Script_MeeteiMayek,
Script_ImperialAramaic,
Script_OldSouthArabian,
Script_InscriptionalParthian,
Script_InscriptionalPahlavi,
Script_OldTurkic,
Script_Kaithi,
Script_Batak,
Script_Brahmi,
Script_Mandaic,
Script_Chakma,
Script_MeroiticCursive,
Script_MeroiticHieroglyphs,
Script_Miao,
Script_Sharada,
Script_SoraSompeng,
Script_Takri,
Script_CaucasianAlbanian,
Script_BassaVah,
Script_Duployan,
Script_Elbasan,
Script_Grantha,
Script_PahawhHmong,
Script_Khojki,
Script_LinearA,
Script_Mahajani,
Script_Manichaean,
Script_MendeKikakui,
Script_Modi,
Script_Mro,
Script_OldNorthArabian,
Script_Nabataean,
Script_Palmyrene,
Script_PauCinHau,
Script_OldPermic,
Script_PsalterPahlavi,
Script_Siddham,
Script_Khudawadi,
Script_Tirhuta,
Script_WarangCiti,
Script_Ahom,
Script_AnatolianHieroglyphs,
Script_Hatran,
Script_Multani,
Script_OldHungarian,
Script_SignWriting,
Script_Adlam,
Script_Bhaiksuki,
Script_Marchen,
Script_Newa,
Script_Osage,
Script_Tangut,
Script_MasaramGondi,
Script_Nushu,
Script_Soyombo,
Script_ZanabazarSquare,
Script_Dogra,
Script_GunjalaGondi,
Script_HanifiRohingya,
Script_Makasar,
Script_Medefaidrin,
Script_OldSogdian,
Script_Sogdian,
Script_Elymaic,
Script_Nandinagari,
Script_NyiakengPuachueHmong,
Script_Wancho,
Script_Chorasmian,
Script_DivesAkuru,
Script_KhitanSmallScript,
Script_Yezidi,
%If (Qt_6_3_0 -)
Script_CyproMinoan,
%End
%If (Qt_6_3_0 -)
Script_NagMundari,
%End
%If (Qt_6_3_0 -)
Script_OldUyghur,
%End
%If (Qt_6_3_0 -)
Script_Tangsa,
%End
%If (Qt_6_3_0 -)
Script_Toto,
%End
%If (Qt_6_3_0 -)
Script_Vithkuqi,
%End
%If (Qt_6_5_0 -)
Script_Kawi,
%End
%If (Qt_6_9_0 -)
Script_Garay,
%End
%If (Qt_6_9_0 -)
Script_GurungKhema,
%End
%If (Qt_6_9_0 -)
Script_KiratRai,
%End
%If (Qt_6_9_0 -)
Script_OlOnal,
%End
%If (Qt_6_9_0 -)
Script_Sunuwar,
%End
%If (Qt_6_9_0 -)
Script_Todhri,
%End
%If (Qt_6_9_0 -)
Script_TuluTigalari,
%End
};
};
bool operator>=(const QChar &lhs, const QChar &rhs);
bool operator<=(const QChar &lhs, const QChar &rhs);
bool operator>(const QChar &lhs, const QChar &rhs);
bool operator<(const QChar &lhs, const QChar &rhs);
bool operator!=(const QChar &lhs, const QChar &rhs);
bool operator==(const QChar &lhs, const QChar &rhs);
%If (- Qt_6_10_0)
QDataStream &operator>>(QDataStream &, QChar & /Constrained/) /ReleaseGIL/;
%End
%If (- Qt_6_10_0)
QDataStream &operator<<(QDataStream &, QChar) /ReleaseGIL/;
%End

View File

@@ -0,0 +1,69 @@
// qcollator.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCollatorSortKey
{
%TypeHeaderCode
#include <qcollator.h>
%End
public:
QCollatorSortKey(const QCollatorSortKey &other);
~QCollatorSortKey();
void swap(QCollatorSortKey &other /Constrained/);
int compare(const QCollatorSortKey &key) const;
private:
QCollatorSortKey();
};
bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs);
class QCollator
{
%TypeHeaderCode
#include <qcollator.h>
%End
public:
QCollator();
explicit QCollator(const QLocale &locale);
QCollator(const QCollator &);
~QCollator();
void swap(QCollator &other /Constrained/);
void setLocale(const QLocale &locale);
QLocale locale() const;
Qt::CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(Qt::CaseSensitivity cs);
void setNumericMode(bool on);
bool numericMode() const;
void setIgnorePunctuation(bool on);
bool ignorePunctuation() const;
int compare(const QString &s1, const QString &s2) const;
QCollatorSortKey sortKey(const QString &string) const;
%If (Qt_6_3_0 -)
static int defaultCompare(QStringView s1, QStringView s2);
%End
%If (Qt_6_3_0 -)
static QCollatorSortKey defaultSortKey(QStringView key);
%End
};

View File

@@ -0,0 +1,58 @@
// qcommandlineoption.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCommandLineOption
{
%TypeHeaderCode
#include <qcommandlineoption.h>
%End
public:
explicit QCommandLineOption(const QString &name);
explicit QCommandLineOption(const QStringList &names);
QCommandLineOption(const QString &name, const QString &description, const QString &valueName = QString(), const QString &defaultValue = QString());
QCommandLineOption(const QStringList &names, const QString &description, const QString &valueName = QString(), const QString &defaultValue = QString());
QCommandLineOption(const QCommandLineOption &other);
~QCommandLineOption();
void swap(QCommandLineOption &other /Constrained/);
QStringList names() const;
void setValueName(const QString &name);
QString valueName() const;
void setDescription(const QString &description);
QString description() const;
void setDefaultValue(const QString &defaultValue);
void setDefaultValues(const QStringList &defaultValues);
QStringList defaultValues() const;
enum Flag /BaseType=Flag/
{
HiddenFromHelp,
ShortOptionStyle,
%If (Qt_6_9_0 -)
IgnoreOptionsAfter,
%End
};
typedef QFlags<QCommandLineOption::Flag> Flags;
QCommandLineOption::Flags flags() const;
void setFlags(QCommandLineOption::Flags aflags);
};

View File

@@ -0,0 +1,87 @@
// qcommandlineparser.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCommandLineParser
{
%TypeHeaderCode
#include <qcommandlineparser.h>
%End
public:
QCommandLineParser();
~QCommandLineParser();
enum SingleDashWordOptionMode
{
ParseAsCompactedShortOptions,
ParseAsLongOptions,
};
void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode parsingMode);
bool addOption(const QCommandLineOption &commandLineOption);
QCommandLineOption addVersionOption();
QCommandLineOption addHelpOption();
void setApplicationDescription(const QString &description);
QString applicationDescription() const;
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString());
void clearPositionalArguments();
void process(const QStringList &arguments) /ReleaseGIL/;
void process(const QCoreApplication &app) /ReleaseGIL/;
bool parse(const QStringList &arguments);
QString errorText() const;
bool isSet(const QString &name) const;
QString value(const QString &name) const;
QStringList values(const QString &name) const;
bool isSet(const QCommandLineOption &option) const;
QString value(const QCommandLineOption &option) const;
QStringList values(const QCommandLineOption &option) const;
QStringList positionalArguments() const;
QStringList optionNames() const;
QStringList unknownOptionNames() const;
void showHelp(int exitCode = 0) /ReleaseGIL/;
QString helpText() const;
bool addOptions(const QList<QCommandLineOption> &options);
void showVersion();
enum OptionsAfterPositionalArgumentsMode
{
ParseAsOptions,
ParseAsPositionalArguments,
};
void setOptionsAfterPositionalArgumentsMode(QCommandLineParser::OptionsAfterPositionalArgumentsMode mode);
%If (Qt_6_9_0 -)
enum class MessageType
{
Information,
Error,
};
%End
%If (Qt_6_9_0 -)
static void showMessageAndExit(QCommandLineParser::MessageType type, const QString &message, int exitCode = 0);
%End
private:
QCommandLineParser(const QCommandLineParser &);
};

View File

@@ -0,0 +1,93 @@
// qconcatenatetablesproxymodel.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QConcatenateTablesProxyModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qconcatenatetablesproxymodel.h>
%End
public:
explicit QConcatenateTablesProxyModel(QObject *parent /TransferThis/ = 0);
virtual ~QConcatenateTablesProxyModel();
void addSourceModel(QAbstractItemModel *sourceModel /GetWrapper/);
%MethodCode
// We want to keep a reference to the model but this is in addition to the
// existing ones and does not replace them - so we can't use /KeepReference/.
sipCpp->addSourceModel(a0);
// Use the user object as a list of the references.
PyObject *user = sipGetUserObject((sipSimpleWrapper *)sipSelf);
if (!user)
{
user = PyList_New(0);
sipSetUserObject((sipSimpleWrapper *)sipSelf, user);
}
if (user)
PyList_Append(user, a0Wrapper);
%End
void removeSourceModel(QAbstractItemModel *sourceModel /GetWrapper/);
%MethodCode
// Discard the extra model reference that we took in addSourceModel().
sipCpp->removeSourceModel(a0);
// Use the user object as a list of the references.
PyObject *user = sipGetUserObject((sipSimpleWrapper *)sipSelf);
if (user)
{
Py_ssize_t i = 0;
// Note that we deal with an object appearing in the list more than once.
while (i < PyList_Size(user))
if (PyList_GetItem(user, i) == a0Wrapper)
PyList_SetSlice(user, i, i + 1, NULL);
else
++i;
}
%End
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
virtual QMap<int, QVariant> itemData(const QModelIndex &proxyIndex) const;
virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex parent(const QModelIndex &index) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QStringList mimeTypes() const;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/;
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual QSize span(const QModelIndex &index) const;
QList<QAbstractItemModel *> sourceModels() const;
%If (Qt_6_9_0 -)
virtual QHash<int, QByteArray> roleNames() const;
%End
};

View File

@@ -0,0 +1,410 @@
// qcoreapplication.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qcoreapplication.h>
%End
class QCoreApplication : public QObject
{
%TypeHeaderCode
#include <qcoreapplication.h>
%End
public:
QCoreApplication(SIP_PYLIST argv /TypeHint="List[str]"/) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, int = QCoreApplication::ApplicationFlags)];
%MethodCode
// The Python interface is a list of argument strings that is modified.
int argc;
char **argv;
// Convert the list.
if ((argv = pyqt6_from_argv_list(a0, argc)) == NULL)
sipIsErr = 1;
else
{
// Create it now the arguments are right.
static int nargc;
nargc = argc;
Py_BEGIN_ALLOW_THREADS
sipCpp = new sipQCoreApplication(nargc, argv, QT_VERSION);
Py_END_ALLOW_THREADS
// Now modify the original list.
pyqt6_update_argv_list(a0, argc, argv);
}
%End
virtual ~QCoreApplication() /ReleaseGIL/;
%MethodCode
pyqt6_cleanup_qobjects();
%End
static void setOrganizationDomain(const QString &orgDomain);
static QString organizationDomain();
static void setOrganizationName(const QString &orgName);
static QString organizationName();
static void setApplicationName(const QString &application);
static QString applicationName();
static QStringList arguments();
static QCoreApplication *instance();
static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/;
static void processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents) /ReleaseGIL/;
static void processEvents(QEventLoop::ProcessEventsFlags flags, int maxtime) /ReleaseGIL/;
%If (Qt_6_7_0 -)
static void processEvents(QEventLoop::ProcessEventsFlags flags, QDeadlineTimer deadline) /ReleaseGIL/;
%End
static bool sendEvent(QObject *receiver, QEvent *event) /ReleaseGIL/;
static void postEvent(QObject *receiver, QEvent *event /Transfer/, int priority = Qt::NormalEventPriority);
static void sendPostedEvents(QObject *receiver = 0, int eventType = 0) /ReleaseGIL/;
static void removePostedEvents(QObject *receiver, int eventType = 0);
virtual bool notify(QObject *, QEvent *) /ReleaseGIL/;
static bool startingUp();
static bool closingDown();
static QString applicationDirPath();
static QString applicationFilePath();
static void setLibraryPaths(const QStringList &);
static QStringList libraryPaths();
static void addLibraryPath(const QString &);
static void removeLibraryPath(const QString &);
static bool installTranslator(QTranslator *messageFile);
static bool removeTranslator(QTranslator *messageFile);
static QString translate(const char *context, const char *sourceText /Encoding="UTF-8"/, const char *disambiguation = 0, int n = -1);
static void setAttribute(Qt::ApplicationAttribute attribute, bool on = true);
static bool testAttribute(Qt::ApplicationAttribute attribute);
public slots:
static void quit();
%If (Qt_6_1_0 -)
static void exit(int returnCode = 0);
%End
public:
%If (- Qt_6_1_0)
static void exit(int returnCode = 0);
%End
signals:
void aboutToQuit();
protected:
virtual bool event(QEvent *);
public:
static void setApplicationVersion(const QString &version);
static QString applicationVersion();
static qint64 applicationPid();
static QAbstractEventDispatcher *eventDispatcher();
static void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher /Transfer/);
static bool isQuitLockEnabled();
static void setQuitLockEnabled(bool enabled);
void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
static void setSetuidAllowed(bool allow);
static bool isSetuidAllowed();
SIP_PYOBJECT __enter__();
%MethodCode
// Just return a reference to self.
sipRes = sipSelf;
Py_INCREF(sipRes);
%End
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
%MethodCode
// Make sure the QCoreApplication is destroyed.
delete sipCpp;
%End
%If (Qt_6_5_0 -)
%If (PyQt_Permissions)
Qt::PermissionStatus checkPermission(const QPermission &permission);
%End
%End
%If (Qt_6_5_0 -)
%If (PyQt_Permissions)
void requestPermission(const QPermission &permission, SIP_PYCALLABLE handler /TypeHint="Callable[[QPermission], None]"/) /ReleaseGIL/;
%MethodCode
// Make sure the callable doesn't get garbage collected until it is invoked.
Py_INCREF(a1);
Py_BEGIN_ALLOW_THREADS
sipCpp->requestPermission(*a0, [a1](const QPermission &arg0) {
SIP_BLOCK_THREADS
PyObject *res;
res = sipCallMethod(NULL, a1, "N", new QPermission(arg0), sipType_QPermission, NULL);
Py_DECREF(a1);
if (!res)
pyqt6_err_print();
else
Py_DECREF(res);
SIP_UNBLOCK_THREADS
});
Py_END_ALLOW_THREADS
%End
%End
%End
};
void qAddPostRoutine(SIP_PYCALLABLE);
%MethodCode
// Add it to the list of post routines if it already exists.
if (qtcore_PostRoutines != NULL)
{
// See if there is an empty slot.
bool app = true;
for (Py_ssize_t i = 0; i < PyList_Size(qtcore_PostRoutines); ++i)
if (PyList_GetItem(qtcore_PostRoutines, i) == Py_None)
{
Py_INCREF(a0);
PyList_SetItem(qtcore_PostRoutines, i, a0);
app = false;
break;
}
if (app && PyList_Append(qtcore_PostRoutines, a0) < 0)
sipIsErr = 1;
}
else if ((qtcore_PostRoutines = PyList_New(1)) != NULL)
{
Py_INCREF(a0);
PyList_SetItem(qtcore_PostRoutines, 0, a0);
qAddPostRoutine(qtcore_CallPostRoutines);
}
else
{
sipIsErr = 1;
}
%End
void qRemovePostRoutine(SIP_PYCALLABLE);
%MethodCode
// Remove it from the list of post routines if it exists.
if (qtcore_PostRoutines != NULL)
for (Py_ssize_t i = 0; i < PyList_Size(qtcore_PostRoutines); ++i)
if (PyList_GetItem(qtcore_PostRoutines, i) == a0)
{
Py_INCREF(Py_None);
PyList_SetItem(qtcore_PostRoutines, i, Py_None);
break;
}
%End
void qAddPreRoutine(SIP_PYCALLABLE routine /TypeHint="Callable[[], None]"/);
%MethodCode
// Add it to the list of pre routines if it already exists.
if (qtcore_PreRoutines != NULL)
{
if (PyList_Append(qtcore_PreRoutines, a0) < 0)
sipIsErr = 1;
}
else if ((qtcore_PreRoutines = PyList_New(1)) != NULL)
{
Py_INCREF(a0);
PyList_SetItem(qtcore_PreRoutines, 0, a0);
qAddPreRoutine(qtcore_CallPreRoutines);
}
else
{
sipIsErr = 1;
}
%End
// Module code needed by qAddPreRoutine, qAddPostRoutine() and qRemovePostRoutine().
%ModuleCode
// The list of Python pre routines.
static PyObject *qtcore_PreRoutines = NULL;
// Call all of the registered Python pre routines.
static void qtcore_CallPreRoutines()
{
for (Py_ssize_t i = 0; i < PyList_Size(qtcore_PreRoutines); ++i)
{
PyObject *pr = PyList_GetItem(qtcore_PreRoutines, i);
if (pr != Py_None)
{
PyObject *res = PyObject_CallObject(pr, NULL);
Py_XDECREF(res);
}
}
}
// The list of Python post routines.
static PyObject *qtcore_PostRoutines = NULL;
// Call all of the registered Python post routines.
static void qtcore_CallPostRoutines()
{
for (Py_ssize_t i = 0; i < PyList_Size(qtcore_PostRoutines); ++i)
{
PyObject *pr = PyList_GetItem(qtcore_PostRoutines, i);
if (pr != Py_None)
{
PyObject *res = PyObject_CallObject(pr, NULL);
Py_XDECREF(res);
}
}
}
%End
void pyqtRemoveInputHook();
%MethodCode
// Clear the Python input hook installed when the module was initialised.
PyOS_InputHook = 0;
%End
void pyqtRestoreInputHook();
%MethodCode
// Restore the input hook.
PyOS_InputHook = qtcore_input_hook;
%End
%ModuleCode
#include <QCoreApplication>
#include <QEventLoop>
#include <QThread>
#if defined(Q_OS_WIN)
#include <conio.h>
#include <QTimer>
#else
#include <QSocketNotifier>
#endif
// This is the input hook that will process events while the interpreter is
// waiting for interactive input.
extern "C" {static int qtcore_input_hook();}
static int qtcore_input_hook()
{
QCoreApplication *app = QCoreApplication::instance();
if (app && app->thread() == QThread::currentThread())
{
QEventLoop loop;
#if defined(Q_OS_WIN)
QTimer timer;
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
while (!_kbhit())
{
// The delay is based on feedback from users.
timer.start(35);
loop.exec();
timer.stop();
}
QObject::disconnect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
#else
QSocketNotifier notifier(0, QSocketNotifier::Read, 0);
QObject::connect(&notifier, SIGNAL(activated(int)), &loop, SLOT(quit()));
loop.exec();
QObject::disconnect(&notifier, SIGNAL(activated(int)), &loop, SLOT(quit()));
#endif
}
return 0;
}
%End
%PostInitialisationCode
// Process events from the input hook.
PyOS_InputHook = qtcore_input_hook;
%End
%ExportedTypeHintCode
# Support for QDate, QDateTime and QTime.
import datetime
# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], QtCore.pyqtBoundSignal]
%End
%TypeHintCode
# Support for QDate, QDateTime and QTime.
import datetime
# Support for new-style signals and slots.
class pyqtSignal:
signatures = ... # type: tuple[str, ...]
def __init__(self, *types: typing.Any, name: str = ...) -> None: ...
@typing.overload
def __get__(self, instance: None, owner: type['QObject']) -> 'pyqtSignal': ...
@typing.overload
def __get__(self, instance: 'QObject', owner: type['QObject']) -> 'pyqtBoundSignal': ...
class pyqtBoundSignal:
signal = ... # type: str
def __getitem__(self, key: object) -> 'pyqtBoundSignal': ...
def connect(self, slot: 'PYQT_SLOT') -> 'QMetaObject.Connection': ...
@typing.overload
def disconnect(self) -> None: ...
@typing.overload
def disconnect(self, slot: typing.Union['PYQT_SLOT', 'QMetaObject.Connection']) -> None: ...
def emit(self, *args: typing.Any) -> None: ...
FuncT = typing.TypeVar('FuncT', bound=collections.abc.Callable)
def pyqtSlot(*types, name: typing.Optional[str] = ..., result: typing.Optional[str] = ...) -> collections.abc.Callable[[FuncT], FuncT]: ...
# For QObject.findChild() and QObject.findChildren().
QObjectT = typing.TypeVar('QObjectT', bound=QObject)
# Convenient type aliases.
PYQT_SIGNAL = typing.Union[pyqtSignal, pyqtBoundSignal]
PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], pyqtBoundSignal]
%End

View File

@@ -0,0 +1,306 @@
// qcoreevent.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QEvent /NoDefaultCtors,Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qcoreevent.h>
%End
%ConvertToSubClassCode
switch (sipCpp->type())
{
case QEvent::Timer:
sipType = sipType_QTimerEvent;
break;
case QEvent::ChildAdded:
case QEvent::ChildPolished:
case QEvent::ChildRemoved:
sipType = sipType_QChildEvent;
break;
case QEvent::DynamicPropertyChange:
sipType = sipType_QDynamicPropertyChangeEvent;
break;
default:
sipType = 0;
}
%End
public:
enum Type /BaseType=IntEnum/
{
None,
Timer,
MouseButtonPress,
MouseButtonRelease,
MouseButtonDblClick,
MouseMove,
KeyPress,
KeyRelease,
FocusIn,
FocusOut,
Enter,
Leave,
Paint,
Move,
Resize,
Show,
Hide,
Close,
Quit,
ParentChange,
ParentAboutToChange,
ThreadChange,
WindowActivate,
WindowDeactivate,
ShowToParent,
HideToParent,
Wheel,
WindowTitleChange,
WindowIconChange,
ApplicationWindowIconChange,
ApplicationFontChange,
ApplicationLayoutDirectionChange,
ApplicationPaletteChange,
PaletteChange,
Clipboard,
MetaCall,
SockAct,
WinEventAct,
DeferredDelete,
DragEnter,
DragMove,
DragLeave,
Drop,
ChildAdded,
ChildPolished,
ChildRemoved,
PolishRequest,
Polish,
LayoutRequest,
UpdateRequest,
UpdateLater,
ContextMenu,
InputMethod,
TabletMove,
LocaleChange,
LanguageChange,
LayoutDirectionChange,
TabletPress,
TabletRelease,
OkRequest,
IconDrag,
FontChange,
EnabledChange,
ActivationChange,
StyleChange,
IconTextChange,
ModifiedChange,
MouseTrackingChange,
WindowBlocked,
WindowUnblocked,
WindowStateChange,
ToolTip,
WhatsThis,
StatusTip,
ActionChanged,
ActionAdded,
ActionRemoved,
FileOpen,
Shortcut,
ShortcutOverride,
WhatsThisClicked,
ToolBarChange,
ApplicationActivate,
ApplicationActivated,
ApplicationDeactivate,
ApplicationDeactivated,
QueryWhatsThis,
EnterWhatsThisMode,
LeaveWhatsThisMode,
ZOrderChange,
HoverEnter,
HoverLeave,
HoverMove,
GraphicsSceneMouseMove,
GraphicsSceneMousePress,
GraphicsSceneMouseRelease,
GraphicsSceneMouseDoubleClick,
GraphicsSceneContextMenu,
GraphicsSceneHoverEnter,
GraphicsSceneHoverMove,
GraphicsSceneHoverLeave,
GraphicsSceneHelp,
GraphicsSceneDragEnter,
GraphicsSceneDragMove,
GraphicsSceneDragLeave,
GraphicsSceneDrop,
GraphicsSceneWheel,
GraphicsSceneResize,
GraphicsSceneMove,
KeyboardLayoutChange,
DynamicPropertyChange,
TabletEnterProximity,
TabletLeaveProximity,
NonClientAreaMouseMove,
NonClientAreaMouseButtonPress,
NonClientAreaMouseButtonRelease,
NonClientAreaMouseButtonDblClick,
MacSizeChange,
ContentsRectChange,
CursorChange,
ToolTipChange,
GrabMouse,
UngrabMouse,
GrabKeyboard,
UngrabKeyboard,
StateMachineSignal,
StateMachineWrapped,
TouchBegin,
TouchUpdate,
TouchEnd,
NativeGesture,
RequestSoftwareInputPanel,
CloseSoftwareInputPanel,
WinIdChange,
Gesture,
GestureOverride,
FocusAboutToChange,
ScrollPrepare,
Scroll,
Expose,
InputMethodQuery,
OrientationChange,
TouchCancel,
PlatformPanel,
ApplicationStateChange,
ReadOnlyChange,
PlatformSurface,
TabletTrackingChange,
GraphicsSceneLeave,
EnterEditFocus,
LeaveEditFocus,
%If (Qt_6_6_0 -)
DevicePixelRatioChange,
%End
%If (Qt_6_7_0 -)
ChildWindowAdded,
%End
%If (Qt_6_7_0 -)
ChildWindowRemoved,
%End
%If (Qt_6_7_0 -)
ParentWindowAboutToChange,
%End
%If (Qt_6_7_0 -)
ParentWindowChange,
%End
%If (Qt_6_9_0 -)
SafeAreaMarginsChange,
%End
User,
MaxUser,
};
explicit QEvent(QEvent::Type type);
QEvent(int type) /Deprecated, NoDerived/;
%MethodCode
// This overload allows an int to be passed as is rather than being wrapped in
// a QEvent.Type. This was usefull before enums supported missing members and
// is now deprecated.
sipCpp = new sipQEvent(static_cast<QEvent::Type>(a0));
%End
virtual ~QEvent();
QEvent::Type type() const;
bool spontaneous() const;
virtual void setAccepted(bool accepted);
bool isAccepted() const;
void accept();
void ignore();
static int registerEventType(int hint = -1);
bool isInputEvent() const;
bool isPointerEvent() const;
bool isSinglePointEvent() const;
virtual QEvent *clone() const /Factory/;
};
class QTimerEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qcoreevent.h>
%End
public:
explicit QTimerEvent(int timerId);
virtual ~QTimerEvent();
int timerId() const;
virtual QTimerEvent *clone() const /Factory/;
%If (Qt_6_8_0 -)
int id() const;
%MethodCode
sipRes = qToUnderlying<Qt::TimerId>(sipCpp->id());
%End
%End
%If (Qt_6_9_0 -)
bool matches(const QBasicTimer &timer) const;
%End
};
class QChildEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qcoreevent.h>
%End
public:
QChildEvent(QEvent::Type type, QObject *child);
QChildEvent(int type, QObject *child) /NoDerived/;
%MethodCode
sipCpp = new sipQChildEvent(static_cast<QEvent::Type>(a0), a1);
%End
virtual ~QChildEvent();
QObject *child() const;
bool added() const;
bool polished() const;
bool removed() const;
virtual QChildEvent *clone() const /Factory/;
};
class QDynamicPropertyChangeEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qcoreevent.h>
%End
public:
explicit QDynamicPropertyChangeEvent(const QByteArray &name);
virtual ~QDynamicPropertyChangeEvent();
QByteArray propertyName() const;
virtual QDynamicPropertyChangeEvent *clone() const /Factory/;
};

View File

@@ -0,0 +1,91 @@
// qcryptographichash.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QCryptographicHash
{
%TypeHeaderCode
#include <qcryptographichash.h>
%End
public:
enum Algorithm
{
Md4,
Md5,
Sha1,
Sha224,
Sha256,
Sha384,
Sha512,
Sha3_224,
Sha3_256,
Sha3_384,
Sha3_512,
Keccak_224,
Keccak_256,
Keccak_384,
Keccak_512,
Blake2b_160,
Blake2b_256,
Blake2b_384,
Blake2b_512,
Blake2s_128,
Blake2s_160,
Blake2s_224,
Blake2s_256,
};
explicit QCryptographicHash(QCryptographicHash::Algorithm method);
~QCryptographicHash();
void reset();
%If (Qt_6_3_0 -)
void addData(QByteArrayView data);
%End
%If (- Qt_6_3_0)
void addData(const QByteArray &data);
%End
void addData(const char *data /Array/, qsizetype length /ArraySize/);
bool addData(QIODevice *device);
QByteArray result() const;
%If (Qt_6_3_0 -)
QByteArrayView resultView() const;
%End
%If (Qt_6_3_0 -)
static QByteArray hash(QByteArrayView data, QCryptographicHash::Algorithm method);
%End
%If (- Qt_6_3_0)
static QByteArray hash(const QByteArray &data, QCryptographicHash::Algorithm method);
%End
static int hashLength(QCryptographicHash::Algorithm method);
%If (Qt_6_5_0 -)
void swap(QCryptographicHash &other /Constrained/);
%End
%If (Qt_6_5_0 -)
QCryptographicHash::Algorithm algorithm() const;
%End
%If (Qt_6_5_0 -)
static bool supportsAlgorithm(QCryptographicHash::Algorithm method);
%End
private:
QCryptographicHash(const QCryptographicHash &);
};

View File

@@ -0,0 +1,648 @@
// qdatastream.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QDataStream : public QIODeviceBase
{
%TypeHeaderCode
#include <qdatastream.h>
%End
public:
enum Version /BaseType=IntEnum/
{
Qt_1_0,
Qt_2_0,
Qt_2_1,
Qt_3_0,
Qt_3_1,
Qt_3_3,
Qt_4_0,
Qt_4_1,
Qt_4_2,
Qt_4_3,
Qt_4_4,
Qt_4_5,
Qt_4_6,
Qt_4_7,
Qt_4_8,
Qt_4_9,
Qt_5_0,
Qt_5_1,
Qt_5_2,
Qt_5_3,
Qt_5_4,
Qt_5_5,
Qt_5_6,
Qt_5_7,
Qt_5_8,
Qt_5_9,
Qt_5_10,
Qt_5_11,
Qt_5_12,
Qt_5_13,
Qt_5_14,
Qt_5_15,
Qt_6_0,
%If (Qt_6_1_0 -)
Qt_6_1,
%End
%If (Qt_6_2_0 -)
Qt_6_2,
%End
%If (Qt_6_3_0 -)
Qt_6_3,
%End
%If (Qt_6_4_0 -)
Qt_6_4,
%End
%If (Qt_6_5_0 -)
Qt_6_5,
%End
%If (Qt_6_6_0 -)
Qt_6_6,
%End
%If (Qt_6_7_0 -)
Qt_6_7,
%End
%If (Qt_6_8_0 -)
Qt_6_8,
%End
%If (Qt_6_9_0 -)
Qt_6_9,
%End
%If (Qt_6_10_0 -)
Qt_6_10,
%End
};
enum ByteOrder
{
BigEndian,
LittleEndian,
};
enum Status
{
Ok,
ReadPastEnd,
ReadCorruptData,
WriteFailed,
%If (Qt_6_7_0 -)
SizeLimitExceeded,
%End
};
enum FloatingPointPrecision
{
SinglePrecision,
DoublePrecision,
};
QDataStream();
explicit QDataStream(QIODevice *);
QDataStream(QByteArray * /Constrained/, QIODeviceBase::OpenMode flags);
QDataStream(const QByteArray &);
~QDataStream();
QIODevice *device() const;
void setDevice(QIODevice *);
bool atEnd() const;
QDataStream::Status status() const;
void setStatus(QDataStream::Status status);
void resetStatus();
QDataStream::FloatingPointPrecision floatingPointPrecision() const;
void setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision);
QDataStream::ByteOrder byteOrder() const;
void setByteOrder(QDataStream::ByteOrder);
int version() const;
void setVersion(int);
%If (Qt_6_7_0 -)
SIP_PYOBJECT readBytes() /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
char *s;
qint64 l;
Py_BEGIN_ALLOW_THREADS
sipCpp->readBytes(s, l);
Py_END_ALLOW_THREADS
if ((sipRes = PyBytes_FromStringAndSize(s, l)) == NULL)
sipIsErr = 1;
if (s)
delete[] s;
%End
%End
%If (- Qt_6_7_0)
SIP_PYOBJECT readBytes() /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
char *s;
uint l;
Py_BEGIN_ALLOW_THREADS
sipCpp->readBytes(s, l);
Py_END_ALLOW_THREADS
if ((sipRes = PyBytes_FromStringAndSize(s, l)) == NULL)
sipIsErr = 1;
if (s)
delete[] s;
%End
%End
%If (Qt_6_7_0 -)
SIP_PYOBJECT readRawData(qint64 len) /Encoding="None",ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
len = sipCpp->readRawData(s, a0);
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
%End
%If (- Qt_6_7_0)
SIP_PYOBJECT readRawData(int len) /Encoding="None",ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
int len;
Py_BEGIN_ALLOW_THREADS
len = sipCpp->readRawData(s, a0);
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
%End
%If (Qt_6_7_0 -)
QDataStream &writeBytes(SIP_PYBUFFER) /ReleaseGIL/;
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
sipRes = &sipCpp->writeBytes(reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%End
%If (- Qt_6_7_0)
QDataStream &writeBytes(SIP_PYBUFFER) /ReleaseGIL/;
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
sipRes = &sipCpp->writeBytes(reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%End
%If (Qt_6_7_0 -)
qint64 writeRawData(SIP_PYBUFFER) /ReleaseGIL/;
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->writeRawData(reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%End
%If (- Qt_6_7_0)
int writeRawData(SIP_PYBUFFER) /ReleaseGIL/;
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->writeRawData(reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%End
%If (Qt_6_7_0 -)
qint64 skipRawData(qint64 len) /ReleaseGIL/;
%End
%If (- Qt_6_7_0)
int skipRawData(int len) /ReleaseGIL/;
%End
void startTransaction();
bool commitTransaction();
void rollbackTransaction();
void abortTransaction();
// Extra methods to give explicit control over the simple data types being read and written.
int readInt() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
qint8 readInt8() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
quint8 readUInt8() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
qint16 readInt16() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
quint16 readUInt16() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
qint32 readInt32() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
quint32 readUInt32() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
qint64 readInt64() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
quint64 readUInt64() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
bool readBool() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
float readFloat() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
double readDouble() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp >> sipRes;
Py_END_ALLOW_THREADS
%End
SIP_PYOBJECT readString() /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Note that this should really be called readCString().
char *s;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> s;
Py_END_ALLOW_THREADS
if (s)
{
sipRes = PyBytes_FromString(s);
delete[] s;
}
else
{
sipRes = Py_None;
Py_INCREF(Py_None);
}
%End
void writeInt(int i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeInt8(qint8 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeUInt8(quint8 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeInt16(qint16 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeUInt16(quint16 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeInt32(qint32 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeUInt32(quint32 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeInt64(qint64 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeUInt64(quint64 i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeBool(bool i) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeFloat(float f) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeDouble(double f) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
void writeString(const char *str /Encoding="None"/) /ReleaseGIL/;
%MethodCode
// Note that this should really be called writeCString().
Py_BEGIN_ALLOW_THREADS
*sipCpp << a0;
Py_END_ALLOW_THREADS
%End
QString readQString() /ReleaseGIL/;
%MethodCode
sipRes = new QString;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQString(const QString &qstr) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
QStringList readQStringList() /ReleaseGIL/;
%MethodCode
sipRes = new QStringList;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQStringList(const QStringList &qstrlst) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
QVariant readQVariant() /ReleaseGIL/;
%MethodCode
sipRes = new QVariant;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQVariant(const QVariant &qvar) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
QVariantList readQVariantList() /ReleaseGIL/;
%MethodCode
sipRes = new QVariantList;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQVariantList(const QVariantList &qvarlst) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
QVariantMap readQVariantMap() /ReleaseGIL/;
%MethodCode
sipRes = new QVariantMap;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQVariantMap(const QVariantMap &qvarmap) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
QVariantHash readQVariantHash() /ReleaseGIL/;
%MethodCode
sipRes = new QVariantHash;
Py_BEGIN_ALLOW_THREADS
*sipCpp >> *sipRes;
Py_END_ALLOW_THREADS
%End
void writeQVariantHash(const QVariantHash &qvarhash) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
*sipCpp << *a0;
Py_END_ALLOW_THREADS
%End
%If (Qt_6_10_0 -)
operator bool() const;
%End
private:
QDataStream(const QDataStream &);
};
%If (Qt_6_10_0 -)
QDataStream &operator>>(QDataStream &in, QChar &chr /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_10_0 -)
QDataStream &operator<<(QDataStream &out, QChar chr) /ReleaseGIL/;
%End
QDataStream &operator>>(QDataStream &s, QKeyCombination &combination /Constrained/) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &s, QKeyCombination combination) /ReleaseGIL/;

View File

@@ -0,0 +1,583 @@
// qdatetime.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QDate /TypeHintIn="Union[QDate, datetime.date]"/
{
%TypeHeaderCode
#include <qdatetime.h>
%End
%TypeCode
#include <QHash>
%End
%ConvertToTypeCode
// Allow a Python date object whenever a QDate is expected.
if (sipIsErr == NULL)
return (sipGetDate(sipPy, 0) ||
sipCanConvertToType(sipPy, sipType_QDate, SIP_NO_CONVERTORS));
sipDateDef py_date;
if (sipGetDate(sipPy, &py_date))
{
*sipCppPtr = new QDate(py_date.pd_year,
py_date.pd_month,
py_date.pd_day);
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QDate *>(sipConvertToType(sipPy, sipType_QDate, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
%PickleCode
sipRes = Py_BuildValue("iii", sipCpp->year(), sipCpp->month(), sipCpp->day());
%End
public:
QDate();
QDate(int y, int m, int d);
QDate(int y, int m, int d, QCalendar cal);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QDate()");
}
else
{
sipRes = PyUnicode_FromFormat(
"PyQt6.QtCore.QDate(%i, %i, %i)", sipCpp->year(),
sipCpp->month(), sipCpp->day());
}
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(sipCpp->toString(Qt::ISODate));
%End
SIP_PYOBJECT toPyDate() const /TypeHint="datetime.date"/;
%MethodCode
// Convert to a Python date object.
sipDateDef py_date;
py_date.pd_year = sipCpp->year();
py_date.pd_month = sipCpp->month();
py_date.pd_day = sipCpp->day();
sipRes = sipFromDate(&py_date);
%End
bool isNull() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isNull();
%End
bool isValid() const;
int year() const;
int year(QCalendar cal) const;
int month() const;
int month(QCalendar cal) const;
int day() const;
int day(QCalendar cal) const;
int dayOfWeek() const;
int dayOfWeek(QCalendar cal) const;
int dayOfYear() const;
int dayOfYear(QCalendar cal) const;
int daysInMonth() const;
int daysInMonth(QCalendar cal) const;
int daysInYear() const;
int daysInYear(QCalendar cal) const;
int weekNumber(int *yearNumber = 0) const;
// In Qt v6.7 this was replaced by two overloads bu twe need to retain the optional keyword argument.
QString toString(const QString &format, QCalendar cal = QCalendar()) const;
QString toString(Qt::DateFormat format = Qt::TextDate) const;
QDate addDays(qint64 days) const;
QDate addMonths(int months) const;
QDate addMonths(int months, QCalendar cal) const;
QDate addYears(int years) const;
QDate addYears(int years, QCalendar cal) const;
static QDate currentDate();
static QDate fromString(const QString &string, Qt::DateFormat format = Qt::TextDate);
// Qt v6.7 replaced this with two overloads but we need to retain the optional keyword argument.
static QDate fromString(const QString &string, const QString &format, QCalendar cal = QCalendar());
%If (Qt_6_7_0 -)
// This replaces two overloads added in Qy v6.7 designed to maintain compatibility regarding optional keyword arguments.
static QDate fromString(const QString &string, const QString &format, int baseYear, QCalendar cal = QCalendar());
%End
static bool isValid(int y, int m, int d);
static bool isLeapYear(int year);
static QDate fromJulianDay(qint64 jd);
qint64 toJulianDay() const;
bool setDate(int year, int month, int date);
void getDate(int *year, int *month, int *day) const;
// The arguments are marked as deprecated in Qt v6.9.
QDateTime startOfDay(Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0) const;
QDateTime startOfDay(const QTimeZone &zone) const;
// The arguments are marked as deprecated in Qt v6.9.
QDateTime endOfDay(Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0) const;
QDateTime endOfDay(const QTimeZone &zone) const;
bool setDate(int year, int month, int day, QCalendar cal);
qint64 daysTo(QDate d) const;
};
class QTime /TypeHintIn="Union[QTime, datetime.time]"/
{
%TypeHeaderCode
#include <qdatetime.h>
%End
%TypeCode
#include <QHash>
%End
%ConvertToTypeCode
// Allow a Python time object whenever a QTime is expected.
if (sipIsErr == NULL)
return (sipGetTime(sipPy, 0) ||
sipCanConvertToType(sipPy, sipType_QTime, SIP_NO_CONVERTORS));
sipTimeDef py_time;
if (sipGetTime(sipPy, &py_time))
{
*sipCppPtr = new QTime(py_time.pt_hour,
py_time.pt_minute,
py_time.pt_second,
py_time.pt_microsecond / 1000);
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QTime *>(sipConvertToType(sipPy, sipType_QTime, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
%PickleCode
sipRes = Py_BuildValue("iiii", sipCpp->hour(), sipCpp->minute(), sipCpp->second(), sipCpp->msec());
%End
public:
QTime();
QTime(int h, int m, int second = 0, int msec = 0);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QTime()");
}
else
{
sipRes = PyUnicode_FromFormat("PyQt6.QtCore.QTime(%i, %i", sipCpp->hour(),
sipCpp->minute());
if (sipCpp->second() || sipCpp->msec())
{
qpycore_Unicode_ConcatAndDel(&sipRes,
PyUnicode_FromFormat(", %i", sipCpp->second()));
if (sipCpp->msec())
qpycore_Unicode_ConcatAndDel(&sipRes,
PyUnicode_FromFormat(", %i", sipCpp->msec()));
}
qpycore_Unicode_ConcatAndDel(&sipRes, PyUnicode_FromString(")"));
}
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(sipCpp->toString(Qt::ISODate));
%End
SIP_PYOBJECT toPyTime() const /TypeHint="datetime.time"/;
%MethodCode
// Convert to a Python time object.
sipTimeDef py_time;
py_time.pt_hour = sipCpp->hour();
py_time.pt_minute = sipCpp->minute();
py_time.pt_second = sipCpp->second();
py_time.pt_microsecond = sipCpp->msec() * 1000;
sipRes = sipFromTime(&py_time);
%End
bool isNull() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isNull();
%End
bool isValid() const;
int hour() const;
int minute() const;
int second() const;
int msec() const;
QString toString(Qt::DateFormat format = Qt::TextDate) const;
QString toString(const QString &format) const;
bool setHMS(int h, int m, int s, int msec = 0);
QTime addSecs(int secs) const;
QTime addMSecs(int ms) const;
static QTime currentTime();
static QTime fromString(const QString &string, Qt::DateFormat format = Qt::TextDate);
static QTime fromString(const QString &s, const QString &format);
static bool isValid(int h, int m, int s, int msec = 0);
static QTime fromMSecsSinceStartOfDay(int msecs);
int msecsSinceStartOfDay() const;
int secsTo(QTime t) const;
int msecsTo(QTime t) const;
};
class QDateTime /TypeHintIn="Union[QDateTime, datetime.datetime]"/
{
%TypeHeaderCode
#include <qdatetime.h>
%End
%TypeCode
#include <QHash>
%End
%ConvertToTypeCode
// Allow a Python datetime object whenever a QDateTime is expected.
if (sipIsErr == NULL)
return (sipGetDateTime(sipPy, 0, 0) ||
sipCanConvertToType(sipPy, sipType_QDateTime, SIP_NO_CONVERTORS));
sipDateDef py_date;
sipTimeDef py_time;
if (sipGetDateTime(sipPy, &py_date, &py_time))
{
QDate qdate(py_date.pd_year,
py_date.pd_month,
py_date.pd_day);
QTime qtime(py_time.pt_hour,
py_time.pt_minute,
py_time.pt_second,
py_time.pt_microsecond / 1000);
QDateTime *qdt = new QDateTime(qdate, qtime);
*sipCppPtr = qdt;
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QDateTime *>(sipConvertToType(sipPy, sipType_QDateTime, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
%PickleCode
QDate qd = sipCpp->date();
QTime qt = sipCpp->time();
sipRes = Py_BuildValue("iiiiiiii", qd.year(), qd.month(), qd.day(),
qt.hour(), qt.minute(), qt.second(), qt.msec(),
(int)sipCpp->timeSpec());
%End
public:
%If (Qt_6_7_0 -)
enum class TransitionResolution
{
Reject,
RelativeToBefore,
RelativeToAfter,
PreferBefore,
PreferAfter,
PreferStandard,
PreferDaylightSaving,
LegacyBehavior,
};
%End
QDateTime();
QDateTime(const QDateTime &other);
QDateTime(int year, int month, int day, int hour, int minute, int second = 0, int msec = 0, int timeSpec = 0) /NoDerived/;
%MethodCode
// This ctor is mainly supplied to allow pickling.
QDate qd(a0, a1, a2);
QTime qt(a3, a4, a5, a6);
sipCpp = new QDateTime(qd, qt, (Qt::TimeSpec)a7);
%End
%If (Qt_6_7_0 -)
// The resolve argument is not optional so that the overload with deprecated arguments continues to work.
QDateTime(QDate date, QTime time, QDateTime::TransitionResolution resolve) [(QDate date, QTime time, QDateTime::TransitionResolution resolve = QDateTime::TransitionResolution::LegacyBehavior)];
%End
// The optional arguments are marked as deprecated in Qt v6.9.
QDateTime(QDate date, QTime time, Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0);
%If (Qt_6_7_0 -)
QDateTime(QDate date, QTime time, const QTimeZone &timeZone, QDateTime::TransitionResolution resolve = QDateTime::TransitionResolution::LegacyBehavior);
%End
%If (- Qt_6_7_0)
QDateTime(QDate date, QTime time, const QTimeZone &timeZone);
%End
~QDateTime();
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QDateTime()");
}
else
{
QDate qd = sipCpp->date();
QTime qt = sipCpp->time();
sipRes = PyUnicode_FromFormat(
"PyQt6.QtCore.QDateTime(%i, %i, %i, %i, %i",
qd.year(), qd.month(), qd.day(), qt.hour(), qt.minute());
if (qt.second() || qt.msec() || sipCpp->timeSpec() != Qt::LocalTime)
{
qpycore_Unicode_ConcatAndDel(&sipRes,
PyUnicode_FromFormat(", %i", qt.second()));
if (qt.msec() || sipCpp->timeSpec() != Qt::LocalTime)
{
qpycore_Unicode_ConcatAndDel(&sipRes,
PyUnicode_FromFormat(", %i", qt.msec()));
if (sipCpp->timeSpec() != Qt::LocalTime)
qpycore_Unicode_ConcatAndDel(&sipRes,
PyUnicode_FromFormat(", PyQt6.QtCore.Qt.TimeSpec(%i)",
(int)sipCpp->timeSpec()));
}
}
qpycore_Unicode_ConcatAndDel(&sipRes, PyUnicode_FromString(")"));
}
%End
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(sipCpp->toString(Qt::ISODate));
%End
SIP_PYOBJECT toPyDateTime() const /TypeHint="datetime.datetime"/;
%MethodCode
// Convert to a Python datetime object.
sipDateDef py_date;
QDate qd = sipCpp->date();
py_date.pd_year = qd.year();
py_date.pd_month = qd.month();
py_date.pd_day = qd.day();
sipTimeDef py_time;
QTime qt = sipCpp->time();
py_time.pt_hour = qt.hour();
py_time.pt_minute = qt.minute();
py_time.pt_second = qt.second();
py_time.pt_microsecond = qt.msec() * 1000;
sipRes = sipFromDateTime(&py_date, &py_time);
%End
bool isNull() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isNull();
%End
bool isValid() const;
QDate date() const;
QTime time() const;
Qt::TimeSpec timeSpec() const;
void setTimeSpec(Qt::TimeSpec spec);
// This was replaced with two overloads in Qt v6.7 but we need the optional keyword argument.
QString toString(const QString &format, QCalendar cal = QCalendar()) const;
QString toString(Qt::DateFormat format = Qt::TextDate) const;
QDateTime addDays(qint64 days) const;
QDateTime addMonths(int months) const;
QDateTime addYears(int years) const;
QDateTime addSecs(qint64 secs) const;
QDateTime addMSecs(qint64 msecs) const;
QDateTime toTimeSpec(Qt::TimeSpec spec) const;
QDateTime toLocalTime() const;
QDateTime toUTC() const;
qint64 daysTo(const QDateTime &) const;
qint64 secsTo(const QDateTime &) const;
static QDateTime currentDateTime();
%If (Qt_6_5_0 -)
static QDateTime currentDateTime(const QTimeZone &zone);
%End
static QDateTime fromString(const QString &string, Qt::DateFormat format = Qt::TextDate);
// Qt v6.7 replaced this with two overloads but we need to retain the optional keyword argument.
static QDateTime fromString(const QString &string, const QString &format, QCalendar cal = QCalendar());
%If (Qt_6_7_0 -)
// This replaces two overloads added in Qy v6.7 designed to maintain compatibility regarding optional keyword arguments.
static QDateTime fromString(const QString &string, const QString &format, int baseYear, QCalendar cal = QCalendar());
%End
qint64 toMSecsSinceEpoch() const;
void setMSecsSinceEpoch(qint64 msecs);
qint64 msecsTo(const QDateTime &) const;
static QDateTime currentDateTimeUtc();
static qint64 currentMSecsSinceEpoch();
void swap(QDateTime &other /Constrained/);
int offsetFromUtc() const;
QTimeZone timeZone() const;
QString timeZoneAbbreviation() const;
bool isDaylightTime() const;
void setOffsetFromUtc(int offsetSeconds);
%If (Qt_6_7_0 -)
void setTimeZone(const QTimeZone &toZone, QDateTime::TransitionResolution resolve = QDateTime::TransitionResolution::LegacyBehavior);
%End
%If (- Qt_6_7_0)
void setTimeZone(const QTimeZone &toZone);
%End
QDateTime toOffsetFromUtc(int offsetSeconds) const;
QDateTime toTimeZone(const QTimeZone &toZone) const;
// The optional arguments are marked as deprecated in Qt v6.9.
static QDateTime fromMSecsSinceEpoch(qint64 msecs, Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0);
static QDateTime fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone);
qint64 toSecsSinceEpoch() const;
void setSecsSinceEpoch(qint64 secs);
// The optional arguments are marked as deprecated in Qt v6.9.
static QDateTime fromSecsSinceEpoch(qint64 secs, Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0);
static QDateTime fromSecsSinceEpoch(qint64 secs, const QTimeZone &timeZone);
static qint64 currentSecsSinceEpoch();
enum class YearRange : qint32
{
First,
Last,
};
%If (Qt_6_7_0 -)
void setDate(QDate date, QDateTime::TransitionResolution resolve = QDateTime::TransitionResolution::LegacyBehavior);
%End
%If (- Qt_6_7_0)
void setDate(QDate date);
%End
%If (Qt_6_7_0 -)
void setTime(QTime time, QDateTime::TransitionResolution resolve = QDateTime::TransitionResolution::LegacyBehavior);
%End
%If (- Qt_6_7_0)
void setTime(QTime time);
%End
%If (Qt_6_5_0 -)
QTimeZone timeRepresentation() const;
%End
};
QDataStream &operator<<(QDataStream &, QDate) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QDate & /Constrained/) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &, QTime) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QTime & /Constrained/) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &, const QDateTime &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QDateTime & /Constrained/) /ReleaseGIL/;
%If (Qt_6_7_0 -)
bool operator==(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator==(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator==(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator==(QTime lhs, QTime rhs);
%End
bool operator==(const QDateTime &lhs, const QDateTime &rhs);
%If (Qt_6_7_0 -)
bool operator!=(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator!=(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator!=(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator!=(QTime lhs, QTime rhs);
%End
bool operator!=(const QDateTime &lhs, const QDateTime &rhs);
%If (Qt_6_7_0 -)
bool operator<(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator<(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator<(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator<(QTime lhs, QTime rhs);
%End
bool operator<(const QDateTime &lhs, const QDateTime &rhs);
%If (Qt_6_7_0 -)
bool operator<=(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator<=(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator<=(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator<=(QTime lhs, QTime rhs);
%End
bool operator<=(const QDateTime &lhs, const QDateTime &rhs);
%If (Qt_6_7_0 -)
bool operator>(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator>(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator>(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator>(QTime lhs, QTime rhs);
%End
bool operator>(const QDateTime &lhs, const QDateTime &rhs);
%If (Qt_6_7_0 -)
bool operator>=(const QDate &lhs, const QDate &rhs);
%End
%If (- Qt_6_7_0)
bool operator>=(QDate lhs, QDate rhs);
%End
%If (Qt_6_7_0 -)
bool operator>=(const QTime &lhs, const QTime &rhs);
%End
%If (- Qt_6_7_0)
bool operator>=(QTime lhs, QTime rhs);
%End
bool operator>=(const QDateTime &lhs, const QDateTime &rhs);

View File

@@ -0,0 +1,108 @@
// qdeadlinetimer.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QDeadlineTimer
{
%TypeHeaderCode
#include <qdeadlinetimer.h>
%End
public:
%If (- Qt_6_6_0)
enum ForeverConstant
{
Forever,
};
%End
%If (Qt_6_6_0 -)
enum class ForeverConstant
{
Forever,
};
%End
// This was replaced in Qt v6.6 with two overloads but we need the optional keyword argument.
QDeadlineTimer(Qt::TimerType type = Qt::CoarseTimer);
QDeadlineTimer(QDeadlineTimer::ForeverConstant, Qt::TimerType type = Qt::CoarseTimer);
QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer);
void swap(QDeadlineTimer &other /Constrained/);
bool isForever() const;
bool hasExpired() const;
Qt::TimerType timerType() const;
void setTimerType(Qt::TimerType type);
qint64 remainingTime() const;
qint64 remainingTimeNSecs() const;
void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer);
void setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0, Qt::TimerType type = Qt::CoarseTimer);
qint64 deadline() const;
qint64 deadlineNSecs() const;
void setDeadline(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer);
void setPreciseDeadline(qint64 secs, qint64 nsecs = 0, Qt::TimerType type = Qt::CoarseTimer);
static QDeadlineTimer addNSecs(QDeadlineTimer dt, qint64 nsecs);
static QDeadlineTimer current(Qt::TimerType type = Qt::CoarseTimer);
QDeadlineTimer &operator+=(qint64 msecs);
QDeadlineTimer &operator-=(qint64 msecs);
};
%If (Qt_6_8_0 -)
bool operator==(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator==(QDeadlineTimer d1, QDeadlineTimer d2);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2);
%End
%If (Qt_6_8_0 -)
bool operator<(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator<(QDeadlineTimer d1, QDeadlineTimer d2);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2);
%End
%If (Qt_6_8_0 -)
bool operator>(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator>(QDeadlineTimer d1, QDeadlineTimer d2);
%End
%If (Qt_6_8_0 -)
bool operator>=(const QDeadlineTimer &lhs, const QDeadlineTimer &rhs);
%End
%If (- Qt_6_8_0)
bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2);
%End
QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs);
QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt);
QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs);
qint64 operator-(QDeadlineTimer dt1, QDeadlineTimer dt2);

View File

@@ -0,0 +1,218 @@
// qdir.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QDir
{
%TypeHeaderCode
#include <qdir.h>
%End
public:
enum Filter /BaseType=Flag/
{
Dirs,
Files,
Drives,
NoSymLinks,
AllEntries,
TypeMask,
Readable,
Writable,
Executable,
PermissionMask,
Modified,
Hidden,
System,
AccessMask,
AllDirs,
CaseSensitive,
NoDotAndDotDot,
NoFilter,
NoDot,
NoDotDot,
};
typedef QFlags<QDir::Filter> Filters;
enum SortFlag /BaseType=Flag/
{
Name,
Time,
Size,
Unsorted,
SortByMask,
DirsFirst,
Reversed,
IgnoreCase,
DirsLast,
LocaleAware,
Type,
NoSort,
};
typedef QFlags<QDir::SortFlag> SortFlags;
QDir(const QString &path, const QString &nameFilter, QDir::SortFlags sort = QDir::SortFlags(QDir::Name | QDir::IgnoreCase), QDir::Filters filters = QDir::AllEntries);
QDir(const QDir &);
QDir(const QString &path = QString());
~QDir();
void setPath(const QString &path);
QString path() const;
QString absolutePath() const;
QString canonicalPath() const;
QString dirName() const;
QString filePath(const QString &fileName) const;
QString absoluteFilePath(const QString &fileName) const;
QString relativeFilePath(const QString &fileName) const;
bool cd(const QString &dirName);
bool cdUp();
QStringList nameFilters() const;
void setNameFilters(const QStringList &nameFilters);
QDir::Filters filter() const;
void setFilter(QDir::Filters filter);
QDir::SortFlags sorting() const;
void setSorting(QDir::SortFlags sort);
%If (Qt_6_5_0 -)
qsizetype count() const /__len__/;
%MethodCode
sipRes = sipCpp->count(Qt::Disambiguated);
%End
%End
%If (- Qt_6_5_0)
uint count() const /__len__/;
%End
%If (Qt_6_5_0 -)
QString operator[](qsizetype) const;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QString(sipCpp->operator[]((qsizetype)idx));
%End
%End
%If (- Qt_6_5_0)
QString operator[](int) const;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QString(sipCpp->operator[]((int)idx));
%End
%End
QStringList operator[](SIP_PYSLICE) const;
%MethodCode
Py_ssize_t start, stop, step, slicelength;
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
{
sipIsErr = 1;
}
else
{
sipRes = new QStringList();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
(*sipRes) += (*sipCpp)[start];
start += step;
}
}
%End
int __contains__(const QString &) const;
%MethodCode
sipRes = bool(sipCpp->entryList().contains(*a0));
%End
static QStringList nameFiltersFromString(const QString &nameFilter);
QStringList entryList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const;
QStringList entryList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const;
QFileInfoList entryInfoList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const;
QFileInfoList entryInfoList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const;
%If (Qt_6_3_0 -)
bool mkdir(const QString &dirName, QFileDevice::Permissions permissions) const;
%End
bool mkdir(const QString &dirName) const;
bool rmdir(const QString &dirName) const;
%If (Qt_6_10_0 -)
// We choose to make the permissions argument compulsory (to be consistent with
// the existing mkdir() behaviour rather than adopt the new mkdir() and mkpath()
// behaviour.
bool mkpath(const QString &dirPath, QFileDevice::Permissions permissions) const;
%End
bool mkpath(const QString &dirPath) const;
bool rmpath(const QString &dirPath) const;
bool isReadable() const;
bool exists() const;
bool isRoot() const;
static bool isRelativePath(const QString &path);
static bool isAbsolutePath(const QString &path);
bool isRelative() const;
bool isAbsolute() const;
bool makeAbsolute();
%If (- Qt_6_8_0)
bool operator==(const QDir &dir) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QDir &dir) const;
%End
bool remove(const QString &fileName);
bool rename(const QString &oldName, const QString &newName);
bool exists(const QString &name) const;
void refresh() const;
static QFileInfoList drives();
static QChar separator();
static bool setCurrent(const QString &path);
static QDir current();
static QString currentPath();
static QDir home();
static QString homePath();
static QDir root();
static QString rootPath();
static QDir temp();
static QString tempPath();
static bool match(const QStringList &filters, const QString &fileName);
static bool match(const QString &filter, const QString &fileName);
static QString cleanPath(const QString &path);
static QString toNativeSeparators(const QString &pathName);
static QString fromNativeSeparators(const QString &pathName);
static void setSearchPaths(const QString &prefix, const QStringList &searchPaths);
static void addSearchPath(const QString &prefix, const QString &path);
static QStringList searchPaths(const QString &prefix);
bool removeRecursively();
void swap(QDir &other /Constrained/);
static QChar listSeparator();
bool isEmpty(QDir::Filters filters = QDir::Filters(QDir::AllEntries | QDir::NoDotAndDotDot)) const;
};
%If (Qt_6_8_0 -)
bool operator!=(const QDir &lhs, const QDir &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QDir &lhs, const QDir &rhs);
%End

View File

@@ -0,0 +1,55 @@
// qdiriterator.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QDirIterator
{
%TypeHeaderCode
#include <qdiriterator.h>
%End
public:
enum IteratorFlag /BaseType=Flag/
{
NoIteratorFlags,
FollowSymlinks,
Subdirectories,
};
typedef QFlags<QDirIterator::IteratorFlag> IteratorFlags;
QDirIterator(const QDir &dir, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
QDirIterator(const QString &path, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
QDirIterator(const QString &path, QDir::Filters filter, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
QDirIterator(const QString &path, const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
~QDirIterator();
QString next();
%If (Qt_6_3_0 -)
QFileInfo nextFileInfo();
%End
bool hasNext() const;
QString fileName() const;
QString filePath() const;
QFileInfo fileInfo() const;
QString path() const;
private:
QDirIterator(const QDirIterator &);
};

View File

@@ -0,0 +1,298 @@
// qeasingcurve.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QEasingCurve /TypeHintIn="Union[QEasingCurve, QEasingCurve.Type]"/
{
%TypeHeaderCode
#include <qeasingcurve.h>
%End
%TypeCode
// The EasingFunction callback doesn't provide a context so we support a fixed
// number of different functions.
const int ec_nr_custom_types = 10;
struct ec_custom_type {
PyObject *py_func;
QEasingCurve::EasingFunction func;
};
static qreal ec_call(int ec, qreal v);
static qreal ec_func_0(qreal v)
{
return ec_call(0, v);
}
static qreal ec_func_1(qreal v)
{
return ec_call(1, v);
}
static qreal ec_func_2(qreal v)
{
return ec_call(2, v);
}
static qreal ec_func_3(qreal v)
{
return ec_call(3, v);
}
static qreal ec_func_4(qreal v)
{
return ec_call(4, v);
}
static qreal ec_func_5(qreal v)
{
return ec_call(5, v);
}
static qreal ec_func_6(qreal v)
{
return ec_call(6, v);
}
static qreal ec_func_7(qreal v)
{
return ec_call(7, v);
}
static qreal ec_func_8(qreal v)
{
return ec_call(8, v);
}
static qreal ec_func_9(qreal v)
{
return ec_call(9, v);
}
static ec_custom_type ec_custom_types[ec_nr_custom_types] = {
{0, ec_func_0},
{0, ec_func_1},
{0, ec_func_2},
{0, ec_func_3},
{0, ec_func_4},
{0, ec_func_5},
{0, ec_func_6},
{0, ec_func_7},
{0, ec_func_8},
{0, ec_func_9},
};
static qreal ec_call(int ec, qreal v)
{
PyObject *res_obj;
qreal res = 0.0;
SIP_BLOCK_THREADS
res_obj = PyObject_CallFunction(ec_custom_types[ec].py_func, (char *)"(d)", (double)v);
if (res_obj)
{
PyErr_Clear();
res = PyFloat_AsDouble(res_obj);
Py_DECREF(res_obj);
if (PyErr_Occurred())
res_obj = 0;
}
if (!res_obj)
pyqt6_err_print();
SIP_UNBLOCK_THREADS
return res;
}
%End
%ConvertToTypeCode
// Allow a QEasingCurve::Type whenever a QEasingCurve is expected.
bool is_ec_type = true;
int ec_type = sipConvertToEnum(sipPy, sipType_QEasingCurve_Type);
if (PyErr_Occurred())
{
PyErr_Clear();
is_ec_type = false;
}
if (sipIsErr == NULL)
return (is_ec_type ||
sipCanConvertToType(sipPy, sipType_QEasingCurve, SIP_NO_CONVERTORS));
if (is_ec_type)
{
*sipCppPtr = new QEasingCurve(static_cast<QEasingCurve::Type>(ec_type));
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QEasingCurve *>(sipConvertToType(sipPy,
sipType_QEasingCurve, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
public:
enum Type
{
Linear,
InQuad,
OutQuad,
InOutQuad,
OutInQuad,
InCubic,
OutCubic,
InOutCubic,
OutInCubic,
InQuart,
OutQuart,
InOutQuart,
OutInQuart,
InQuint,
OutQuint,
InOutQuint,
OutInQuint,
InSine,
OutSine,
InOutSine,
OutInSine,
InExpo,
OutExpo,
InOutExpo,
OutInExpo,
InCirc,
OutCirc,
InOutCirc,
OutInCirc,
InElastic,
OutElastic,
InOutElastic,
OutInElastic,
InBack,
OutBack,
InOutBack,
OutInBack,
InBounce,
OutBounce,
InOutBounce,
OutInBounce,
InCurve,
OutCurve,
SineCurve,
CosineCurve,
BezierSpline,
TCBSpline,
Custom,
};
QEasingCurve(QEasingCurve::Type type = QEasingCurve::Linear);
QEasingCurve(const QEasingCurve &other);
~QEasingCurve();
%If (- Qt_6_8_0)
bool operator==(const QEasingCurve &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QEasingCurve &other) const;
%End
qreal amplitude() const;
void setAmplitude(qreal amplitude);
qreal period() const;
void setPeriod(qreal period);
qreal overshoot() const;
void setOvershoot(qreal overshoot);
QEasingCurve::Type type() const;
void setType(QEasingCurve::Type type);
void setCustomType(SIP_PYCALLABLE func /TypeHint="Callable[[float], float]"/);
%MethodCode
int i;
ec_custom_type *ct;
for (i = 0; i < ec_nr_custom_types; ++i)
{
ct = &ec_custom_types[i];
if (!ct->py_func || ct->py_func == a0)
break;
}
if (i == ec_nr_custom_types)
{
PyErr_Format(PyExc_ValueError, "a maximum of %d different easing functions are supported", ec_nr_custom_types);
sipError = sipErrorFail;
}
else
{
if (!ct->py_func)
{
ct->py_func = a0;
Py_INCREF(a0);
}
sipCpp->setCustomType(ct->func);
}
%End
SIP_PYCALLABLE customType() const /TypeHint="Callable[[float], float]"/;
%MethodCode
QEasingCurve::EasingFunction func = sipCpp->customType();
sipRes = Py_None;
if (func)
{
for (int i = 0; i < ec_nr_custom_types; ++i)
{
if (ec_custom_types[i].func == func)
{
sipRes = ec_custom_types[i].py_func;
break;
}
}
}
Py_INCREF(sipRes);
%End
qreal valueForProgress(qreal progress) const;
void swap(QEasingCurve &other /Constrained/);
void addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint);
void addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qreal b);
QList<QPointF> toCubicSpline() const;
};
QDataStream &operator<<(QDataStream &, const QEasingCurve & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QEasingCurve & /Constrained/) /ReleaseGIL/;
%If (Qt_6_8_0 -)
bool operator!=(const QEasingCurve &lhs, const QEasingCurve &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QEasingCurve &lhs, const QEasingCurve &rhs);
%End

View File

@@ -0,0 +1,66 @@
// qelapsedtimer.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QElapsedTimer
{
%TypeHeaderCode
#include <qelapsedtimer.h>
%End
public:
QElapsedTimer();
enum ClockType
{
SystemTime,
MonotonicClock,
TickCounter,
MachAbsoluteTime,
PerformanceCounter,
};
static QElapsedTimer::ClockType clockType();
static bool isMonotonic();
void start();
qint64 restart();
void invalidate();
bool isValid() const;
qint64 elapsed() const;
bool hasExpired(qint64 timeout) const;
qint64 msecsSinceReference() const;
qint64 msecsTo(const QElapsedTimer &other) const;
qint64 secsTo(const QElapsedTimer &other) const;
qint64 nsecsElapsed() const;
};
bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2);
bool operator==(const QElapsedTimer &lhs, const QElapsedTimer &rhs);
bool operator!=(const QElapsedTimer &lhs, const QElapsedTimer &rhs);
%If (Qt_6_8_0 -)
bool operator>(const QElapsedTimer &lhs, const QElapsedTimer &rhs);
%End
%If (Qt_6_8_0 -)
bool operator<=(const QElapsedTimer &lhs, const QElapsedTimer &rhs);
%End
%If (Qt_6_8_0 -)
bool operator>=(const QElapsedTimer &lhs, const QElapsedTimer &rhs);
%End

View File

@@ -0,0 +1,76 @@
// qeventloop.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QEventLoop : public QObject
{
%TypeHeaderCode
#include <qeventloop.h>
%End
public:
explicit QEventLoop(QObject *parent /TransferThis/ = 0);
virtual ~QEventLoop();
enum ProcessEventsFlag /BaseType=Flag/
{
AllEvents,
ExcludeUserInputEvents,
ExcludeSocketNotifiers,
WaitForMoreEvents,
};
typedef QFlags<QEventLoop::ProcessEventsFlag> ProcessEventsFlags;
bool processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents) /ReleaseGIL/;
void processEvents(QEventLoop::ProcessEventsFlags flags, int maximumTime) /ReleaseGIL/;
%If (Qt_6_7_0 -)
void processEvents(QEventLoop::ProcessEventsFlags flags, QDeadlineTimer deadline) /ReleaseGIL/;
%End
int exec(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents) /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/;
void exit(int returnCode = 0);
bool isRunning() const;
void wakeUp();
public slots:
void quit();
public:
virtual bool event(QEvent *event);
};
class QEventLoopLocker
{
%TypeHeaderCode
#include <qeventloop.h>
%End
public:
QEventLoopLocker() /ReleaseGIL/;
explicit QEventLoopLocker(QEventLoop *loop) /ReleaseGIL/;
explicit QEventLoopLocker(QThread *thread) /ReleaseGIL/;
~QEventLoopLocker();
%If (Qt_6_7_0 -)
void swap(QEventLoopLocker &other);
%End
private:
QEventLoopLocker(const QEventLoopLocker &);
};

View File

@@ -0,0 +1,74 @@
// qfile.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QFile : public QFileDevice
{
%TypeHeaderCode
#include <qfile.h>
%End
public:
QFile();
%If (Qt_6_9_0 -)
explicit QFile(const QString &name);
%End
%If (- Qt_6_9_0)
QFile(const QString &name);
%End
explicit QFile(QObject *parent /TransferThis/);
QFile(const QString &name, QObject *parent /TransferThis/);
virtual ~QFile();
virtual QString fileName() const;
void setFileName(const QString &name);
static QByteArray encodeName(const QString &fileName);
static QString decodeName(const QByteArray &localFileName);
static QString decodeName(const char *localFileName /Encoding="ASCII"/);
bool exists() const;
static bool exists(const QString &fileName);
QString symLinkTarget() const;
static QString symLinkTarget(const QString &fileName);
bool remove() /ReleaseGIL/;
static bool remove(const QString &fileName) /ReleaseGIL/;
bool rename(const QString &newName) /ReleaseGIL/;
static bool rename(const QString &oldName, const QString &newName) /ReleaseGIL/;
bool link(const QString &newName) /ReleaseGIL/;
static bool link(const QString &oldname, const QString &newName) /ReleaseGIL/;
bool copy(const QString &newName) /ReleaseGIL/;
static bool copy(const QString &fileName, const QString &newName) /ReleaseGIL/;
%If (Qt_6_3_0 -)
bool open(QIODeviceBase::OpenMode flags, QFileDevice::Permissions permissions) /ReleaseGIL/;
%End
virtual bool open(QIODeviceBase::OpenMode flags) /ReleaseGIL/;
bool open(int fd, QIODeviceBase::OpenMode ioFlags, QFileDevice::FileHandleFlags handleFlags = QFileDevice::DontCloseHandle) /ReleaseGIL/;
virtual qint64 size() const;
virtual bool resize(qint64 sz);
static bool resize(const QString &filename, qint64 sz);
virtual QFileDevice::Permissions permissions() const;
static QFileDevice::Permissions permissions(const QString &filename);
virtual bool setPermissions(QFileDevice::Permissions permissionSpec);
static bool setPermissions(const QString &filename, QFileDevice::Permissions permissionSpec);
bool moveToTrash();
static bool moveToTrash(const QString &fileName, QString *pathInTrash /Out/ = 0);
%If (Qt_6_9_0 -)
static bool supportsMoveToTrash();
%End
};

View File

@@ -0,0 +1,213 @@
// qfiledevice.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QFileDevice : public QIODevice /NoDefaultCtors/
{
%TypeHeaderCode
#include <qfiledevice.h>
%End
public:
enum FileError
{
NoError,
ReadError,
WriteError,
FatalError,
ResourceError,
OpenError,
AbortError,
TimeOutError,
UnspecifiedError,
RemoveError,
RenameError,
PositionError,
ResizeError,
PermissionsError,
CopyError,
};
enum Permission /BaseType=Flag/
{
ReadOwner,
WriteOwner,
ExeOwner,
ReadUser,
WriteUser,
ExeUser,
ReadGroup,
WriteGroup,
ExeGroup,
ReadOther,
WriteOther,
ExeOther,
};
typedef QFlags<QFileDevice::Permission> Permissions;
enum FileHandleFlag /BaseType=Flag/
{
AutoCloseHandle,
DontCloseHandle,
};
typedef QFlags<QFileDevice::FileHandleFlag> FileHandleFlags;
virtual ~QFileDevice();
QFileDevice::FileError error() const;
void unsetError();
virtual void close() /ReleaseGIL/;
virtual bool isSequential() const;
int handle() const;
virtual QString fileName() const;
virtual qint64 pos() const;
virtual bool seek(qint64 offset) /ReleaseGIL/;
virtual bool atEnd() const;
bool flush() /ReleaseGIL/;
virtual qint64 size() const;
virtual bool resize(qint64 sz);
virtual QFileDevice::Permissions permissions() const;
virtual bool setPermissions(QFileDevice::Permissions permissionSpec);
void *map(qint64 offset, qint64 size /ResultSize/, QFileDevice::MemoryMapFlags flags = QFileDevice::NoOptions) [uchar * (qint64 offset, qint64 size, QFileDevice::MemoryMapFlags flags = QFileDevice::NoOptions)];
bool unmap(void *address) [bool (uchar *address)];
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxlen)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QFileDevice::readData(s, a0) : sipCpp->readData(s, a0);
#else
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual SIP_PYOBJECT readLineData(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxlen)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QFileDevice::readLineData(s, a0) : sipCpp->readLineData(s, a0);
#else
len = sipCpp->sipProtectVirt_readLineData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(SIP_PYBUFFER) /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipRes = sipSelfWasArg ?
sipCpp->QFileDevice::writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len) :
sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
#else
sipRes = sipCpp->sipProtectVirt_writeData(sipSelfWasArg, reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
#endif
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
public:
enum FileTime
{
FileAccessTime,
FileBirthTime,
FileMetadataChangeTime,
FileModificationTime,
};
QDateTime fileTime(QFileDevice::FileTime time) const;
bool setFileTime(const QDateTime &newDate, QFileDevice::FileTime fileTime);
enum MemoryMapFlag /BaseType=Flag/
{
NoOptions,
MapPrivateOption,
};
typedef QFlags<QFileDevice::MemoryMapFlag> MemoryMapFlags;
};

View File

@@ -0,0 +1,135 @@
// qfileinfo.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QFileInfo
{
%TypeHeaderCode
#include <qfileinfo.h>
%End
public:
QFileInfo();
explicit QFileInfo(const QFileDevice &file);
explicit QFileInfo(const QString &file);
QFileInfo(const QDir &dir, const QString &file);
QFileInfo(const QFileInfo &fileinfo);
~QFileInfo();
%If (- Qt_6_8_0)
bool operator==(const QFileInfo &fileinfo) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QFileInfo &fileinfo) const;
%End
void setFile(const QString &file);
void setFile(const QFileDevice &file);
void setFile(const QDir &dir, const QString &file);
bool exists() const;
void refresh();
QString filePath() const;
SIP_PYOBJECT __fspath__();
%MethodCode
sipRes = qpycore_PyObject_FromQString(QDir::toNativeSeparators(sipCpp->filePath()));
%End
QString absoluteFilePath() const;
QString canonicalFilePath() const;
QString fileName() const;
QString baseName() const;
QString completeBaseName() const;
QString suffix() const;
QString completeSuffix() const;
QString path() const;
QString absolutePath() const;
QString canonicalPath() const;
QDir dir() const;
QDir absoluteDir() const;
bool isReadable() const;
bool isWritable() const;
bool isExecutable() const;
bool isHidden() const;
bool isRelative() const;
bool isAbsolute() const;
bool makeAbsolute();
bool isFile() const;
bool isDir() const;
bool isSymLink() const;
bool isRoot() const;
QString owner() const;
uint ownerId() const;
QString group() const;
uint groupId() const;
bool permission(QFileDevice::Permissions permissions) const;
QFileDevice::Permissions permissions() const;
qint64 size() const;
QDateTime lastModified() const;
%If (Qt_6_6_0 -)
QDateTime lastModified(const QTimeZone &tz) const;
%End
QDateTime lastRead() const;
%If (Qt_6_6_0 -)
QDateTime lastRead(const QTimeZone &tz) const;
%End
bool caching() const;
void setCaching(bool on);
QString symLinkTarget() const;
QString bundleName() const;
bool isBundle() const;
bool isNativePath() const;
void swap(QFileInfo &other /Constrained/);
static bool exists(const QString &file);
QDateTime birthTime() const;
%If (Qt_6_6_0 -)
QDateTime birthTime(const QTimeZone &tz) const;
%End
QDateTime metadataChangeTime() const;
%If (Qt_6_6_0 -)
QDateTime metadataChangeTime(const QTimeZone &tz) const;
%End
QDateTime fileTime(QFileDevice::FileTime time) const;
%If (Qt_6_6_0 -)
QDateTime fileTime(QFileDevice::FileTime time, const QTimeZone &tz) const;
%End
bool isSymbolicLink() const;
bool isShortcut() const;
bool isJunction() const;
void stat();
%If (Qt_6_2_0 -)
QString junctionTarget() const;
%End
%If (Qt_6_4_0 -)
bool isAlias() const;
%End
%If (Qt_6_6_0 -)
QString readSymLink() const;
%End
%If (Qt_6_10_0 -)
bool isOther() const;
%End
};
typedef QList<QFileInfo> QFileInfoList;
%If (Qt_6_8_0 -)
bool operator!=(const QFileInfo &lhs, const QFileInfo &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QFileInfo &lhs, const QFileInfo &rhs);
%End

View File

@@ -0,0 +1,37 @@
// qfileselector.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QFileSelector : public QObject
{
%TypeHeaderCode
#include <qfileselector.h>
%End
public:
explicit QFileSelector(QObject *parent /TransferThis/ = 0);
virtual ~QFileSelector();
QString select(const QString &filePath) const;
QUrl select(const QUrl &filePath) const;
QStringList extraSelectors() const;
void setExtraSelectors(const QStringList &list);
QStringList allSelectors() const;
};

View File

@@ -0,0 +1,43 @@
// qfilesystemwatcher.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QFileSystemWatcher : public QObject
{
%TypeHeaderCode
#include <qfilesystemwatcher.h>
%End
public:
QFileSystemWatcher(QObject *parent /TransferThis/ = 0);
QFileSystemWatcher(const QStringList &paths, QObject *parent /TransferThis/ = 0);
virtual ~QFileSystemWatcher();
bool addPath(const QString &file);
QStringList addPaths(const QStringList &files);
QStringList directories() const;
QStringList files() const;
bool removePath(const QString &file);
QStringList removePaths(const QStringList &files);
signals:
void directoryChanged(const QString &path);
void fileChanged(const QString &path);
};

View File

@@ -0,0 +1,49 @@
// This is the SIP interface definition for the QFlags based mapped types.
//
// 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.
template<ENUM>
%MappedType QFlags<ENUM> /PyQtFlags=1, TypeHint="ENUM"/
{
%TypeHeaderCode
#include <qglobal.h>
%End
%ConvertToTypeCode
bool is_enm = true;
unsigned enm = (unsigned)sipConvertToEnum(sipPy, sipType_ENUM);
if (PyErr_Occurred())
{
PyErr_Clear();
is_enm = false;
}
if (sipIsErr == NULL)
return is_enm;
*sipCppPtr = new QFlags<ENUM>(static_cast<ENUM>(enm));
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
return sipConvertFromEnum(sipCpp->operator::QFlags<ENUM>::Int(), sipType_ENUM);
%End
};

View File

@@ -0,0 +1,198 @@
// qglobal.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qglobal.h>
%End
const int QT_VERSION;
const char *QT_VERSION_STR;
%If (- Qt_6_5_0)
const char *qVersion();
%End
%If (- Qt_6_5_0)
typedef signed char qint8 /PyInt/;
%End
%If (- Qt_6_5_0)
typedef unsigned char quint8 /PyInt/;
%End
%If (- Qt_6_5_0)
typedef short qint16;
%End
%If (- Qt_6_5_0)
typedef unsigned short quint16;
%End
%If (- Qt_6_5_0)
typedef int qint32;
%End
%If (- Qt_6_5_0)
typedef unsigned int quint32;
%End
%If (- Qt_6_5_0)
typedef long long qint64;
%End
%If (- Qt_6_5_0)
typedef unsigned long long quint64;
%End
%If (- Qt_6_5_0)
typedef qint64 qlonglong;
%End
%If (- Qt_6_5_0)
typedef quint64 qulonglong;
%End
%If (- Qt_6_5_0)
%If (PyQt_qreal_double)
typedef double qreal;
%End
%End
%If (- Qt_6_5_0)
%If (!PyQt_qreal_double)
typedef float qreal;
%End
%End
%If (- Qt_6_5_0)
typedef unsigned char uchar;
%End
%If (- Qt_6_5_0)
typedef unsigned short ushort;
%End
%If (- Qt_6_5_0)
typedef unsigned int uint;
%End
%If (- Qt_6_5_0)
typedef unsigned long ulong;
%End
%If (- Qt_6_5_0)
typedef long long qsizetype;
%End
%If (- Qt_6_5_0)
double qAbs(const double &t);
%End
%If (- Qt_6_5_0)
int qRound(qreal d);
%End
%If (- Qt_6_5_0)
qint64 qRound64(qreal d);
%End
%If (- Qt_6_5_0)
bool qFuzzyCompare(double p1, double p2);
%End
typedef void *QFunctionPointer;
// Minimal support for the Qt resource system to help porting from PyQt5.
%ModuleCode
QT_BEGIN_NAMESPACE
extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
extern bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
QT_END_NAMESPACE
%End
bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
// Mapped type for qintptr.
// Map qintptr onto sip.voidptr. This means either an address (on Windows) or
// an integer file descriptor (on everything else) can be used.
%MappedType qintptr /TypeHint="PyQt6.sip.voidptr"/
{
%TypeHeaderCode
#include <QtGlobal>
%End
%ConvertToTypeCode
qintptr ptr = (qintptr)sipConvertToVoidPtr(sipPy);
if (!sipIsErr)
return !PyErr_Occurred();
// Mapped types deal with pointers, so create one on the heap.
qintptr *heap = new qintptr;
*heap = ptr;
*sipCppPtr = heap;
// Make sure the pointer doesn't leak.
return SIP_TEMPORARY;
%End
%ConvertFromTypeCode
return sipConvertFromVoidPtr((void *)*sipCpp);
%End
};
// Mapped type for quintptr.
// Map quintptr onto sip.voidptr. This means either an address (on Windows) or
// an integer file descriptor (on everything else) can be used.
%MappedType quintptr /TypeHint="PyQt6.sip.voidptr"/
{
%TypeHeaderCode
#include <QtGlobal>
%End
%ConvertToTypeCode
quintptr ptr = (quintptr)sipConvertToVoidPtr(sipPy);
if (!sipIsErr)
return !PyErr_Occurred();
// Mapped types deal with pointers, so create one on the heap.
quintptr *heap = new quintptr;
*heap = ptr;
*sipCppPtr = heap;
// Make sure the pointer doesn't leak.
return SIP_TEMPORARY;
%End
%ConvertFromTypeCode
return sipConvertFromVoidPtr((void *)*sipCpp);
%End
};
// Implementations of pyqt[Set]PickleProtocol().
void pyqtSetPickleProtocol(SIP_PYOBJECT /TypeHint="Optional[int]"/);
%MethodCode
Py_XDECREF(qpycore_pickle_protocol);
qpycore_pickle_protocol = a0;
Py_INCREF(qpycore_pickle_protocol);
%End
SIP_PYOBJECT pyqtPickleProtocol() /TypeHint="Optional[int]"/;
%MethodCode
sipRes = qpycore_pickle_protocol;
if (!sipRes)
sipRes = Py_None;
Py_INCREF(sipRes);
%End
%If (- Qt_6_5_0)
bool qEnvironmentVariableIsEmpty(const char *varName);
%End
%If (- Qt_6_5_0)
bool qEnvironmentVariableIsSet(const char *varName);
%End
%If (- Qt_6_5_0)
QString qEnvironmentVariable(const char *varName);
%End
%If (- Qt_6_5_0)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue);
%End
%If (- Qt_6_5_0)
int qEnvironmentVariableIntValue(const char *varName, bool *ok = 0);
%End

View File

@@ -0,0 +1,65 @@
// qidentityproxymodel.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QIdentityProxyModel : public QAbstractProxyModel
{
%TypeHeaderCode
#include <qidentityproxymodel.h>
%End
public:
explicit QIdentityProxyModel(QObject *parent /TransferThis/ = 0);
virtual ~QIdentityProxyModel();
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
virtual QModelIndex parent(const QModelIndex &child) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual QItemSelection mapSelectionFromSource(const QItemSelection &selection) const;
virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const;
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const;
virtual void setSourceModel(QAbstractItemModel *sourceModel /KeepReference/);
virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild);
virtual bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild);
%If (Qt_6_8_0 -)
bool handleSourceLayoutChanges() const;
%End
%If (Qt_6_8_0 -)
bool handleSourceDataChanges() const;
%End
protected:
%If (Qt_6_8_0 -)
void setHandleSourceLayoutChanges(bool);
%End
%If (Qt_6_8_0 -)
void setHandleSourceDataChanges(bool);
%End
};

View File

@@ -0,0 +1,432 @@
// qiodevice.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QIODevice : public QObject, public QIODeviceBase
{
%TypeHeaderCode
#include <qiodevice.h>
%End
public:
QIODevice();
explicit QIODevice(QObject *parent /TransferThis/);
virtual ~QIODevice();
QIODeviceBase::OpenMode openMode() const;
void setTextModeEnabled(bool enabled);
bool isTextModeEnabled() const;
bool isOpen() const;
bool isReadable() const;
bool isWritable() const;
virtual bool isSequential() const;
int readChannelCount() const;
int writeChannelCount() const;
int currentReadChannel() const;
void setCurrentReadChannel(int channel);
int currentWriteChannel() const;
void setCurrentWriteChannel(int channel);
virtual bool open(QIODeviceBase::OpenMode mode) /ReleaseGIL/;
virtual void close() /ReleaseGIL/;
virtual qint64 pos() const;
virtual qint64 size() const;
virtual bool seek(qint64 pos) /ReleaseGIL/;
virtual bool atEnd() const;
virtual bool reset();
virtual qint64 bytesAvailable() const;
virtual qint64 bytesToWrite() const;
SIP_PYOBJECT read(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
len = sipCpp->read(s, a0);
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
SIP_PYOBJECT readLine(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Return a bytes object or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
len = sipCpp->readLine(s, a0);
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
QByteArray readLine() /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = new QByteArray(sipCpp->readLine());
Py_END_ALLOW_THREADS
%End
%If (Qt_6_9_0 -)
bool readLineInto(QByteArray *result, qint64 maxSize = 0) /ReleaseGIL/;
%End
QByteArray readAll() /ReleaseGIL/;
virtual bool canReadLine() const;
void startTransaction();
void commitTransaction();
void rollbackTransaction();
bool isTransactionStarted() const;
qint64 write(SIP_PYBUFFER) /ReleaseGIL/;
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->write(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
SIP_PYOBJECT peek(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/;
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
len = sipCpp->peek(s, a0);
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
qint64 skip(qint64 maxSize) /ReleaseGIL/;
virtual bool waitForReadyRead(int msecs) /ReleaseGIL/;
virtual bool waitForBytesWritten(int msecs) /ReleaseGIL/;
void ungetChar(char c /Encoding="None"/);
bool putChar(char c /Encoding="None"/) /ReleaseGIL/;
bool getChar(char *c /Encoding="None",Out/) /ReleaseGIL/;
QString errorString() const;
signals:
void aboutToClose();
void bytesWritten(qint64 bytes);
void channelBytesWritten(int channel, qint64 bytes);
void channelReadyRead(int channel);
void readChannelFinished();
void readyRead();
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) = 0 /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxlen)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipCpp->readData(s, a0);
#else
len = sipCpp->sipProtect_readData(s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
%VirtualCatcherCode
PyObject *result = sipCallMethod(&sipIsErr, sipMethod, "n", a1);
if (result)
{
PyObject *buf;
if (sipParseResult(&sipIsErr, sipMethod, result, "$", &buf) == 0)
{
if (buf == Py_None)
{
sipRes = -1L;
}
else
{
sipBufferInfoDef bi;
if (sipGetBufferInfo(buf, &bi) < 0)
{
sipBadCatcherResult(sipMethod);
sipIsErr = 1;
}
else
{
sipRes = (a1 < bi.bi_len) ? a1 : bi.bi_len;
memcpy(a0, bi.bi_buf, sipRes);
sipReleaseBufferInfo(&bi);
}
}
Py_DECREF(buf);
}
Py_DECREF(result);
}
%End
virtual SIP_PYOBJECT readLineData(qint64 maxlen) /ReleaseGIL,TypeHint="bytes"/ [qint64 (char *data, qint64 maxlen)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QIODevice::readLineData(s, a0) : sipCpp->readLineData(s, a0);
#else
len = sipCpp->sipProtectVirt_readLineData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = PyBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
%VirtualCatcherCode
PyObject *result = sipCallMethod(&sipIsErr, sipMethod, "n", a1);
if (result)
{
PyObject *buf;
if (sipParseResult(&sipIsErr, sipMethod, result, "$", &buf) == 0)
{
if (buf == Py_None)
{
sipRes = -1L;
}
else
{
sipBufferInfoDef bi;
if (sipGetBufferInfo(buf, &bi) < 0)
{
sipBadCatcherResult(sipMethod);
sipIsErr = 1;
}
else
{
sipRes = (a1 < bi.bi_len) ? a1 : bi.bi_len;
memcpy(a0, bi.bi_buf, sipRes);
sipReleaseBufferInfo(&bi);
}
}
Py_DECREF(buf);
}
Py_DECREF(result);
}
%End
virtual qint64 writeData(SIP_PYBUFFER) = 0 /ReleaseGIL/ [qint64 (const char *data, qint64 len)];
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipRes = sipCpp->writeData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
#else
sipRes = sipCpp->sipProtect_writeData(reinterpret_cast<char *>(bi.bi_buf),
bi.bi_len);
#endif
Py_END_ALLOW_THREADS
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%VirtualCatcherCode
PyObject *result = sipCallMethod(&sipIsErr, sipMethod, "n", a1);
if (result)
{
PyObject *buf;
if (sipParseResult(&sipIsErr, sipMethod, result, "$", &buf) == 0)
{
if (buf == Py_None)
{
sipRes = -1L;
}
else
{
sipBufferInfoDef bi;
if (sipGetBufferInfo(buf, &bi) < 0)
{
sipBadCatcherResult(sipMethod);
sipIsErr = 1;
}
else
{
if (bi.bi_readonly)
{
sipBadCatcherResult(sipMethod);
sipIsErr = 1;
}
else
{
sipRes = (a1 < bi.bi_len) ? a1 : bi.bi_len;
memcpy(bi.bi_buf, a0, sipRes);
}
sipReleaseBufferInfo(&bi);
}
}
Py_DECREF(buf);
}
Py_DECREF(result);
}
%End
virtual qint64 skipData(qint64 maxSize) /ReleaseGIL/;
void setOpenMode(QIODeviceBase::OpenMode openMode);
void setErrorString(const QString &errorString);
};

View File

@@ -0,0 +1,50 @@
// qiodevicebase.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QIODeviceBase
{
%TypeHeaderCode
#include <qiodevicebase.h>
%End
public:
enum OpenModeFlag /BaseType=Flag/
{
NotOpen,
ReadOnly,
WriteOnly,
ReadWrite,
Append,
Truncate,
Text,
Unbuffered,
NewOnly,
ExistingOnly,
};
typedef QFlags<QIODeviceBase::OpenModeFlag> OpenMode;
protected:
%If (Qt_6_3_0 -)
~QIODeviceBase();
%End
};

View File

@@ -0,0 +1,274 @@
// qitemselectionmodel.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QItemSelectionRange
{
%TypeHeaderCode
#include <qitemselectionmodel.h>
%End
public:
QItemSelectionRange();
QItemSelectionRange(const QModelIndex &atopLeft, const QModelIndex &abottomRight);
explicit QItemSelectionRange(const QModelIndex &index);
int top() const;
int left() const;
int bottom() const;
int right() const;
int width() const;
int height() const;
const QPersistentModelIndex &topLeft() const;
const QPersistentModelIndex &bottomRight() const;
QModelIndex parent() const;
const QAbstractItemModel *model() const;
bool contains(const QModelIndex &index) const;
bool contains(int row, int column, const QModelIndex &parentIndex) const;
bool intersects(const QItemSelectionRange &other) const;
%If (- Qt_6_8_0)
bool operator==(const QItemSelectionRange &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QItemSelectionRange &other) const;
%End
bool isValid() const;
QModelIndexList indexes() const;
QItemSelectionRange intersected(const QItemSelectionRange &other) const;
bool isEmpty() const;
void swap(QItemSelectionRange &other /Constrained/);
};
class QItemSelectionModel : public QObject
{
%TypeHeaderCode
#include <qitemselectionmodel.h>
%End
public:
enum SelectionFlag /BaseType=Flag/
{
NoUpdate,
Clear,
Select,
Deselect,
Toggle,
Current,
Rows,
Columns,
SelectCurrent,
ToggleCurrent,
ClearAndSelect,
};
typedef QFlags<QItemSelectionModel::SelectionFlag> SelectionFlags;
explicit QItemSelectionModel(QAbstractItemModel *model /TransferThis/ = 0);
QItemSelectionModel(QAbstractItemModel *model, QObject *parent /TransferThis/);
virtual ~QItemSelectionModel();
QModelIndex currentIndex() const;
bool isSelected(const QModelIndex &index) const;
bool isRowSelected(int row, const QModelIndex &parent = QModelIndex()) const;
bool isColumnSelected(int column, const QModelIndex &parent = QModelIndex()) const;
bool rowIntersectsSelection(int row, const QModelIndex &parent = QModelIndex()) const;
bool columnIntersectsSelection(int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndexList selectedIndexes() const;
const QItemSelection selection() const;
QAbstractItemModel *model();
public slots:
virtual void clear();
void clearSelection();
virtual void reset();
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command);
virtual void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command);
virtual void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command);
virtual void clearCurrentIndex();
signals:
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void currentChanged(const QModelIndex &current, const QModelIndex &previous);
void currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
void currentColumnChanged(const QModelIndex &current, const QModelIndex &previous);
protected:
void emitSelectionChanged(const QItemSelection &newSelection, const QItemSelection &oldSelection);
public:
bool hasSelection() const;
QModelIndexList selectedRows(int column = 0) const;
QModelIndexList selectedColumns(int row = 0) const;
void setModel(QAbstractItemModel *model);
signals:
void modelChanged(QAbstractItemModel *model);
};
class QItemSelection
{
%TypeHeaderCode
#include <qitemselectionmodel.h>
%End
public:
QItemSelection();
QItemSelection(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void select(const QModelIndex &topLeft, const QModelIndex &bottomRight);
bool contains(const QModelIndex &index) const;
int __contains__(const QModelIndex &index);
%MethodCode
// It looks like you can't assign QBool to int.
sipRes = bool(sipCpp->contains(*a0));
%End
QModelIndexList indexes() const;
void merge(const QItemSelection &other, QItemSelectionModel::SelectionFlags command);
static void split(const QItemSelectionRange &range, const QItemSelectionRange &other, QItemSelection *result);
void __setitem__(int i, const QItemSelectionRange &range);
%MethodCode
int len;
len = sipCpp->count();
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
sipIsErr = 1;
else
(*sipCpp)[a0] = *a1;
%End
void __setitem__(SIP_PYSLICE slice, const QItemSelection &list);
%MethodCode
Py_ssize_t start, stop, step, slicelength;
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
{
sipIsErr = 1;
}
else
{
int vlen = a1->count();
if (vlen != slicelength)
{
sipBadLengthForSlice(vlen, slicelength);
sipIsErr = 1;
}
else
{
QItemSelection::const_iterator it = a1->begin();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
(*sipCpp)[start] = *it;
start += step;
++it;
}
}
}
%End
void __delitem__(int i);
%MethodCode
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
sipIsErr = 1;
else
sipCpp->removeAt(a0);
%End
void __delitem__(SIP_PYSLICE slice);
%MethodCode
Py_ssize_t start, stop, step, slicelength;
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
{
sipIsErr = 1;
}
else
{
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
sipCpp->removeAt(start);
start += step - 1;
}
}
%End
QItemSelectionRange operator[](int i);
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QItemSelectionRange(sipCpp->operator[]((int)idx));
%End
QItemSelection operator[](SIP_PYSLICE slice);
%MethodCode
Py_ssize_t start, stop, step, slicelength;
if (sipConvertFromSliceObject(a0, sipCpp->count(), &start, &stop, &step, &slicelength) < 0)
{
sipIsErr = 1;
}
else
{
sipRes = new QItemSelection();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
(*sipRes) += (*sipCpp)[start];
start += step;
}
}
%End
// Methods inherited from QList<QItemSelectionRange>.
bool operator!=(const QItemSelection &other) const;
bool operator==(const QItemSelection &other) const;
// Keep the following in sync with QStringList (except for mid()).
void clear();
bool isEmpty() const;
void append(const QItemSelectionRange &range);
void prepend(const QItemSelectionRange &range);
void insert(int i, const QItemSelectionRange &range);
void replace(int i, const QItemSelectionRange &range);
void removeAt(int i);
int removeAll(const QItemSelectionRange &range);
QItemSelectionRange takeAt(int i);
QItemSelectionRange takeFirst();
QItemSelectionRange takeLast();
void move(int from, int to);
int count(const QItemSelectionRange &range) const;
int count() const /__len__/;
QItemSelectionRange &first();
QItemSelectionRange &last();
int indexOf(const QItemSelectionRange &value, int from = 0) const;
int lastIndexOf(const QItemSelectionRange &value, int from = -1) const;
QItemSelection &operator+=(const QItemSelection &other);
QItemSelection &operator+=(const QItemSelectionRange &value);
};
%If (Qt_6_8_0 -)
bool operator!=(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QItemSelectionRange &lhs, const QItemSelectionRange &rhs);
%End

View File

@@ -0,0 +1,129 @@
// This is the SIP interface definition for the QJsonArray mapped type.
//
// 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.
// Note that we assume any iterable can be converted to a QJsonArray. However,
// because QJsonValue is an iterable and QJsonObject is implemented as a dict
// (which is also an iterable), then any overloads that handle one or more of
// them must be ordered so that QJsonArray is checked last.
%MappedType QJsonArray
/TypeHintIn="Iterable[QJsonValue]", TypeHintOut="List[QJsonValue]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qjsonarray.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
QJsonValue *t = new QJsonValue(sipCpp->at(i));
PyObject *tobj = sipConvertFromNewType(t, sipType_QJsonValue,
sipTransferObj);
if (!tobj)
{
delete t;
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, tobj);
}
return l;
%End
%ConvertToTypeCode
PyObject *iter = PyObject_GetIter(sipPy);
if (!sipIsErr)
{
PyErr_Clear();
Py_XDECREF(iter);
return (iter && !PyUnicode_Check(sipPy));
}
if (!iter)
{
*sipIsErr = 1;
return 0;
}
QJsonArray *ql = new QJsonArray;
for (Py_ssize_t i = 0; ; ++i)
{
PyErr_Clear();
PyObject *itm = PyIter_Next(iter);
if (!itm)
{
if (PyErr_Occurred())
{
delete ql;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
break;
}
int state;
QJsonValue *t = reinterpret_cast<QJsonValue *>(
sipForceConvertToType(itm, sipType_QJsonValue, sipTransferObj,
SIP_NOT_NONE, &state, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"index %zd has type '%s' but 'QJsonValue' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete ql;
Py_DECREF(iter);
return 0;
}
ql->append(*t);
sipReleaseType(t, sipType_QJsonValue, state);
Py_DECREF(itm);
}
Py_DECREF(iter);
*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End
};

View File

@@ -0,0 +1,106 @@
// qjsondocument.sip generated by MetaSIP
//
// This file is part of the QtCore 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_9_0)
struct QJsonParseError
{
%TypeHeaderCode
#include <qjsondocument.h>
%End
enum ParseError
{
NoError,
UnterminatedObject,
MissingNameSeparator,
UnterminatedArray,
MissingValueSeparator,
IllegalValue,
TerminationByNumber,
IllegalNumber,
IllegalEscapeSequence,
IllegalUTF8String,
UnterminatedString,
MissingObject,
DeepNesting,
DocumentTooLarge,
GarbageAtEnd,
};
QString errorString() const;
int offset;
QJsonParseError::ParseError error;
};
%End
class QJsonDocument
{
%TypeHeaderCode
#include <qjsondocument.h>
%End
public:
QJsonDocument();
explicit QJsonDocument(const QJsonObject &object);
explicit QJsonDocument(const QJsonArray &array);
QJsonDocument(const QJsonDocument &other);
~QJsonDocument();
static QJsonDocument fromVariant(const QVariant &variant);
QVariant toVariant() const;
enum JsonFormat
{
Indented,
Compact,
};
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
QByteArray toJson(QJsonDocument::JsonFormat format = QJsonDocument::Indented) const;
bool isEmpty() const;
bool isArray() const;
bool isObject() const;
QJsonObject object() const;
QJsonArray array() const;
void setObject(const QJsonObject &object);
void setArray(const QJsonArray &array);
%If (- Qt_6_8_0)
bool operator==(const QJsonDocument &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QJsonDocument &other) const;
%End
bool isNull() const;
void swap(QJsonDocument &other /Constrained/);
const QJsonValue operator[](qsizetype i) const;
const QJsonValue operator[](const QString &key) const;
};
QDataStream &operator<<(QDataStream &, const QJsonDocument & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QJsonDocument & /Constrained/) /ReleaseGIL/;
%If (Qt_6_8_0 -)
bool operator!=(const QJsonDocument &lhs, const QJsonDocument &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QJsonDocument &lhs, const QJsonDocument &rhs);
%End

View File

@@ -0,0 +1,136 @@
// This is the SIP interface definition for the QJsonObject mapped type.
//
// 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.
%MappedType QJsonObject
/TypeHint="Dict[QString, QJsonValue]", TypeHintValue="{}"/
{
%TypeHeaderCode
#include <qjsonobject.h>
%End
%ConvertFromTypeCode
PyObject *d = PyDict_New();
if (!d)
return 0;
QJsonObject::const_iterator it = sipCpp->constBegin();
QJsonObject::const_iterator end = sipCpp->constEnd();
while (it != end)
{
QString *k = new QString(it.key());
PyObject *kobj = sipConvertFromNewType(k, sipType_QString,
sipTransferObj);
if (!kobj)
{
delete k;
Py_DECREF(d);
return 0;
}
QJsonValue *v = new QJsonValue(it.value());
PyObject *vobj = sipConvertFromNewType(v, sipType_QJsonValue,
sipTransferObj);
if (!vobj)
{
delete v;
Py_DECREF(kobj);
Py_DECREF(d);
return 0;
}
int rc = PyDict_SetItem(d, kobj, vobj);
Py_DECREF(vobj);
Py_DECREF(kobj);
if (rc < 0)
{
Py_DECREF(d);
return 0;
}
++it;
}
return d;
%End
%ConvertToTypeCode
if (!sipIsErr)
return PyDict_Check(sipPy);
QJsonObject *jo = new QJsonObject;
Py_ssize_t pos = 0;
PyObject *kobj, *vobj;
while (PyDict_Next(sipPy, &pos, &kobj, &vobj))
{
int kstate;
QString *k = reinterpret_cast<QString *>(
sipForceConvertToType(kobj, sipType_QString, sipTransferObj,
SIP_NOT_NONE, &kstate, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"a key has type '%s' but 'str' is expected",
sipPyTypeName(Py_TYPE(kobj)));
delete jo;
return 0;
}
int vstate;
QJsonValue *v = reinterpret_cast<QJsonValue *>(
sipForceConvertToType(vobj, sipType_QJsonValue, sipTransferObj,
SIP_NOT_NONE, &vstate, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"a value has type '%s' but 'QJsonValue' is expected",
sipPyTypeName(Py_TYPE(vobj)));
sipReleaseType(k, sipType_QString, kstate);
delete jo;
return 0;
}
jo->insert(*k, *v);
sipReleaseType(v, sipType_QJsonValue, vstate);
sipReleaseType(k, sipType_QString, kstate);
}
*sipCppPtr = jo;
return sipGetState(sipTransferObj);
%End
};

View File

@@ -0,0 +1,55 @@
// qjsonparseerror.sip generated by MetaSIP
//
// This file is part of the QtCore 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_9_0 -)
struct QJsonParseError
{
%TypeHeaderCode
#include <qjsonparseerror.h>
%End
enum ParseError
{
NoError,
UnterminatedObject,
MissingNameSeparator,
UnterminatedArray,
MissingValueSeparator,
IllegalValue,
TerminationByNumber,
IllegalNumber,
IllegalEscapeSequence,
IllegalUTF8String,
UnterminatedString,
MissingObject,
DeepNesting,
DocumentTooLarge,
GarbageAtEnd,
};
QString errorString() const;
int offset;
QJsonParseError::ParseError error;
};
%End

View File

@@ -0,0 +1,103 @@
// qjsonvalue.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QJsonValue /AllowNone,TypeHintIn="Union[QJsonValue, QJsonValue.Type, QJsonArray, QJsonObject, bool, int, float, None, QString]"/
{
%TypeHeaderCode
#include <qjsonvalue.h>
%End
%ConvertToTypeCode
if (!sipIsErr)
return qpycore_canConvertTo_QJsonValue(sipPy);
return qpycore_convertTo_QJsonValue(sipPy, sipTransferObj, sipCppPtr, sipIsErr);
%End
public:
enum Type
{
Null,
Bool,
Double,
String,
Array,
Object,
Undefined,
};
QJsonValue(QJsonValue::Type type /Constrained/ = QJsonValue::Null);
QJsonValue(const QJsonValue &other);
~QJsonValue();
static QJsonValue fromVariant(const QVariant &variant);
QVariant toVariant() const;
QJsonValue::Type type() const;
bool isNull() const;
bool isBool() const;
bool isDouble() const;
bool isString() const;
bool isArray() const;
bool isObject() const;
bool isUndefined() const;
bool toBool(bool defaultValue = false) const;
int toInt(int defaultValue = 0) const;
qint64 toInteger(qint64 defaultValue = 0) const;
double toDouble(double defaultValue = 0) const;
QJsonArray toArray() const;
QJsonArray toArray(const QJsonArray &defaultValue) const;
QJsonObject toObject() const;
QJsonObject toObject(const QJsonObject &defaultValue) const;
%If (- Qt_6_8_0)
bool operator==(const QJsonValue &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QJsonValue &other) const;
%End
QString toString() const;
QString toString(const QString &defaultValue) const;
void swap(QJsonValue &other /Constrained/);
const QJsonValue operator[](qsizetype i) const;
const QJsonValue operator[](const QString &key) const;
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%If (Qt_6_9_0 -)
typedef QJsonDocument::JsonFormat JsonFormat;
%End
%If (Qt_6_9_0 -)
static QJsonValue fromJson(QByteArrayView json, QJsonParseError *error /Out/ = 0);
%End
%If (Qt_6_9_0 -)
QByteArray toJson(QJsonValue::JsonFormat format = QJsonDocument::Indented) const;
%End
};
QDataStream &operator<<(QDataStream &, const QJsonValue & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QJsonValue & /Constrained/) /ReleaseGIL/;
%If (Qt_6_8_0 -)
bool operator==(const QJsonValue &lhs, const QJsonValue &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QJsonValue &lhs, const QJsonValue &rhs);
%End

View File

@@ -0,0 +1,60 @@
// qlibrary.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QLibrary : public QObject
{
%TypeHeaderCode
#include <qlibrary.h>
%End
public:
enum LoadHint /BaseType=Flag/
{
ResolveAllSymbolsHint,
ExportExternalSymbolsHint,
LoadArchiveMemberHint,
PreventUnloadHint,
DeepBindHint,
};
typedef QFlags<QLibrary::LoadHint> LoadHints;
explicit QLibrary(QObject *parent /TransferThis/ = 0);
QLibrary(const QString &fileName, QObject *parent /TransferThis/ = 0);
QLibrary(const QString &fileName, int verNum, QObject *parent /TransferThis/ = 0);
QLibrary(const QString &fileName, const QString &version, QObject *parent /TransferThis/ = 0);
virtual ~QLibrary();
QString errorString() const;
QString fileName() const;
bool isLoaded() const;
bool load();
QLibrary::LoadHints loadHints() const;
QFunctionPointer resolve(const char *symbol);
static QFunctionPointer resolve(const QString &fileName, const char *symbol);
static QFunctionPointer resolve(const QString &fileName, int verNum, const char *symbol);
static QFunctionPointer resolve(const QString &fileName, const QString &version, const char *symbol);
bool unload();
static bool isLibrary(const QString &fileName);
void setFileName(const QString &fileName);
void setFileNameAndVersion(const QString &fileName, int verNum);
void setFileNameAndVersion(const QString &fileName, const QString &version);
void setLoadHints(QLibrary::LoadHints hints);
};

View File

@@ -0,0 +1,63 @@
// qlibraryinfo.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QLibraryInfo
{
%TypeHeaderCode
#include <qlibraryinfo.h>
%End
public:
enum LibraryPath
{
PrefixPath,
DocumentationPath,
HeadersPath,
LibrariesPath,
LibraryExecutablesPath,
BinariesPath,
PluginsPath,
Qml2ImportsPath,
ArchDataPath,
DataPath,
TranslationsPath,
ExamplesPath,
TestsPath,
SettingsPath,
%If (Qt_6_2_0 -)
QmlImportsPath,
%End
};
static bool isDebugBuild();
%If (Qt_6_5_0 -)
static bool isSharedBuild();
%End
static QString path(QLibraryInfo::LibraryPath p) /ReleaseGIL/;
static QVersionNumber version();
%If (Qt_6_8_0 -)
static QStringList paths(QLibraryInfo::LibraryPath p) /ReleaseGIL/;
%End
private:
QLibraryInfo();
};

View File

@@ -0,0 +1,213 @@
// qline.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qline.h>
%End
class QLine
{
%TypeHeaderCode
#include <qline.h>
%End
%PickleCode
sipRes = Py_BuildValue("iiii", sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
%End
public:
QLine();
QLine(const QPoint &pt1_, const QPoint &pt2_);
QLine(int x1pos, int y1pos, int x2pos, int y2pos);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QLine()");
}
else
{
sipRes = PyUnicode_FromFormat(
"PyQt6.QtCore.QLine(%i, %i, %i, %i)",
sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
}
%End
bool isNull() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isNull();
%End
int x1() const;
int y1() const;
int x2() const;
int y2() const;
QPoint p1() const;
QPoint p2() const;
int dx() const;
int dy() const;
void translate(const QPoint &point);
void translate(int adx, int ady);
%If (- Qt_6_8_0)
bool operator==(const QLine &d) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QLine &d) const;
%End
QLine translated(const QPoint &p) const;
QLine translated(int adx, int ady) const;
void setP1(const QPoint &aP1);
void setP2(const QPoint &aP2);
void setPoints(const QPoint &aP1, const QPoint &aP2);
void setLine(int aX1, int aY1, int aX2, int aY2);
QPoint center() const;
%If (Qt_6_4_0 -)
QLineF toLineF() const;
%End
};
QDataStream &operator<<(QDataStream &, const QLine &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QLine & /Constrained/) /ReleaseGIL/;
class QLineF
{
%TypeHeaderCode
#include <qline.h>
%End
%PickleCode
sipRes = Py_BuildValue("dddd", sipCpp->x1(), sipCpp->y1(), sipCpp->x2(), sipCpp->y2());
%End
public:
enum IntersectionType
{
NoIntersection,
BoundedIntersection,
UnboundedIntersection,
};
QLineF(const QLine &line);
bool isNull() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isNull();
%End
qreal length() const;
QLineF unitVector() const;
QLineF::IntersectionType intersects(const QLineF &l, QPointF *intersectionPoint /Out/ = 0) const;
QLineF();
QLineF(const QPointF &apt1, const QPointF &apt2);
QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
if (sipCpp->isNull())
{
sipRes = PyUnicode_FromString("PyQt6.QtCore.QLineF()");
}
else
{
PyObject *x1 = PyFloat_FromDouble(sipCpp->x1());
PyObject *y1 = PyFloat_FromDouble(sipCpp->y1());
PyObject *x2 = PyFloat_FromDouble(sipCpp->x2());
PyObject *y2 = PyFloat_FromDouble(sipCpp->y2());
if (x1 && y1 && x2 && y2)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtCore.QLineF(%R, %R, %R, %R)",
x1, y1, x2, y2);
}
Py_XDECREF(x1);
Py_XDECREF(y1);
Py_XDECREF(x2);
Py_XDECREF(y2);
}
%End
qreal x1() const;
qreal y1() const;
qreal x2() const;
qreal y2() const;
QPointF p1() const;
QPointF p2() const;
qreal dx() const;
qreal dy() const;
QLineF normalVector() const;
void translate(const QPointF &point);
void translate(qreal adx, qreal ady);
void setLength(qreal len);
QPointF pointAt(qreal t) const;
QLine toLine() const;
%If (- Qt_6_8_0)
bool operator==(const QLineF &d) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QLineF &d) const;
%End
static QLineF fromPolar(qreal length, qreal angle);
qreal angle() const;
void setAngle(qreal angle);
qreal angleTo(const QLineF &l) const;
QLineF translated(const QPointF &p) const;
QLineF translated(qreal adx, qreal ady) const;
void setP1(const QPointF &aP1);
void setP2(const QPointF &aP2);
void setPoints(const QPointF &aP1, const QPointF &aP2);
void setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2);
QPointF center() const;
};
QDataStream &operator<<(QDataStream &, const QLineF &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QLineF & /Constrained/) /ReleaseGIL/;
%If (Qt_6_8_0 -)
bool operator!=(const QLineF &lhs, const QLine &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QLine &lhs, const QLineF &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QLineF &lhs, const QLineF &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QLine &lhs, const QLine &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QLineF &lhs, const QLine &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QLine &lhs, const QLineF &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QLineF &lhs, const QLineF &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QLine &lhs, const QLine &rhs);
%End
%If (Qt_6_8_0 -)
bool qFuzzyCompare(const QLineF &lhs, const QLineF &rhs);
%End
%If (Qt_6_8_0 -)
bool qFuzzyIsNull(const QLineF &line);
%End

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
// qlockfile.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QLockFile
{
%TypeHeaderCode
#include <qlockfile.h>
%End
public:
%If (Qt_6_10_0 -)
explicit QLockFile(const QString &fileName);
%End
%If (- Qt_6_10_0)
QLockFile(const QString &fileName);
%End
~QLockFile();
bool lock() /ReleaseGIL/;
bool tryLock(int timeout = 0) /ReleaseGIL/;
void unlock() /ReleaseGIL/;
void setStaleLockTime(int);
int staleLockTime() const;
bool isLocked() const /ReleaseGIL/;
bool getLockInfo(qint64 *pid /Out/, QString *hostname /Out/, QString *appname /Out/) const;
bool removeStaleLockFile() /ReleaseGIL/;
enum LockError
{
NoError,
LockFailedError,
PermissionError,
UnknownError,
};
QLockFile::LockError error() const;
QString fileName() const;
private:
QLockFile(const QLockFile &);
};

View File

@@ -0,0 +1,236 @@
// qlogging.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qlogging.h>
%End
enum QtMsgType
{
QtDebugMsg,
QtWarningMsg,
QtCriticalMsg,
QtFatalMsg,
QtSystemMsg,
QtInfoMsg,
};
class QMessageLogContext /NoDefaultCtors/
{
%TypeHeaderCode
#include <qlogging.h>
%End
public:
%If (Qt_6_8_0 -)
static const int CurrentVersion;
%End
int line;
const char *file;
const char *function;
const char *category;
};
class QMessageLogger
{
%TypeHeaderCode
#include <qlogging.h>
%End
public:
QMessageLogger();
QMessageLogger(const char *file, int line, const char *function);
QMessageLogger(const char *file, int line, const char *function, const char *category);
void debug(const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->debug("%s", a0);
Py_END_ALLOW_THREADS
%End
void debug(const QLoggingCategory &cat, const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->debug(*a0, "%s", a1);
Py_END_ALLOW_THREADS
%End
void info(const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->info("%s", a0);
Py_END_ALLOW_THREADS
%End
void info(const QLoggingCategory &cat, const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->info(*a0, "%s", a1);
Py_END_ALLOW_THREADS
%End
void warning(const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->warning("%s", a0);
Py_END_ALLOW_THREADS
%End
void warning(const QLoggingCategory &cat, const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->warning(*a0, "%s", a1);
Py_END_ALLOW_THREADS
%End
void critical(const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->critical("%s", a0);
Py_END_ALLOW_THREADS
%End
void critical(const QLoggingCategory &cat, const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->critical(*a0, "%s", a1);
Py_END_ALLOW_THREADS
%End
void fatal(const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->fatal("%s", a0);
Py_END_ALLOW_THREADS
%End
%If (Qt_6_5_0 -)
void fatal(const QLoggingCategory &cat, const char *msg) const /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->fatal(*a0, "%s", a1);
Py_END_ALLOW_THREADS
%End
%End
private:
QMessageLogger(const QMessageLogger &);
};
void qCritical(const char *msg) /ReleaseGIL/;
%MethodCode
const char *file, *function;
int line = qpycore_current_context(&file, &function);
Py_BEGIN_ALLOW_THREADS
QMessageLogger(file, line, function).critical("%s", a0);
Py_END_ALLOW_THREADS
%End
void qDebug(const char *msg) /ReleaseGIL/;
%MethodCode
const char *file, *function;
int line = qpycore_current_context(&file, &function);
Py_BEGIN_ALLOW_THREADS
QMessageLogger(file, line, function).debug("%s", a0);
Py_END_ALLOW_THREADS
%End
void qFatal(const char *msg) /ReleaseGIL/;
%MethodCode
const char *file, *function;
int line = qpycore_current_context(&file, &function);
Py_BEGIN_ALLOW_THREADS
QMessageLogger(file, line, function).fatal("%s", a0);
Py_END_ALLOW_THREADS
%End
void qInfo(const char *msg) /ReleaseGIL/;
%MethodCode
const char *file, *function;
int line = qpycore_current_context(&file, &function);
Py_BEGIN_ALLOW_THREADS
QMessageLogger(file, line, function).info("%s", a0);
Py_END_ALLOW_THREADS
%End
void qWarning(const char *msg) /ReleaseGIL/;
%MethodCode
const char *file, *function;
int line = qpycore_current_context(&file, &function);
Py_BEGIN_ALLOW_THREADS
QMessageLogger(file, line, function).warning("%s", a0);
Py_END_ALLOW_THREADS
%End
SIP_PYCALLABLE qInstallMessageHandler(SIP_PYCALLABLE /AllowNone,TypeHint="Optional[Callable[[QtMsgType, QMessageLogContext, QString], None]]"/) /TypeHint="Optional[Callable[[QtMsgType, QMessageLogContext, QString], None]]"/;
%MethodCode
// Treat None as the default handler.
QtMessageHandler old = qInstallMessageHandler((a0 != Py_None) ? qtcore_MessageHandler : 0);
// If we recognise the old handler, then return it. Otherwise return
// the default handler. This doesn't exactly mimic the Qt behaviour
// but it is probably close enough for the way it will be used.
sipRes = (old == qtcore_MessageHandler) ? qtcore_PyMessageHandler : Py_None;
Py_INCREF(sipRes);
// Save the new Python handler.
Py_XDECREF(qtcore_PyMessageHandler);
qtcore_PyMessageHandler = a0;
Py_INCREF(qtcore_PyMessageHandler);
%End
// Module code needed by qInstallMessageHandler().
%ModuleCode
// The user supplied Python handler.
static PyObject *qtcore_PyMessageHandler = 0;
// The C++ wrapper around the Python handler.
static void qtcore_MessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
PyObject *res;
SIP_BLOCK_THREADS
res = sipCallMethod(0, qtcore_PyMessageHandler, "FDD", type, sipType_QtMsgType, &context, sipType_QMessageLogContext, NULL, &msg, sipType_QString, NULL);
Py_XDECREF(res);
if (res != NULL && res != Py_None)
{
PyErr_SetString(PyExc_TypeError, "invalid result type from PyQt message handler");
res = NULL;
}
if (res == NULL)
pyqt6_err_print();
SIP_UNBLOCK_THREADS
}
%End
void qSetMessagePattern(const QString &messagePattern);
QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &buf);

View File

@@ -0,0 +1,45 @@
// qloggingcategory.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QLoggingCategory
{
%TypeHeaderCode
#include <qloggingcategory.h>
%End
public:
QLoggingCategory(const char *category, QtMsgType severityLevel = QtDebugMsg);
~QLoggingCategory();
bool isEnabled(QtMsgType type) const;
void setEnabled(QtMsgType type, bool enable);
bool isDebugEnabled() const;
bool isInfoEnabled() const;
bool isWarningEnabled() const;
bool isCriticalEnabled() const;
const char *categoryName() const;
QLoggingCategory &operator()();
static QLoggingCategory *defaultCategory();
static void setFilterRules(const QString &rules);
private:
QLoggingCategory(const QLoggingCategory &);
};

View File

@@ -0,0 +1,135 @@
// qmargins.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qmargins.h>
%End
class QMargins
{
%TypeHeaderCode
#include <qmargins.h>
%End
public:
QMargins();
QMargins(int aleft, int atop, int aright, int abottom);
bool isNull() const;
int left() const;
int top() const;
int right() const;
int bottom() const;
void setLeft(int aleft);
void setTop(int atop);
void setRight(int aright);
void setBottom(int abottom);
QMargins &operator+=(const QMargins &margins);
QMargins &operator-=(const QMargins &margins);
QMargins &operator*=(int factor /Constrained/);
QMargins &operator/=(int divisor /Constrained/);
QMargins &operator*=(qreal factor);
QMargins &operator/=(qreal divisor);
QMargins &operator+=(int margin);
QMargins &operator-=(int margin);
%If (Qt_6_4_0 -)
QMarginsF toMarginsF() const;
%End
};
%If (Qt_6_8_0 -)
bool operator==(const QMarginsF &lhs, const QMargins &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QMargins &lhs, const QMarginsF &rhs);
%End
bool operator==(const QMargins &m1, const QMargins &m2);
%If (Qt_6_8_0 -)
bool operator!=(const QMarginsF &lhs, const QMargins &rhs);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QMargins &lhs, const QMarginsF &rhs);
%End
bool operator!=(const QMargins &m1, const QMargins &m2);
QDataStream &operator<<(QDataStream &, const QMargins & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMargins & /Constrained/) /ReleaseGIL/;
QMargins operator+(const QMargins &m1, const QMargins &m2);
QMargins operator-(const QMargins &m1, const QMargins &m2);
QMargins operator*(const QMargins &margins, int factor /Constrained/);
QMargins operator*(const QMargins &margins, qreal factor);
QMargins operator/(const QMargins &margins, int divisor /Constrained/);
QMargins operator/(const QMargins &margins, qreal divisor);
QMargins operator+(const QMargins &lhs, int rhs);
QMargins operator+(int lhs, const QMargins &rhs);
QMargins operator-(const QMargins &lhs, int rhs);
QMargins operator+(const QMargins &margins);
QMargins operator-(const QMargins &margins);
QMargins operator|(const QMargins &m1, const QMargins &m2);
class QMarginsF
{
%TypeHeaderCode
#include <qmargins.h>
%End
public:
QMarginsF();
QMarginsF(qreal aleft, qreal atop, qreal aright, qreal abottom);
QMarginsF(const QMargins &margins);
bool isNull() const;
qreal left() const;
qreal top() const;
qreal right() const;
qreal bottom() const;
void setLeft(qreal aleft);
void setTop(qreal atop);
void setRight(qreal aright);
void setBottom(qreal abottom);
QMarginsF &operator+=(const QMarginsF &margins);
QMarginsF &operator-=(const QMarginsF &margins);
QMarginsF &operator+=(qreal addend);
QMarginsF &operator-=(qreal subtrahend);
QMarginsF &operator*=(qreal factor);
QMarginsF &operator/=(qreal divisor);
QMargins toMargins() const;
};
QDataStream &operator<<(QDataStream &, const QMarginsF & /Constrained/);
QDataStream &operator>>(QDataStream &, QMarginsF & /Constrained/);
bool operator==(const QMarginsF &lhs, const QMarginsF &rhs);
bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs);
QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs);
QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs);
QMarginsF operator+(const QMarginsF &lhs, qreal rhs);
QMarginsF operator+(qreal lhs, const QMarginsF &rhs);
QMarginsF operator-(const QMarginsF &lhs, qreal rhs);
QMarginsF operator*(const QMarginsF &lhs, qreal rhs);
QMarginsF operator*(qreal lhs, const QMarginsF &rhs);
QMarginsF operator/(const QMarginsF &lhs, qreal divisor);
QMarginsF operator+(const QMarginsF &margins);
QMarginsF operator-(const QMarginsF &margins);
QMarginsF operator|(const QMarginsF &m1, const QMarginsF &m2);
%If (Qt_6_8_0 -)
bool qFuzzyCompare(const QMarginsF &lhs, const QMarginsF &rhs);
%End
%If (Qt_6_8_0 -)
bool qFuzzyIsNull(const QMarginsF &m);
%End

View File

@@ -0,0 +1,78 @@
// qmessageauthenticationcode.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMessageAuthenticationCode
{
%TypeHeaderCode
#include <qmessageauthenticationcode.h>
%End
public:
%If (Qt_6_6_0 -)
QMessageAuthenticationCode(QCryptographicHash::Algorithm method, QByteArrayView key = {});
%End
%If (- Qt_6_6_0)
QMessageAuthenticationCode(QCryptographicHash::Algorithm method, const QByteArray &key = QByteArray());
%End
~QMessageAuthenticationCode();
void reset();
%If (Qt_6_6_0 -)
void setKey(QByteArrayView key);
%End
%If (- Qt_6_6_0)
void setKey(const QByteArray &key);
%End
%If (Qt_6_6_0 -)
void addData(QByteArrayView data);
%End
%If (- Qt_6_6_0)
void addData(SIP_PYBUFFER);
%MethodCode
sipBufferInfoDef bi;
if (sipGetBufferInfo(a0, &bi) > 0)
{
sipCpp->addData(reinterpret_cast<char *>(bi.bi_buf), bi.bi_len);
sipReleaseBufferInfo(&bi);
}
else
{
sipIsErr = 1;
}
%End
%End
bool addData(QIODevice *device);
QByteArray result() const;
%If (Qt_6_6_0 -)
static QByteArray hash(QByteArrayView message, QByteArrayView key, QCryptographicHash::Algorithm method);
%End
%If (- Qt_6_6_0)
static QByteArray hash(const QByteArray &message, const QByteArray &key, QCryptographicHash::Algorithm method);
%End
%If (Qt_6_6_0 -)
void swap(QMessageAuthenticationCode &other /Constrained/);
%End
private:
QMessageAuthenticationCode(const QMessageAuthenticationCode &);
};

View File

@@ -0,0 +1,288 @@
// qmetaobject.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMetaMethod
{
%TypeHeaderCode
#include <qmetaobject.h>
%End
%TypeCode
// Raise an exception when QMetaMethod::invoke() returns false.
static void qtcore_invoke_exception()
{
PyErr_SetString(PyExc_RuntimeError, "QMetaMethod.invoke() call failed");
}
%End
public:
QMetaMethod();
const char *typeName() const;
QList<QByteArray> parameterTypes() const;
QList<QByteArray> parameterNames() const;
const char *tag() const;
enum Access
{
Private,
Protected,
Public,
};
QMetaMethod::Access access() const;
enum MethodType
{
Method,
Signal,
Slot,
Constructor,
};
QMetaMethod::MethodType methodType() const;
SIP_PYOBJECT invoke(QObject *object, QGenericArgument value0 = QGenericArgument(nullptr), QGenericArgument value1 = QGenericArgument(), QGenericArgument value2 = QGenericArgument(), QGenericArgument value3 = QGenericArgument(), QGenericArgument value4 = QGenericArgument(), QGenericArgument value5 = QGenericArgument(), QGenericArgument value6 = QGenericArgument(), QGenericArgument value7 = QGenericArgument(), QGenericArgument value8 = QGenericArgument(), QGenericArgument value9 = QGenericArgument()) const;
%MethodCode
// Raise an exception if the call failed.
bool ok;
Py_BEGIN_ALLOW_THREADS
ok = sipCpp->invoke(a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10);
Py_END_ALLOW_THREADS
if (ok)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
qtcore_invoke_exception();
}
%End
SIP_PYOBJECT invoke(QObject *object, Qt::ConnectionType connectionType, QGenericArgument value0 = QGenericArgument(nullptr), QGenericArgument value1 = QGenericArgument(), QGenericArgument value2 = QGenericArgument(), QGenericArgument value3 = QGenericArgument(), QGenericArgument value4 = QGenericArgument(), QGenericArgument value5 = QGenericArgument(), QGenericArgument value6 = QGenericArgument(), QGenericArgument value7 = QGenericArgument(), QGenericArgument value8 = QGenericArgument(), QGenericArgument value9 = QGenericArgument()) const;
%MethodCode
// Raise an exception if the call failed.
bool ok;
Py_BEGIN_ALLOW_THREADS
ok = sipCpp->invoke(a0, a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10, *a11);
Py_END_ALLOW_THREADS
if (ok)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
qtcore_invoke_exception();
}
%End
SIP_PYOBJECT invoke(QObject *object, QGenericReturnArgument returnValue /GetWrapper/, QGenericArgument value0 = QGenericArgument(nullptr), QGenericArgument value1 = QGenericArgument(), QGenericArgument value2 = QGenericArgument(), QGenericArgument value3 = QGenericArgument(), QGenericArgument value4 = QGenericArgument(), QGenericArgument value5 = QGenericArgument(), QGenericArgument value6 = QGenericArgument(), QGenericArgument value7 = QGenericArgument(), QGenericArgument value8 = QGenericArgument(), QGenericArgument value9 = QGenericArgument()) const;
%MethodCode
// Raise an exception if the call failed.
bool ok;
Py_BEGIN_ALLOW_THREADS
ok = sipCpp->invoke(a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10,
*a11);
Py_END_ALLOW_THREADS
if (ok)
sipRes = qpycore_ReturnValue(a1Wrapper);
else
qtcore_invoke_exception();
%End
SIP_PYOBJECT invoke(QObject *object, Qt::ConnectionType connectionType, QGenericReturnArgument returnValue /GetWrapper/, QGenericArgument value0 = QGenericArgument(nullptr), QGenericArgument value1 = QGenericArgument(), QGenericArgument value2 = QGenericArgument(), QGenericArgument value3 = QGenericArgument(), QGenericArgument value4 = QGenericArgument(), QGenericArgument value5 = QGenericArgument(), QGenericArgument value6 = QGenericArgument(), QGenericArgument value7 = QGenericArgument(), QGenericArgument value8 = QGenericArgument(), QGenericArgument value9 = QGenericArgument()) const;
%MethodCode
// Raise an exception if the call failed.
bool ok;
Py_BEGIN_ALLOW_THREADS
ok = sipCpp->invoke(a0, a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10, *a11,
*a12);
Py_END_ALLOW_THREADS
if (ok)
sipRes = qpycore_ReturnValue(a2Wrapper);
else
qtcore_invoke_exception();
%End
int methodIndex() const;
int revision() const;
bool isValid() const;
QByteArray methodSignature() const;
QByteArray name() const;
int returnType() const;
int parameterCount() const;
int parameterType(int index) const;
QMetaType returnMetaType() const;
QMetaType parameterMetaType(int index) const;
QByteArray parameterTypeName(int index) const;
int relativeMethodIndex() const;
%If (Qt_6_2_0 -)
bool isConst() const;
%End
};
class QMetaEnum
{
%TypeHeaderCode
#include <qmetaobject.h>
%End
public:
QMetaEnum();
const char *name() const;
bool isFlag() const;
int keyCount() const;
const char *key(int index) const;
int value(int index) const;
const char *scope() const;
int keyToValue(const char *key, bool *ok = 0) const;
%If (Qt_6_9_0 -)
const char *valueToKey(quint64 value) const;
%End
%If (- Qt_6_9_0)
const char *valueToKey(int value) const;
%End
int keysToValue(const char *keys, bool *ok = 0) const;
%If (Qt_6_9_0 -)
QByteArray valueToKeys(quint64 value) const;
%End
%If (- Qt_6_9_0)
QByteArray valueToKeys(int value) const;
%End
bool isValid() const;
bool isScoped() const;
const char *enumName() const;
%If (Qt_6_6_0 -)
QMetaType metaType() const;
%End
%If (Qt_6_9_0 -)
bool is64Bit() const;
%End
};
class QMetaProperty
{
%TypeHeaderCode
#include <qmetaobject.h>
%End
public:
QMetaProperty();
const char *name() const;
const char *typeName() const;
bool isReadable() const;
bool isWritable() const;
bool isDesignable() const;
bool isScriptable() const;
bool isStored() const;
bool isFlagType() const;
bool isEnumType() const;
QMetaEnum enumerator() const;
SIP_PYOBJECT read(const QObject *obj) const /TypeHint="Any"/;
%MethodCode
// Make use of the QMetaProperty to provide the extra information to correctly
// handle enums.
sipRes = qpycore_PyObject_FromQVariant(*sipCpp, sipCpp->read(a0));
%End
bool write(QObject *obj, const QVariant &value) const;
%MethodCode
// If it looks like we are trying to write an int to an enum then we are
// probably trying to write to an unregistered enum. Converting the int to the
// name of the corresponding key should work (although this isn't a documented
// feature).
QMetaEnum me = sipCpp->enumerator();
if (me.isValid() && a1->typeId() == QMetaType::Int)
{
QString key;
if (me.isFlag())
{
key = QString(me.valueToKeys(a1->toInt()));
}
else
{
const char *key_s = me.valueToKey(a1->toInt());
if (key_s)
{
key = QString(key_s);
}
else
{
PyErr_Format(PyExc_ValueError, "%S is not a valid enum member", a1);
sipIsErr = 1;
}
}
if (!sipIsErr)
*const_cast<QVariant *>(a1) = QVariant(key);
}
if (!sipIsErr)
sipRes = sipCpp->write(a0, *a1);
%End
bool reset(QObject *obj) const;
bool hasStdCppSet() const;
bool isValid() const;
bool isResettable() const;
bool isUser() const;
int userType() const;
bool hasNotifySignal() const;
QMetaMethod notifySignal() const;
int notifySignalIndex() const;
int propertyIndex() const;
bool isConstant() const;
bool isFinal() const;
int revision() const;
int relativePropertyIndex() const;
bool isRequired() const;
QMetaType metaType() const;
bool isBindable() const;
int typeId() const;
};
class QMetaClassInfo
{
%TypeHeaderCode
#include <qmetaobject.h>
%End
public:
QMetaClassInfo();
const char *name() const;
const char *value() const;
};
bool operator==(const QMetaMethod &m1, const QMetaMethod &m2);
bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2);

View File

@@ -0,0 +1,204 @@
// qmetatype.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMetaType
{
%TypeHeaderCode
#include <qmetatype.h>
%End
public:
enum Type
{
UnknownType,
Void,
Bool,
Int,
UInt,
LongLong,
ULongLong,
Double,
QChar,
QVariantMap,
QVariantList,
QVariantHash,
QString,
QStringList,
QByteArray,
QBitArray,
QDate,
QTime,
QDateTime,
QUrl,
QLocale,
QRect,
QRectF,
QSize,
QSizeF,
QLine,
QLineF,
QPoint,
QPointF,
LastCoreType,
FirstGuiType,
QFont,
QPixmap,
QBrush,
QColor,
QPalette,
QIcon,
QImage,
QPolygon,
QRegion,
QBitmap,
QCursor,
QSizePolicy,
QKeySequence,
QPen,
QTextLength,
QTextFormat,
QTransform,
VoidStar,
Long,
Short,
Char,
Char16,
Char32,
ULong,
UShort,
UChar,
Float,
%If (Qt_6_5_0 -)
Float16,
%End
QObjectStar,
QMatrix4x4,
QVector2D,
QVector3D,
QVector4D,
QQuaternion,
QEasingCurve,
QVariant,
QUuid,
QModelIndex,
QPolygonF,
SChar,
QRegularExpression,
QJsonValue,
QJsonObject,
QJsonArray,
QJsonDocument,
QByteArrayList,
QPersistentModelIndex,
QCborSimpleType,
QCborValue,
QCborArray,
QCborMap,
QColorSpace,
QVariantPair,
User,
};
static bool isRegistered(int type);
QMetaType();
explicit QMetaType(int type);
enum TypeFlag /BaseType=Flag/
{
NeedsConstruction,
NeedsDestruction,
PointerToQObject,
IsEnumeration,
IsUnsignedEnumeration,
IsPointer,
RelocatableType,
IsQmlList,
%If (Qt_6_2_0 -)
IsConst,
%End
%If (Qt_6_5_0 -)
NeedsCopyConstruction,
%End
%If (Qt_6_5_0 -)
NeedsMoveConstruction,
%End
};
typedef QFlags<QMetaType::TypeFlag> TypeFlags;
qsizetype sizeOf() const;
QMetaType::TypeFlags flags() const;
bool isValid() const;
bool isRegistered() const;
int id() const;
%If (Qt_6_1_0 -)
bool hasRegisteredDataStreamOperators() const;
%End
bool hasRegisteredDebugStreamOperator() const;
const char *name() const /Encoding="None"/;
qsizetype alignOf() const;
bool isEqualityComparable() const;
bool isOrdered() const;
static QMetaType fromName(QByteArrayView name);
static bool canConvert(QMetaType fromType, QMetaType toType);
static bool canView(QMetaType fromType, QMetaType toType);
%If (Qt_6_4_0 -)
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
%If (Qt_6_5_0 -)
void registerType() const;
%End
%If (Qt_6_5_0 -)
bool isDefaultConstructible() const;
%End
%If (Qt_6_5_0 -)
bool isCopyConstructible() const;
%End
%If (Qt_6_5_0 -)
bool isMoveConstructible() const;
%End
%If (Qt_6_5_0 -)
bool isDestructible() const;
%End
%If (Qt_6_6_0 -)
QMetaType underlyingType() const;
%End
private:
QMetaType(const QMetaType &);
};
%If (Qt_6_8_0 -)
bool operator==(const QMetaType &lhs, const QMetaType &rhs);
%End
%If (- Qt_6_8_0)
bool operator==(QMetaType a, QMetaType b);
%End
%If (Qt_6_8_0 -)
bool operator!=(const QMetaType &lhs, const QMetaType &rhs);
%End
%If (- Qt_6_8_0)
bool operator!=(QMetaType a, QMetaType b);
%End

View File

@@ -0,0 +1,56 @@
// qmimedata.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMimeData : public QObject
{
%TypeHeaderCode
#include <qmimedata.h>
%End
public:
QMimeData();
virtual ~QMimeData();
QList<QUrl> urls() const;
void setUrls(const QList<QUrl> &urls);
bool hasUrls() const;
QString text() const;
void setText(const QString &text);
bool hasText() const;
QString html() const;
void setHtml(const QString &html);
bool hasHtml() const;
QVariant imageData() const;
void setImageData(const QVariant &image);
bool hasImage() const;
QVariant colorData() const;
void setColorData(const QVariant &color);
bool hasColor() const;
QByteArray data(const QString &mimetype) const;
void setData(const QString &mimetype, const QByteArray &data);
virtual bool hasFormat(const QString &mimetype) const;
virtual QStringList formats() const;
void clear();
void removeFormat(const QString &mimetype);
protected:
virtual QVariant retrieveData(const QString &mimetype, QMetaType preferredType) const;
};

View File

@@ -0,0 +1,54 @@
// qmimedatabase.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMimeDatabase
{
%TypeHeaderCode
#include <qmimedatabase.h>
%End
public:
QMimeDatabase();
~QMimeDatabase();
QMimeType mimeTypeForName(const QString &nameOrAlias) const;
enum MatchMode
{
MatchDefault,
MatchExtension,
MatchContent,
};
QMimeType mimeTypeForFile(const QString &fileName, QMimeDatabase::MatchMode mode = QMimeDatabase::MatchDefault) const;
QMimeType mimeTypeForFile(const QFileInfo &fileInfo, QMimeDatabase::MatchMode mode = QMimeDatabase::MatchDefault) const;
QList<QMimeType> mimeTypesForFileName(const QString &fileName) const;
QMimeType mimeTypeForData(const QByteArray &data) const;
QMimeType mimeTypeForData(QIODevice *device) const;
QMimeType mimeTypeForUrl(const QUrl &url) const;
QMimeType mimeTypeForFileNameAndData(const QString &fileName, QIODevice *device) const;
QMimeType mimeTypeForFileNameAndData(const QString &fileName, const QByteArray &data) const;
QString suffixForFileName(const QString &fileName) const;
QList<QMimeType> allMimeTypes() const;
private:
QMimeDatabase(const QMimeDatabase &);
};

View File

@@ -0,0 +1,65 @@
// qmimetype.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMimeType
{
%TypeHeaderCode
#include <qmimetype.h>
%End
public:
QMimeType();
QMimeType(const QMimeType &other);
~QMimeType();
void swap(QMimeType &other /Constrained/);
%If (- Qt_6_8_0)
bool operator==(const QMimeType &other) const;
%End
%If (- Qt_6_8_0)
bool operator!=(const QMimeType &other) const;
%End
bool isValid() const;
bool isDefault() const;
QString name() const;
QString comment() const;
QString genericIconName() const;
QString iconName() const;
QStringList globPatterns() const;
QStringList parentMimeTypes() const;
QStringList allAncestors() const;
QStringList aliases() const;
QStringList suffixes() const;
QString preferredSuffix() const;
bool inherits(const QString &mimeTypeName) const;
QString filterString() const;
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%If (Qt_6_8_0 -)
bool operator!=(const QMimeType &lhs, const QMimeType &rhs);
%End
%If (Qt_6_8_0 -)
bool operator==(const QMimeType &lhs, const QMimeType &rhs);
%End

View File

@@ -0,0 +1,63 @@
// qmutex.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QMutex
{
%TypeHeaderCode
#include <qmutex.h>
%End
public:
QMutex();
~QMutex();
// Methods from QBasicMutex.
void lock() /ReleaseGIL/;
bool tryLock() /ReleaseGIL/;
void unlock() /ReleaseGIL/;
%If (Qt_6_6_0 -)
bool tryLock(QDeadlineTimer timeout) /ReleaseGIL/;
%End
bool tryLock(int timeout) /ReleaseGIL/;
private:
QMutex(const QMutex &);
};
class QRecursiveMutex
{
%TypeHeaderCode
#include <qmutex.h>
%End
public:
QRecursiveMutex();
~QRecursiveMutex();
void lock() /ReleaseGIL/;
%If (Qt_6_6_0 -)
bool tryLock(QDeadlineTimer) /ReleaseGIL/ [bool (QDeadlineTimer timer = {})];
%End
bool tryLock(int timeout = 0) /ReleaseGIL/;
void unlock() /ReleaseGIL/;
private:
QRecursiveMutex(const QRecursiveMutex &);
};

View File

@@ -0,0 +1,65 @@
// This is the SIP interface definition for the QMutexLocker class.
//
// In Qt6 this is a template so we wrap our own class that implements the Qt5
// API.
//
// 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 PyQtMutexLocker /PyName=QMutexLocker/
{
%TypeHeaderCode
#include "qpycore_pyqtmutexlocker.h"
%End
public:
PyQtMutexLocker(QMutex *mutex /GetWrapper/) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp = new PyQtMutexLocker(a0, a0Wrapper);
Py_END_ALLOW_THREADS
%End
PyQtMutexLocker(QRecursiveMutex *mutex /GetWrapper/) /ReleaseGIL/;
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp = new PyQtMutexLocker(a0, a0Wrapper);
Py_END_ALLOW_THREADS
%End
~PyQtMutexLocker();
SIP_PYOBJECT mutex() /TypeHint="Union[QMutex, QRecursiveMutex]"/;
void unlock() /ReleaseGIL/;
void relock() /ReleaseGIL/;
SIP_PYOBJECT __enter__();
%MethodCode
// Just return a reference to self.
sipRes = sipSelf;
Py_INCREF(sipRes);
%End
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
%MethodCode
sipCpp->unlock();
%End
private:
PyQtMutexLocker(const PyQtMutexLocker &);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
// qnumeric.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
%ModuleCode
#include <qnumeric.h>
%End
bool qIsInf(double d);
bool qIsFinite(double d);
bool qIsNaN(double d);
double qInf();
double qSNaN();
double qQNaN();
quint64 qFloatDistance(double a, double b);
%If (Qt_6_5_0 -)
double qAbs(const double &t);
%End
%If (Qt_6_5_0 -)
int qRound(double d);
%End
%If (Qt_6_5_0 -)
qint64 qRound64(double d);
%End
%If (Qt_6_5_0 -)
bool qFuzzyCompare(double p1, double p2);
%End
%If (Qt_6_5_0 -)
bool qFuzzyIsNull(double d);
%End

View File

@@ -0,0 +1,647 @@
// qobject.sip generated by MetaSIP
//
// This file is part of the QtCore 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.
typedef QList<QObject *> QObjectList;
class QObject /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qobject.h>
%End
%TypeCode
// This is needed by the tr() handwritten implementation.
#include <qcoreapplication.h>
// These are the helper functions for QObject::findChild() and
// QObject::findChildren.
// Wrap the given type in a 1-tuple.
static PyObject *qtcore_type_to_tuple(PyObject *type)
{
PyObject *tuple = PyTuple_New(1);
if (tuple)
{
Py_INCREF(type);
PyTuple_SetItem(tuple, 0, type);
}
return tuple;
}
// Check all elements of a given tuple are type objects and return a new
// reference to the tuple if so.
static PyObject *qtcore_check_tuple_types(PyObject *types)
{
for (Py_ssize_t i = 0; i < PyTuple_Size(types); ++i)
if (!PyObject_TypeCheck(PyTuple_GetItem(types, i), &PyType_Type))
{
PyErr_SetString(PyExc_TypeError,
"all elements of the types argument must be type objects");
return 0;
}
Py_INCREF(types);
return types;
}
// Do the main work of finding a child.
static PyObject *qtcore_do_find_child(const QObject *parent, PyObject *types, const QString &name, Qt::FindChildOptions options)
{
const QObjectList &children = parent->children();
int i;
for (i = 0; i < children.size(); ++i)
{
QObject *obj = children.at(i);
PyObject *pyo = sipConvertFromType(obj, sipType_QObject, 0);
if (!pyo)
return 0;
// Allow for proxies.
QObject *resolved = reinterpret_cast<QObject *>(sipGetAddress((sipSimpleWrapper *)pyo));
if (name.isNull() || resolved->objectName() == name)
for (Py_ssize_t t = 0; t < PyTuple_Size(types); ++t)
if (PyType_IsSubtype(Py_TYPE(pyo), (PyTypeObject *)PyTuple_GetItem(types, t)))
return pyo;
Py_DECREF(pyo);
}
if (options == Qt::FindChildrenRecursively)
for (i = 0; i < children.size(); ++i)
{
PyObject *pyo = qtcore_do_find_child(children.at(i), types, name, options);
if (pyo != Py_None)
return pyo;
Py_DECREF(pyo);
}
Py_INCREF(Py_None);
return Py_None;
}
// Find a child that is one of a number of types and with an optional name.
static PyObject *qtcore_FindChild(const QObject *parent, PyObject *types, const QString &name, Qt::FindChildOptions options)
{
// Check that the types checking was successful.
if (!types)
return 0;
PyObject *child = qtcore_do_find_child(parent, types, name, options);
Py_DECREF(types);
return child;
}
// Do the main work of finding the children with a string name.
static bool qtcore_do_find_children(const QObject *parent, PyObject *types, const QString &name, Qt::FindChildOptions options, PyObject *list)
{
const QObjectList &children = parent->children();
int i;
for (i = 0; i < children.size(); ++i)
{
QObject *obj = children.at(i);
PyObject *pyo = sipConvertFromType(obj, sipType_QObject, 0);
if (!pyo)
return false;
// Allow for proxies.
QObject *resolved = reinterpret_cast<QObject *>(sipGetAddress((sipSimpleWrapper *)pyo));
if (name.isNull() || resolved->objectName() == name)
for (Py_ssize_t t = 0; t < PyTuple_Size(types); ++t)
if (PyType_IsSubtype(Py_TYPE(pyo), (PyTypeObject *)PyTuple_GetItem(types, t)))
if (PyList_Append(list, pyo) < 0)
{
Py_DECREF(pyo);
return false;
}
Py_DECREF(pyo);
if (options == Qt::FindChildrenRecursively)
{
bool ok = qtcore_do_find_children(obj, types, name, options, list);
if (!ok)
return false;
}
}
return true;
}
// Find a child that is one of a number of types and with an optional string
// name.
static PyObject *qtcore_FindChildren(const QObject *parent, PyObject *types, const QString &name, Qt::FindChildOptions options)
{
// Check that the types checking was successful.
if (!types)
return 0;
PyObject *list = PyList_New(0);
if (list)
if (!qtcore_do_find_children(parent, types, name, options, list))
Py_DECREF(list);
Py_DECREF(types);
return list;
}
// Do the main work of finding the children with a QRegularExpression name.
static bool qtcore_do_find_children(const QObject *parent, PyObject *types, const QRegularExpression &re, Qt::FindChildOptions options, PyObject *list)
{
const QObjectList &children = parent->children();
int i;
for (i = 0; i < children.size(); ++i)
{
QObject *obj = children.at(i);
PyObject *pyo = sipConvertFromType(obj, sipType_QObject, 0);
if (!pyo)
return false;
QRegularExpressionMatch m = re.match(obj->objectName());
if (m.hasMatch())
for (Py_ssize_t t = 0; t < PyTuple_Size(types); ++t)
if (PyType_IsSubtype(Py_TYPE(pyo), (PyTypeObject *)PyTuple_GetItem(types, t)))
if (PyList_Append(list, pyo) < 0)
{
Py_DECREF(pyo);
return false;
}
Py_DECREF(pyo);
if (options == Qt::FindChildrenRecursively)
{
bool ok = qtcore_do_find_children(obj, types, re, options, list);
if (!ok)
return false;
}
}
return true;
}
// Find a child that is one of a number of types and with an optional
// QRegularExpression name.
static PyObject *qtcore_FindChildren(const QObject *parent, PyObject *types, const QRegularExpression &re, Qt::FindChildOptions options)
{
// Check that the types checking was successful.
if (!types)
return 0;
PyObject *list = PyList_New(0);
if (list)
if (!qtcore_do_find_children(parent, types, re, options, list))
Py_DECREF(list);
Py_DECREF(types);
return list;
}
%End
%FinalisationCode
return qpycore_qobject_finalisation(sipSelf, sipCpp, sipKwds, sipUnused);
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QAbstractAnimation, &sipType_QAbstractAnimation, 24, 1},
{sipName_QAbstractEventDispatcher, &sipType_QAbstractEventDispatcher, -1, 2},
{sipName_QAbstractItemModel, &sipType_QAbstractItemModel, 30, 3},
{sipName_QIODevice, &sipType_QIODevice, 39, 4},
{sipName_QCoreApplication, &sipType_QCoreApplication, -1, 5},
{sipName_QEventLoop, &sipType_QEventLoop, -1, 6},
{sipName_QFileSelector, &sipType_QFileSelector, -1, 7},
{sipName_QFileSystemWatcher, &sipType_QFileSystemWatcher, -1, 8},
{sipName_QItemSelectionModel, &sipType_QItemSelectionModel, -1, 9},
{sipName_QLibrary, &sipType_QLibrary, -1, 10},
{sipName_QMimeData, &sipType_QMimeData, -1, 11},
{sipName_QObjectCleanupHandler, &sipType_QObjectCleanupHandler, -1, 12},
{sipName_QPluginLoader, &sipType_QPluginLoader, -1, 13},
#if QT_VERSION >= 0x060a00
{sipName_QPyAbstractRange, &sipType_QPyAbstractRange, 45, 14},
#else
{0, 0, 45, 14},
#endif
{sipName_QSettings, &sipType_QSettings, -1, 15},
{sipName_QSharedMemory, &sipType_QSharedMemory, -1, 16},
{sipName_QSignalMapper, &sipType_QSignalMapper, -1, 17},
{sipName_QSocketNotifier, &sipType_QSocketNotifier, -1, 18},
{sipName_QThread, &sipType_QThread, -1, 19},
{sipName_QThreadPool, &sipType_QThreadPool, -1, 20},
{sipName_QTimeLine, &sipType_QTimeLine, -1, 21},
{sipName_QTimer, &sipType_QTimer, -1, 22},
{sipName_QTranslator, &sipType_QTranslator, -1, 23},
#if defined(Q_OS_WIN)
{sipName_QWinEventNotifier, &sipType_QWinEventNotifier, -1, -1},
#else
{0, 0, -1, -1},
#endif
{sipName_QAnimationGroup, &sipType_QAnimationGroup, 27, 25},
{sipName_QPauseAnimation, &sipType_QPauseAnimation, -1, 26},
{sipName_QVariantAnimation, &sipType_QVariantAnimation, 29, -1},
{sipName_QParallelAnimationGroup, &sipType_QParallelAnimationGroup, -1, 28},
{sipName_QSequentialAnimationGroup, &sipType_QSequentialAnimationGroup, -1, -1},
{sipName_QPropertyAnimation, &sipType_QPropertyAnimation, -1, -1},
{sipName_QAbstractListModel, &sipType_QAbstractListModel, 35, 31},
{sipName_QAbstractProxyModel, &sipType_QAbstractProxyModel, 36, 32},
{sipName_QAbstractTableModel, &sipType_QAbstractTableModel, -1, 33},
{sipName_QConcatenateTablesProxyModel, &sipType_QConcatenateTablesProxyModel, -1, 34},
#if QT_VERSION >= 0x060a00
{sipName_QRangeModel, &sipType_QRangeModel, -1, -1},
#else
{0, 0, -1, -1},
#endif
{sipName_QStringListModel, &sipType_QStringListModel, -1, -1},
{sipName_QIdentityProxyModel, &sipType_QIdentityProxyModel, -1, 37},
{sipName_QSortFilterProxyModel, &sipType_QSortFilterProxyModel, -1, 38},
{sipName_QTransposeProxyModel, &sipType_QTransposeProxyModel, -1, -1},
{sipName_QBuffer, &sipType_QBuffer, -1, 40},
{sipName_QFileDevice, &sipType_QFileDevice, 42, 41},
#if !defined(QT_NO_PROCESS)
{sipName_QProcess, &sipType_QProcess, -1, -1},
#else
{0, 0, -1, -1},
#endif
{sipName_QFile, &sipType_QFile, 44, 43},
{sipName_QSaveFile, &sipType_QSaveFile, -1, -1},
{sipName_QTemporaryFile, &sipType_QTemporaryFile, -1, -1},
#if QT_VERSION >= 0x060a00
{sipName_QPySequenceRange, &sipType_QPySequenceRange, -1, 46},
#else
{0, 0, -1, 46},
#endif
#if QT_VERSION >= 0x060a00
{sipName_QPyTableRange, &sipType_QPyTableRange, -1, -1},
#else
{0, 0, -1, -1},
#endif
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
%GCTraverseCode
// Traverse any saved slots we might be connected to.
sipRes = qpycore_visitSlotProxies(sipCpp, sipVisit, sipArg);
%End
%GCClearCode
// Clear any saved slots we might be connected to.
sipRes = qpycore_clearSlotProxies(sipCpp);
%End
public:
static const QMetaObject staticMetaObject {
%GetCode
sipPy = qpycore_qobject_staticmetaobject(sipPyType);
%End
};
const QMetaObject *metaObject() const;
explicit QObject(QObject *parent /TransferThis/ = 0);
virtual ~QObject();
void pyqtConfigure(SIP_PYOBJECT) /NoArgParser/;
%Docstring
QObject.pyqtConfigure(...)
Each keyword argument is either the name of a Qt property or a Qt signal.
For properties the property is set to the given value which should be of an
appropriate type.
For signals the signal is connected to the given value which should be a
callable.
%End
%MethodCode
return qpycore_pyqtconfigure(sipSelf, sipArgs, sipKwds);
%End
SIP_PYOBJECT __getattr__(const char *name /Encoding="UTF-8"/) const /NoTypeHint/;
%MethodCode
sipRes = qpycore_qobject_getattr(sipCpp, sipSelf, a0);
%End
virtual bool event(QEvent *);
virtual bool eventFilter(QObject *, QEvent *);
static QString tr(const char *sourceText /Encoding="UTF-8"/, const char *disambiguation = 0, int n = -1);
%MethodCode
sipRes = new QString(QCoreApplication::translate(sipPyTypeName((PyTypeObject *)sipSelf), a0, a1, a2));
%End
SIP_PYOBJECT findChild(SIP_PYTYPE type /TypeHint="Type[QObjectT]"/, const QString &name = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="QObjectT"/;
%MethodCode
sipRes = qtcore_FindChild(sipCpp, qtcore_type_to_tuple(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
SIP_PYOBJECT findChild(SIP_PYTUPLE types /TypeHint="Tuple[Type[QObjectT], ...]", TypeHintValue="()"/, const QString &name = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="QObjectT"/;
%MethodCode
sipRes = qtcore_FindChild(sipCpp, qtcore_check_tuple_types(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
SIP_PYLIST findChildren(SIP_PYTYPE type /TypeHint="Type[QObjectT]"/, const QString &name = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="List[QObjectT]"/;
%MethodCode
sipRes = qtcore_FindChildren(sipCpp, qtcore_type_to_tuple(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
SIP_PYLIST findChildren(SIP_PYTUPLE types /TypeHint="Tuple[Type[QObjectT], ...]", TypeHintValue="()"/, const QString &name = QString(), Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="List[QObjectT]"/;
%MethodCode
sipRes = qtcore_FindChildren(sipCpp, qtcore_check_tuple_types(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
SIP_PYLIST findChildren(SIP_PYTYPE type /TypeHint="Type[QObjectT]"/, const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="List[QObjectT]"/;
%MethodCode
sipRes = qtcore_FindChildren(sipCpp, qtcore_type_to_tuple(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
SIP_PYLIST findChildren(SIP_PYTUPLE types /TypeHint="Tuple[Type[QObjectT], ...]", TypeHintValue="()"/, const QRegularExpression &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const /TypeHint="List[QObjectT]"/;
%MethodCode
sipRes = qtcore_FindChildren(sipCpp, qtcore_check_tuple_types(a0), *a1, *a2);
if (!sipRes)
sipIsErr = 1;
%End
QString objectName() const;
%If (Qt_6_4_0 -)
void setObjectName(QAnyStringView name);
%End
%If (- Qt_6_4_0)
void setObjectName(const QString &name);
%End
bool isWidgetType() const;
bool isWindowType() const;
bool signalsBlocked() const;
bool blockSignals(bool b);
QThread *thread() const;
void moveToThread(QThread *thread);
int startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer);
void killTimer(int id);
const QObjectList &children() const;
void setParent(QObject * /TransferThis/);
void installEventFilter(QObject *);
void removeEventFilter(QObject *);
void dumpObjectInfo() const;
void dumpObjectTree() const;
QList<QByteArray> dynamicPropertyNames() const;
bool setProperty(const char *name, const QVariant &value);
QVariant property(const char *name) const;
signals:
void destroyed(QObject *object = 0);
void objectNameChanged(const QString &objectName);
public:
QObject *parent() const;
bool inherits(const char *classname) const;
public slots:
void deleteLater() /TransferThis/;
protected:
QObject *sender() const /ReleaseGIL/;
%MethodCode
// sender() must be called without the GIL to avoid possible deadlocks between
// the GIL and Qt's internal thread data mutex.
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipRes = sipCpp->sender();
#else
sipRes = sipCpp->sipProtect_sender();
#endif
Py_END_ALLOW_THREADS
if (!sipRes)
{
typedef QObject *(*qtcore_qobject_sender_t)();
static qtcore_qobject_sender_t qtcore_qobject_sender = 0;
if (!qtcore_qobject_sender)
{
qtcore_qobject_sender = (qtcore_qobject_sender_t)sipImportSymbol("qtcore_qobject_sender");
Q_ASSERT(qtcore_qobject_sender);
}
sipRes = qtcore_qobject_sender();
}
%End
int receivers(SIP_PYOBJECT signal /TypeHint="PYQT_SIGNAL"/) const [int (const char *signal)];
%MethodCode
// We need to handle the signal object. Import the helper if it hasn't already
// been done.
typedef sipErrorState (*pyqt6_get_signal_signature_t)(PyObject *, const QObject *, const QByteArray &);
static pyqt6_get_signal_signature_t pyqt6_get_signal_signature = 0;
if (!pyqt6_get_signal_signature)
{
pyqt6_get_signal_signature = (pyqt6_get_signal_signature_t)sipImportSymbol("pyqt6_get_signal_signature");
Q_ASSERT(pyqt6_get_signal_signature);
}
QByteArray signal_signature;
#if defined(SIP_PROTECTED_IS_PUBLIC)
if ((sipError = pyqt6_get_signal_signature(a0, sipCpp, signal_signature)) == sipErrorNone)
{
sipRes = sipCpp->receivers(signal_signature.constData());
}
#else
if ((sipError = pyqt6_get_signal_signature(a0, static_cast<const QObject *>(sipCpp), signal_signature)) == sipErrorNone)
{
sipRes = sipCpp->sipProtect_receivers(signal_signature.constData());
}
#endif
else if (sipError == sipErrorContinue)
{
sipError = sipBadCallableArg(0, a0);
}
%End
virtual void timerEvent(QTimerEvent *);
virtual void childEvent(QChildEvent *);
virtual void customEvent(QEvent *);
virtual void connectNotify(const QMetaMethod &signal);
virtual void disconnectNotify(const QMetaMethod &signal);
int senderSignalIndex() const;
bool isSignalConnected(const QMetaMethod &signal) const;
public:
static bool disconnect(const QMetaObject::Connection &);
SIP_PYOBJECT disconnect() const /TypeHint=""/;
%MethodCode
sipRes = qpycore_qobject_disconnect(sipCpp);
%End
%If (Qt_6_4_0 -)
bool isQuickItemType() const;
%End
private:
QObject(const QObject &);
};
SIP_PYOBJECT pyqtClassInfo(const char *, const char *) /NoArgParser, TypeHint=""/;
%MethodCode
return qpycore_pyqtClassInfo(sipArgs, sipKwds);
%End
SIP_PYOBJECT pyqtEnum(SIP_PYENUM = 0) /TypeHint=""/;
%MethodCode
sipRes = qpycore_pyqtEnum(a0);
%End
SIP_PYOBJECT pyqtSlot(... types, const char *name = 0, const char *result = 0) /NoArgParser, NoTypeHint/;
%Docstring
@pyqtSlot(*types, name: typing.Optional[str], result: typing.Optional[str])
This is a decorator applied to Python methods of a QObject that marks them
as Qt slots.
The non-keyword arguments are the types of the slot arguments and each may
be a Python type object or a string specifying a C++ type.
name is the name of the slot and defaults to the name of the method.
result is type of the value returned by the slot.
%End
%MethodCode
return qpycore_pyqtslot(sipArgs, sipKwds);
%End
SIP_PYOBJECT QT_TR_NOOP(SIP_PYOBJECT /TypeHint="str"/) /TypeHint="str"/;
%MethodCode
Py_INCREF(a0);
sipRes = a0;
%End
SIP_PYOBJECT QT_TRANSLATE_NOOP(SIP_PYOBJECT /TypeHint="str"/, SIP_PYOBJECT /TypeHint="str"/) /TypeHint="str"/;
%MethodCode
Py_INCREF(a1);
sipRes = a1;
%End
class QSignalBlocker
{
%TypeHeaderCode
#include <qobject.h>
%End
public:
explicit QSignalBlocker(QObject *o);
~QSignalBlocker();
%If (Qt_6_7_0 -)
void dismiss();
%End
void reblock();
void unblock();
SIP_PYOBJECT __enter__();
%MethodCode
// Just return a reference to self.
sipRes = sipSelf;
Py_INCREF(sipRes);
%End
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
%MethodCode
sipCpp->unblock();
%End
private:
QSignalBlocker(const QSignalBlocker &);
};
%ModuleHeaderCode
#include "qpycore_api.h"
%End
%InitialisationCode
qpycore_init();
%End
%PostInitialisationCode
qpycore_post_init(sipModuleDict);
%End

View File

@@ -0,0 +1,36 @@
// qobjectcleanuphandler.sip generated by MetaSIP
//
// This file is part of the QtCore 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 QObjectCleanupHandler : public QObject
{
%TypeHeaderCode
#include <qobjectcleanuphandler.h>
%End
public:
QObjectCleanupHandler();
virtual ~QObjectCleanupHandler();
QObject *add(QObject *object);
void remove(QObject *object);
bool isEmpty() const;
void clear();
};

Some files were not shown because too many files have changed in this diff Show More