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

View File

@@ -0,0 +1,143 @@
// QtGuimod.sip generated by MetaSIP
//
// This file is part of the QtGui 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.QtGui, 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 qabstractfileiconprovider.sip
%Include qabstracttextdocumentlayout.sip
%Include qaccessibilityhints.sip
%Include qaction.sip
%Include qactiongroup.sip
%Include qbackingstore.sip
%Include qbitmap.sip
%Include qcolor.sip
%Include qbrush.sip
%Include qclipboard.sip
%Include qcolorspace.sip
%Include qcolortransform.sip
%Include qcursor.sip
%Include qdesktopservices.sip
%Include qdrag.sip
%Include qevent.sip
%Include qeventpoint.sip
%Include qfilesystemmodel.sip
%Include qfont.sip
%Include qfontdatabase.sip
%Include qfontinfo.sip
%Include qfontmetrics.sip
%Include qfontvariableaxis.sip
%Include qgenericmatrix.sip
%Include qglyphrun.sip
%Include qguiapplication.sip
%Include qicon.sip
%Include qiconengine.sip
%Include qimage.sip
%Include qimageiohandler.sip
%Include qimagereader.sip
%Include qimagewriter.sip
%Include qinputdevice.sip
%Include qinputmethod.sip
%Include qkeysequence.sip
%Include qmatrix4x4.sip
%Include qmovie.sip
%Include qoffscreensurface.sip
%Include qopenglcontext.sip
%Include qpagedpaintdevice.sip
%Include qpagelayout.sip
%Include qpageranges.sip
%Include qpagesize.sip
%Include qpaintdevice.sip
%Include qpaintdevicewindow.sip
%Include qpaintengine.sip
%Include qpainter.sip
%Include qpainterpath.sip
%Include qpainterstateguard.sip
%Include qpalette.sip
%Include qpdfoutputintent.sip
%Include qpdfwriter.sip
%Include qpen.sip
%Include qpicture.sip
%Include qpixelformat.sip
%Include qpixmap.sip
%Include qpixmapcache.sip
%Include qpointingdevice.sip
%Include qpolygon.sip
%Include qquaternion.sip
%Include qrasterwindow.sip
%Include qrawfont.sip
%Include qregion.sip
%Include qrgba64.sip
%Include qrgb.sip
%Include qscreen.sip
%Include qsessionmanager.sip
%Include qshortcut.sip
%Include qstandarditemmodel.sip
%Include qstatictext.sip
%Include qstylehints.sip
%Include qsurface.sip
%Include qsurfaceformat.sip
%Include qsyntaxhighlighter.sip
%Include qtextcursor.sip
%Include qtextdocument.sip
%Include qtextdocumentfragment.sip
%Include qtextdocumentwriter.sip
%Include qtextformat.sip
%Include qtextlayout.sip
%Include qtextlist.sip
%Include qtextobject.sip
%Include qtextoption.sip
%Include qtexttable.sip
%Include qtransform.sip
%Include qundogroup.sip
%Include qundostack.sip
%Include qutimimeconverter.sip
%Include qvalidator.sip
%Include qvectornd.sip
%Include qwindow.sip
%Include qwindowdefs.sip
%Include opengl_types.sip
%Include qpygui_qlist.sip
%Include qpygui_native_interface.sip
%Include qpygui_vulkan.sip

View File

@@ -0,0 +1,43 @@
// This implements the typedefs for the OpenGL data 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 (PyQt_OpenGL)
typedef char GLchar;
typedef qint8 GLbyte;
typedef quint8 GLubyte;
typedef quint8 GLboolean;
typedef qint16 GLshort;
typedef quint16 GLushort;
typedef qint32 GLint;
typedef qint32 GLsizei;
typedef quint32 GLuint;
typedef quint32 GLenum;
typedef quint32 GLbitfield;
%If (!PyQt_OpenGL_ES2)
typedef quint64 GLuint64; // This is in OpenGL ES v3.
typedef double GLdouble;
%End
typedef float GLfloat;
typedef float GLclampf;
typedef long GLintptr;
typedef long GLsizeiptr;
%End

View File

@@ -0,0 +1,57 @@
// qabstractfileiconprovider.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QAbstractFileIconProvider
{
%TypeHeaderCode
#include <qabstractfileiconprovider.h>
%End
public:
enum IconType
{
Computer,
Desktop,
Trashcan,
Network,
Drive,
Folder,
File,
};
enum Option /BaseType=Flag/
{
DontUseCustomDirectoryIcons,
};
typedef QFlags<QAbstractFileIconProvider::Option> Options;
QAbstractFileIconProvider();
virtual ~QAbstractFileIconProvider();
virtual QIcon icon(QAbstractFileIconProvider::IconType) const;
virtual QIcon icon(const QFileInfo &) const;
virtual QString type(const QFileInfo &) const;
virtual void setOptions(QAbstractFileIconProvider::Options);
virtual QAbstractFileIconProvider::Options options() const;
private:
QAbstractFileIconProvider(const QAbstractFileIconProvider &);
};

View File

@@ -0,0 +1,99 @@
// qabstracttextdocumentlayout.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QAbstractTextDocumentLayout : public QObject
{
%TypeHeaderCode
#include <qabstracttextdocumentlayout.h>
%End
public:
explicit QAbstractTextDocumentLayout(QTextDocument *doc);
virtual ~QAbstractTextDocumentLayout();
struct Selection
{
%TypeHeaderCode
#include <qabstracttextdocumentlayout.h>
%End
QTextCursor cursor;
QTextCharFormat format;
};
struct PaintContext
{
%TypeHeaderCode
#include <qabstracttextdocumentlayout.h>
%End
PaintContext();
int cursorPosition;
QPalette palette;
QRectF clip;
QList<QAbstractTextDocumentLayout::Selection> selections;
};
virtual void draw(QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context) = 0;
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const = 0;
QString anchorAt(const QPointF &pos) const;
virtual int pageCount() const = 0;
virtual QSizeF documentSize() const = 0;
virtual QRectF frameBoundingRect(QTextFrame *frame) const = 0;
virtual QRectF blockBoundingRect(const QTextBlock &block) const = 0;
void setPaintDevice(QPaintDevice *device);
QPaintDevice *paintDevice() const;
QTextDocument *document() const;
void registerHandler(int objectType, QObject *component);
void unregisterHandler(int objectType, QObject *component = 0);
QTextObjectInterface *handlerForObject(int objectType) const;
signals:
void update(const QRectF &rect = QRectF(0., 0., 1.0E+9, 1.0E+9));
void documentSizeChanged(const QSizeF &newSize);
void pageCountChanged(int newPages);
void updateBlock(const QTextBlock &block);
protected:
virtual void documentChanged(int from, int charsRemoved, int charsAdded) = 0;
virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format);
virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format);
virtual void drawInlineObject(QPainter *painter, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextFormat &format);
QTextCharFormat format(int pos);
public:
QString imageAt(const QPointF &pos) const;
QTextFormat formatAt(const QPointF &pos) const;
QTextBlock blockWithMarkerAt(const QPointF &pos) const;
};
class QTextObjectInterface /Mixin,PyQtInterface="org.qt-project.Qt.QTextObjectInterface"/
{
%TypeHeaderCode
#include <qabstracttextdocumentlayout.h>
%End
public:
virtual ~QTextObjectInterface();
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
};

View File

@@ -0,0 +1,41 @@
// qaccessibilityhints.sip generated by MetaSIP
//
// This file is part of the QtGui 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_10_0 -)
class QAccessibilityHints : public QObject
{
%TypeHeaderCode
#include <qaccessibilityhints.h>
%End
public:
explicit QAccessibilityHints(QObject *parent /TransferThis/ = 0);
virtual ~QAccessibilityHints();
Qt::ContrastPreference contrastPreference() const;
void contrastPreferenceChanged(Qt::ContrastPreference contrastPreference);
protected:
virtual bool event(QEvent *event);
};
%End

View File

@@ -0,0 +1,154 @@
// qaction.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QMenu /External/;
class QAction : public QObject
{
%TypeHeaderCode
#include <qaction.h>
%End
public:
explicit QAction(QObject *parent /TransferThis/ = 0);
QAction(const QString &text, QObject *parent /TransferThis/ = 0);
QAction(const QIcon &icon, const QString &text, QObject *parent /TransferThis/ = 0);
virtual ~QAction();
void setActionGroup(QActionGroup *group /KeepReference/);
QActionGroup *actionGroup() const;
void setIcon(const QIcon &icon);
QIcon icon() const;
void setText(const QString &text);
QString text() const;
void setIconText(const QString &text);
QString iconText() const;
void setToolTip(const QString &tip);
QString toolTip() const;
void setStatusTip(const QString &statusTip);
QString statusTip() const;
void setWhatsThis(const QString &what);
QString whatsThis() const;
void setSeparator(bool b);
bool isSeparator() const;
void setShortcut(const QKeySequence &shortcut);
QKeySequence shortcut() const;
void setShortcutContext(Qt::ShortcutContext context);
Qt::ShortcutContext shortcutContext() const;
void setFont(const QFont &font);
QFont font() const;
void setCheckable(bool);
bool isCheckable() const;
QVariant data() const;
void setData(const QVariant &var);
bool isChecked() const;
bool isEnabled() const;
bool isVisible() const;
enum ActionEvent
{
Trigger,
Hover,
};
void activate(QAction::ActionEvent event);
bool showStatusText(QObject *object = 0);
protected:
virtual bool event(QEvent *);
public slots:
void trigger();
void hover();
void setChecked(bool);
void toggle();
void setEnabled(bool);
void setDisabled(bool b);
void setVisible(bool);
signals:
void changed();
void triggered(bool checked = false);
void hovered();
void toggled(bool);
public:
enum MenuRole
{
NoRole,
TextHeuristicRole,
ApplicationSpecificRole,
AboutQtRole,
AboutRole,
PreferencesRole,
QuitRole,
};
void setShortcuts(const QList<QKeySequence> &shortcuts);
void setShortcuts(QKeySequence::StandardKey);
QList<QKeySequence> shortcuts() const;
void setAutoRepeat(bool);
bool autoRepeat() const;
void setMenuRole(QAction::MenuRole menuRole);
QAction::MenuRole menuRole() const;
QMenu *menu() const;
%MethodCode
typedef QMenu *(*pyqt6_qtgui_qaction_menu_t)(const QAction *);
pyqt6_qtgui_qaction_menu_t pyqt6_qtgui_qaction_menu = (pyqt6_qtgui_qaction_menu_t)sipImportSymbol("pyqt6_qaction_menu");
sipRes = (pyqt6_qtgui_qaction_menu ? pyqt6_qtgui_qaction_menu(sipCpp) : SIP_NULLPTR);
%End
void setMenu(QMenu *menu);
%MethodCode
typedef void *(*pyqt6_qtgui_qaction_set_menu_t)(QAction *, QMenu *);
pyqt6_qtgui_qaction_set_menu_t pyqt6_qtgui_qaction_set_menu = (pyqt6_qtgui_qaction_set_menu_t)sipImportSymbol("pyqt6_qaction_set_menu");
if (pyqt6_qtgui_qaction_set_menu)
pyqt6_qtgui_qaction_set_menu(sipCpp, a0);
%End
void setIconVisibleInMenu(bool visible);
bool isIconVisibleInMenu() const;
enum Priority
{
LowPriority,
NormalPriority,
HighPriority,
};
void setPriority(QAction::Priority priority);
QAction::Priority priority() const;
void setShortcutVisibleInContextMenu(bool show);
bool isShortcutVisibleInContextMenu() const;
QList<QObject *> associatedObjects() const;
public slots:
void resetEnabled();
signals:
void enabledChanged(bool enabled);
void checkableChanged(bool checkable);
void visibleChanged();
};

View File

@@ -0,0 +1,61 @@
// qactiongroup.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QActionGroup : public QObject
{
%TypeHeaderCode
#include <qactiongroup.h>
%End
public:
explicit QActionGroup(QObject *parent /TransferThis/);
virtual ~QActionGroup();
QAction *addAction(QAction *a /Transfer/);
QAction *addAction(const QString &text) /Transfer/;
QAction *addAction(const QIcon &icon, const QString &text) /Transfer/;
void removeAction(QAction *a /TransferBack/);
QList<QAction *> actions() const;
QAction *checkedAction() const;
bool isExclusive() const;
bool isEnabled() const;
bool isVisible() const;
enum class ExclusionPolicy
{
None,
Exclusive,
ExclusiveOptional,
};
QActionGroup::ExclusionPolicy exclusionPolicy() const;
public slots:
void setEnabled(bool);
void setDisabled(bool b);
void setVisible(bool);
void setExclusive(bool);
void setExclusionPolicy(QActionGroup::ExclusionPolicy policy);
signals:
void triggered(QAction *);
void hovered(QAction *);
};

View File

@@ -0,0 +1,43 @@
// qbackingstore.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QBackingStore /NoDefaultCtors/
{
%TypeHeaderCode
#include <qbackingstore.h>
%End
public:
explicit QBackingStore(QWindow *window);
~QBackingStore();
QWindow *window() const;
QPaintDevice *paintDevice();
void flush(const QRegion &region, QWindow *window = 0, const QPoint &offset = QPoint());
void resize(const QSize &size);
QSize size() const;
bool scroll(const QRegion &area, int dx, int dy);
void beginPaint(const QRegion &);
void endPaint();
void setStaticContents(const QRegion &region);
QRegion staticContents() const;
bool hasStaticContents() const;
};

View File

@@ -0,0 +1,51 @@
// qbitmap.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QBitmap : public QPixmap
{
%TypeHeaderCode
#include <qbitmap.h>
%End
public:
QBitmap();
QBitmap(int w, int h);
explicit QBitmap(const QSize &);
QBitmap(const QString &fileName, const char *format = 0);
QBitmap(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QBitmap>())
sipCpp = new sipQBitmap(a0->value<QBitmap>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
%If (Qt_6_3_0 -)
virtual ~QBitmap();
%End
void clear();
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
static QBitmap fromPixmap(const QPixmap &pixmap);
static QBitmap fromData(const QSize &size, const uchar *bits, QImage::Format format = QImage::Format_MonoLSB);
QBitmap transformed(const QTransform &matrix) const;
void swap(QBitmap &other /Constrained/);
};

View File

@@ -0,0 +1,447 @@
// qbrush.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QBrush /TypeHintIn="Union[QBrush, QColor, QGradient]"/
{
%TypeHeaderCode
#include <qbrush.h>
%End
%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// QColor or a QGradient to be used whenever a QBrush is expected. Note that
// SIP must process QColor before QBrush so that the former's QVariant cast
// operator is applied before the latter's.
if (sipIsErr == NULL)
return (sipCanConvertToType(sipPy, sipType_QBrush, SIP_NO_CONVERTORS) ||
sipCanConvertToType(sipPy, sipType_QColor, 0) ||
sipCanConvertToType(sipPy, sipType_QGradient, 0));
if (sipCanConvertToType(sipPy, sipType_QBrush, SIP_NO_CONVERTORS))
{
*sipCppPtr = reinterpret_cast<QBrush *>(sipConvertToType(sipPy, sipType_QBrush, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
}
int state;
if (sipCanConvertToType(sipPy, sipType_QColor, 0))
{
QColor *c = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, 0, 0, &state, sipIsErr));
if (*sipIsErr)
{
sipReleaseType(c, sipType_QColor, state);
return 0;
}
*sipCppPtr = new QBrush(*c);
sipReleaseType(c, sipType_QColor, state);
return sipGetState(sipTransferObj);
}
QGradient *g = reinterpret_cast<QGradient *>(sipConvertToType(sipPy, sipType_QGradient, 0, 0, &state, sipIsErr));
if (*sipIsErr)
{
sipReleaseType(g, sipType_QGradient, state);
return 0;
}
*sipCppPtr = new QBrush(*g);
sipReleaseType(g, sipType_QGradient, state);
return sipGetState(sipTransferObj);
%End
public:
QBrush();
QBrush(Qt::BrushStyle bs);
QBrush(const QColor &color, Qt::BrushStyle style = Qt::SolidPattern);
QBrush(const QColor &color, const QPixmap &pixmap);
QBrush(const QPixmap &pixmap);
QBrush(const QImage &image);
QBrush(const QBrush &brush);
QBrush(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QBrush>())
sipCpp = new QBrush(a0->value<QBrush>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QBrush();
void setStyle(Qt::BrushStyle);
QPixmap texture() const;
void setTexture(const QPixmap &pixmap);
void setColor(const QColor &color);
const QGradient *gradient() const;
bool isOpaque() const;
bool operator==(const QBrush &b) const;
bool operator!=(const QBrush &b) const;
void setColor(Qt::GlobalColor acolor);
Qt::BrushStyle style() const;
const QColor &color() const;
void setTextureImage(const QImage &image);
QImage textureImage() const;
void setTransform(const QTransform &);
QTransform transform() const;
void swap(QBrush &other /Constrained/);
};
QDataStream &operator>>(QDataStream &, QBrush & /Constrained/) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &, const QBrush & /Constrained/) /ReleaseGIL/;
typedef QList<std::pair<qreal, QColor>> QGradientStops;
class QGradient
{
%TypeHeaderCode
#include <qbrush.h>
%End
%ConvertToSubClassCode
switch (sipCpp->type())
{
case QGradient::ConicalGradient:
sipType = sipType_QConicalGradient;
break;
case QGradient::LinearGradient:
sipType = sipType_QLinearGradient;
break;
case QGradient::RadialGradient:
sipType = sipType_QRadialGradient;
break;
default:
sipType = 0;
}
%End
public:
enum CoordinateMode
{
LogicalMode,
StretchToDeviceMode,
ObjectBoundingMode,
ObjectMode,
};
enum Type
{
LinearGradient,
RadialGradient,
ConicalGradient,
NoGradient,
};
enum Spread
{
PadSpread,
ReflectSpread,
RepeatSpread,
};
enum Preset
{
WarmFlame,
NightFade,
SpringWarmth,
JuicyPeach,
YoungPassion,
LadyLips,
SunnyMorning,
RainyAshville,
FrozenDreams,
WinterNeva,
DustyGrass,
TemptingAzure,
HeavyRain,
AmyCrisp,
MeanFruit,
DeepBlue,
RipeMalinka,
CloudyKnoxville,
MalibuBeach,
NewLife,
TrueSunset,
MorpheusDen,
RareWind,
NearMoon,
WildApple,
SaintPetersburg,
PlumPlate,
EverlastingSky,
HappyFisher,
Blessing,
SharpeyeEagle,
LadogaBottom,
LemonGate,
ItmeoBranding,
ZeusMiracle,
OldHat,
StarWine,
HappyAcid,
AwesomePine,
NewYork,
ShyRainbow,
MixedHopes,
FlyHigh,
StrongBliss,
FreshMilk,
SnowAgain,
FebruaryInk,
KindSteel,
SoftGrass,
GrownEarly,
SharpBlues,
ShadyWater,
DirtyBeauty,
GreatWhale,
TeenNotebook,
PoliteRumors,
SweetPeriod,
WideMatrix,
SoftCherish,
RedSalvation,
BurningSpring,
NightParty,
SkyGlider,
HeavenPeach,
PurpleDivision,
AquaSplash,
SpikyNaga,
LoveKiss,
CleanMirror,
PremiumDark,
ColdEvening,
CochitiLake,
SummerGames,
PassionateBed,
MountainRock,
DesertHump,
JungleDay,
PhoenixStart,
OctoberSilence,
FarawayRiver,
AlchemistLab,
OverSun,
PremiumWhite,
MarsParty,
EternalConstance,
JapanBlush,
SmilingRain,
CloudyApple,
BigMango,
HealthyWater,
AmourAmour,
RiskyConcrete,
StrongStick,
ViciousStance,
PaloAlto,
HappyMemories,
MidnightBloom,
Crystalline,
PartyBliss,
ConfidentCloud,
LeCocktail,
RiverCity,
FrozenBerry,
ChildCare,
FlyingLemon,
NewRetrowave,
HiddenJaguar,
AboveTheSky,
Nega,
DenseWater,
Seashore,
MarbleWall,
CheerfulCaramel,
NightSky,
MagicLake,
YoungGrass,
ColorfulPeach,
GentleCare,
PlumBath,
HappyUnicorn,
AfricanField,
SolidStone,
OrangeJuice,
GlassWater,
NorthMiracle,
FruitBlend,
MillenniumPine,
HighFlight,
MoleHall,
SpaceShift,
ForestInei,
RoyalGarden,
RichMetal,
JuicyCake,
SmartIndigo,
SandStrike,
NorseBeauty,
AquaGuidance,
SunVeggie,
SeaLord,
BlackSea,
GrassShampoo,
LandingAircraft,
WitchDance,
SleeplessNight,
AngelCare,
CrystalRiver,
SoftLipstick,
SaltMountain,
PerfectWhite,
FreshOasis,
StrictNovember,
MorningSalad,
DeepRelief,
SeaStrike,
NightCall,
SupremeSky,
LightBlue,
MindCrawl,
LilyMeadow,
SugarLollipop,
SweetDessert,
MagicRay,
TeenParty,
FrozenHeat,
GagarinView,
FabledSunset,
PerfectBlue,
NumPresets,
};
QGradient();
QGradient(QGradient::Preset);
~QGradient();
QGradient::Type type() const;
QGradient::Spread spread() const;
void setColorAt(qreal pos, const QColor &color);
void setStops(const QGradientStops &stops);
QGradientStops stops() const;
bool operator==(const QGradient &gradient) const;
bool operator!=(const QGradient &other) const;
void setSpread(QGradient::Spread aspread);
QGradient::CoordinateMode coordinateMode() const;
void setCoordinateMode(QGradient::CoordinateMode mode);
};
class QLinearGradient : public QGradient
{
%TypeHeaderCode
#include <qbrush.h>
%End
public:
QLinearGradient();
QLinearGradient(const QPointF &start, const QPointF &finalStop);
QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
~QLinearGradient();
QPointF start() const;
QPointF finalStop() const;
void setStart(const QPointF &start);
void setStart(qreal x, qreal y);
void setFinalStop(const QPointF &stop);
void setFinalStop(qreal x, qreal y);
};
class QRadialGradient : public QGradient
{
%TypeHeaderCode
#include <qbrush.h>
%End
public:
QRadialGradient();
QRadialGradient(const QPointF &center, qreal radius, const QPointF &focalPoint);
QRadialGradient(const QPointF &center, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius);
QRadialGradient(const QPointF &center, qreal radius);
QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy);
QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius);
QRadialGradient(qreal cx, qreal cy, qreal radius);
~QRadialGradient();
QPointF center() const;
QPointF focalPoint() const;
qreal radius() const;
void setCenter(const QPointF &center);
void setCenter(qreal x, qreal y);
void setFocalPoint(const QPointF &focalPoint);
void setFocalPoint(qreal x, qreal y);
void setRadius(qreal radius);
qreal centerRadius() const;
void setCenterRadius(qreal radius);
qreal focalRadius() const;
void setFocalRadius(qreal radius);
};
class QConicalGradient : public QGradient
{
%TypeHeaderCode
#include <qbrush.h>
%End
public:
QConicalGradient();
QConicalGradient(const QPointF &center, qreal startAngle);
QConicalGradient(qreal cx, qreal cy, qreal startAngle);
~QConicalGradient();
QPointF center() const;
qreal angle() const;
void setCenter(const QPointF &center);
void setCenter(qreal x, qreal y);
void setAngle(qreal angle);
};
%If (Qt_6_9_0 -)
bool operator!=(const QBrush &lhs, const Qt::BrushStyle &rhs);
%End
%If (Qt_6_9_0 -)
bool operator!=(const QBrush &lhs, const Qt::GlobalColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator!=(const QBrush &lhs, const QColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator!=(const QColor &lhs, const QBrush &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QBrush &lhs, const Qt::BrushStyle &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QBrush &lhs, const Qt::GlobalColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QBrush &lhs, const QColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QColor &lhs, const QBrush &rhs);
%End

View File

@@ -0,0 +1,92 @@
// qclipboard.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QClipboard : public QObject
{
%TypeHeaderCode
#include <qclipboard.h>
%End
explicit QClipboard(QObject *parent /TransferThis/);
virtual ~QClipboard();
public:
enum Mode
{
Clipboard,
Selection,
FindBuffer,
};
void clear(QClipboard::Mode mode = QClipboard::Clipboard);
bool supportsFindBuffer() const;
bool supportsSelection() const;
bool ownsClipboard() const;
bool ownsFindBuffer() const;
bool ownsSelection() const;
QString text(QClipboard::Mode mode = QClipboard::Clipboard) const;
SIP_PYTUPLE text(const QString &subtype, QClipboard::Mode mode = QClipboard::Clipboard) const /TypeHint="Tuple[QString, QString]"/;
%MethodCode
QString *text;
QString *subtype = new QString(*a0);
Py_BEGIN_ALLOW_THREADS
text = new QString(sipCpp->text(*subtype, a1));
Py_END_ALLOW_THREADS
PyObject *text_obj = sipConvertFromNewType(text, sipType_QString, NULL);
PyObject *subtype_obj = sipConvertFromNewType(subtype, sipType_QString, NULL);
if (text_obj && subtype_obj)
sipRes = PyTuple_Pack(2, text_obj, subtype_obj);
Py_XDECREF(text_obj);
Py_XDECREF(subtype_obj);
%End
void setText(const QString &, QClipboard::Mode mode = QClipboard::Clipboard);
const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) const;
void setMimeData(QMimeData *data /GetWrapper/, QClipboard::Mode mode = QClipboard::Clipboard);
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipCpp->setMimeData(a0, a1);
Py_END_ALLOW_THREADS
// Transfer ownership to C++ and make sure the Python object stays alive by
// giving it a reference to itself. The cycle will be broken by QMimeData's
// virtual dtor. The reason we don't do the obvious and just use /Transfer/ is
// that the QClipboard Python object we would transfer ownership to is likely
// to be garbage collected immediately afterwards.
sipTransferTo(a0Wrapper, a0Wrapper);
%End
QImage image(QClipboard::Mode mode = QClipboard::Clipboard) const;
QPixmap pixmap(QClipboard::Mode mode = QClipboard::Clipboard) const;
void setImage(const QImage &, QClipboard::Mode mode = QClipboard::Clipboard);
void setPixmap(const QPixmap &, QClipboard::Mode mode = QClipboard::Clipboard);
signals:
void changed(QClipboard::Mode mode);
void dataChanged();
void findBufferChanged();
void selectionChanged();
};

View File

@@ -0,0 +1,397 @@
// qcolor.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QColor /TypeHintIn="Union[QColor, Qt.GlobalColor, int]"/
{
%TypeHeaderCode
#include <qcolor.h>
%End
%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// Qt::GlobalColor or an (unsigned) int to be used whenever a QColor is
// expected. Note that SIP must process QColor before QBrush so that the
// former's QVariant cast operator is applied before the latter's.
if (PyLong_Check(sipPy))
{
if (sipIsErr == NULL)
return 1;
unsigned long argb = PyLong_AsUnsignedLong(sipPy);
if (PyErr_Occurred())
{
PyErr_Clear();
*sipIsErr = 1;
return 0;
}
*sipCppPtr = new QColor(static_cast<QRgb>(argb));
return sipGetState(sipTransferObj);
}
bool is_global_color = true;
int global_color = sipConvertToEnum(sipPy, sipType_Qt_GlobalColor);
if (PyErr_Occurred())
{
PyErr_Clear();
is_global_color = false;
}
if (sipIsErr == NULL)
return (is_global_color ||
sipCanConvertToType(sipPy, sipType_QColor, SIP_NO_CONVERTORS));
if (is_global_color)
{
*sipCppPtr = new QColor(static_cast<Qt::GlobalColor>(global_color));
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
%PickleCode
sipRes = Py_BuildValue("iiii", sipCpp->red(), sipCpp->green(), sipCpp->blue(), sipCpp->alpha());
%End
public:
enum Spec
{
Invalid,
Rgb,
Hsv,
Cmyk,
Hsl,
ExtendedRgb,
};
QColor(Qt::GlobalColor color);
QColor(QRgb rgb);
QColor(QRgba64 rgba64);
QColor(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QColor>())
sipCpp = new QColor(a0->value<QColor>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
QString name(QColor::NameFormat format = QColor::HexRgb) const;
void setNamedColor(QStringView name);
static QStringList colorNames();
QColor::Spec spec() const;
int alpha() const;
void setAlpha(int alpha);
float alphaF() const;
void setAlphaF(float alpha);
int red() const;
int green() const;
int blue() const;
void setRed(int red);
void setGreen(int green);
void setBlue(int blue);
float redF() const;
float greenF() const;
float blueF() const;
void setRedF(float red);
void setGreenF(float green);
void setBlueF(float blue);
void getRgb(int *r, int *g, int *b, int *alpha = 0) const;
void setRgb(int r, int g, int b, int alpha = 255);
void getRgbF(float *r, float *g, float *b, float *alpha = 0) const;
void setRgbF(float r, float g, float b, float alpha = 1.);
QRgb rgba() const;
void setRgba(QRgb rgba);
QRgb rgb() const;
void setRgb(QRgb rgb);
int hue() const;
int saturation() const;
int value() const;
float hueF() const;
float saturationF() const;
float valueF() const;
void getHsv(int *h, int *s, int *v, int *alpha = 0) const;
void setHsv(int h, int s, int v, int alpha = 255);
void getHsvF(float *h, float *s, float *v, float *alpha = 0) const;
void setHsvF(float h, float s, float v, float alpha = 1.);
int cyan() const;
int magenta() const;
int yellow() const;
int black() const;
float cyanF() const;
float magentaF() const;
float yellowF() const;
float blackF() const;
void getCmyk(int *c, int *m, int *y, int *k, int *alpha = 0) const;
void setCmyk(int c, int m, int y, int k, int alpha = 255);
void getCmykF(float *c, float *m, float *y, float *k, float *alpha = 0) const;
void setCmykF(float c, float m, float y, float k, float alpha = 1.);
QColor toRgb() const;
QColor toHsv() const;
QColor toCmyk() const;
QColor convertTo(QColor::Spec colorSpec) const;
static QColor fromRgb(QRgb rgb);
static QColor fromRgba(QRgb rgba);
static QColor fromRgb(int r, int g, int b, int alpha = 255);
static QColor fromRgbF(float r, float g, float b, float alpha = 1.);
static QColor fromHsv(int h, int s, int v, int alpha = 255);
static QColor fromHsvF(float h, float s, float v, float alpha = 1.);
static QColor fromCmyk(int c, int m, int y, int k, int alpha = 255);
static QColor fromCmykF(float c, float m, float y, float k, float alpha = 1.);
bool operator==(const QColor &c) const;
bool operator!=(const QColor &c) const;
QColor();
QColor(int r, int g, int b, int alpha = 255);
explicit QColor(QStringView name);
bool isValid() const;
QColor lighter(int factor = 150) const;
QColor darker(int factor = 200) const;
int hsvHue() const;
int hsvSaturation() const;
float hsvHueF() const;
float hsvSaturationF() const;
int hslHue() const;
int hslSaturation() const;
int lightness() const;
float hslHueF() const;
float hslSaturationF() const;
float lightnessF() const;
void getHsl(int *h, int *s, int *l, int *alpha = 0) const;
void setHsl(int h, int s, int l, int alpha = 255);
void getHslF(float *h, float *s, float *l, float *alpha = 0) const;
void setHslF(float h, float s, float l, float alpha = 1.);
QColor toHsl() const;
static QColor fromHsl(int h, int s, int l, int alpha = 255);
static QColor fromHslF(float h, float s, float l, float alpha = 1.);
static bool isValidColor(const QString &name);
enum NameFormat
{
HexRgb,
HexArgb,
};
QRgba64 rgba64() const;
void setRgba64(QRgba64 rgba);
static QColor fromRgba64(ushort r, ushort g, ushort b, ushort alpha = USHRT_MAX);
static QColor fromRgba64(QRgba64 rgba);
QColor toExtendedRgb() const;
%If (Qt_6_4_0 -)
static QColor fromString(QAnyStringView name);
%End
%If (Qt_6_4_0 -)
static bool isValidColorName(QAnyStringView);
%End
};
QDataStream &operator<<(QDataStream &, const QColor &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QColor & /Constrained/) /ReleaseGIL/;
namespace QColorConstants
{
%TypeHeaderCode
#include <qcolor.h>
%End
const QColor Color0;
const QColor Color1;
const QColor Black;
const QColor White;
const QColor DarkGray;
const QColor Gray;
const QColor LightGray;
const QColor Red;
const QColor Green;
const QColor Blue;
const QColor Cyan;
const QColor Magenta;
const QColor Yellow;
const QColor DarkRed;
const QColor DarkGreen;
const QColor DarkBlue;
const QColor DarkCyan;
const QColor DarkMagenta;
const QColor DarkYellow;
const QColor Transparent;
namespace Svg
{
%TypeHeaderCode
#include <qcolor.h>
%End
const QColor aliceblue;
const QColor antiquewhite;
const QColor aqua;
const QColor aquamarine;
const QColor azure;
const QColor beige;
const QColor bisque;
const QColor black;
const QColor blanchedalmond;
const QColor blue;
const QColor blueviolet;
const QColor brown;
const QColor burlywood;
const QColor cadetblue;
const QColor chartreuse;
const QColor chocolate;
const QColor coral;
const QColor cornflowerblue;
const QColor cornsilk;
const QColor crimson;
const QColor cyan;
const QColor darkblue;
const QColor darkcyan;
const QColor darkgoldenrod;
const QColor darkgray;
const QColor darkgreen;
const QColor darkgrey;
const QColor darkkhaki;
const QColor darkmagenta;
const QColor darkolivegreen;
const QColor darkorange;
const QColor darkorchid;
const QColor darkred;
const QColor darksalmon;
const QColor darkseagreen;
const QColor darkslateblue;
const QColor darkslategray;
const QColor darkslategrey;
const QColor darkturquoise;
const QColor darkviolet;
const QColor deeppink;
const QColor deepskyblue;
const QColor dimgray;
const QColor dimgrey;
const QColor dodgerblue;
const QColor firebrick;
const QColor floralwhite;
const QColor forestgreen;
const QColor fuchsia;
const QColor gainsboro;
const QColor ghostwhite;
const QColor gold;
const QColor goldenrod;
const QColor gray;
const QColor green;
const QColor greenyellow;
const QColor grey;
const QColor honeydew;
const QColor hotpink;
const QColor indianred;
const QColor indigo;
const QColor ivory;
const QColor khaki;
const QColor lavender;
const QColor lavenderblush;
const QColor lawngreen;
const QColor lemonchiffon;
const QColor lightblue;
const QColor lightcoral;
const QColor lightcyan;
const QColor lightgoldenrodyellow;
const QColor lightgray;
const QColor lightgreen;
const QColor lightgrey;
const QColor lightpink;
const QColor lightsalmon;
const QColor lightseagreen;
const QColor lightskyblue;
const QColor lightslategray;
const QColor lightslategrey;
const QColor lightsteelblue;
const QColor lightyellow;
const QColor lime;
const QColor limegreen;
const QColor linen;
const QColor magenta;
const QColor maroon;
const QColor mediumaquamarine;
const QColor mediumblue;
const QColor mediumorchid;
const QColor mediumpurple;
const QColor mediumseagreen;
const QColor mediumslateblue;
const QColor mediumspringgreen;
const QColor mediumturquoise;
const QColor mediumvioletred;
const QColor midnightblue;
const QColor mintcream;
const QColor mistyrose;
const QColor moccasin;
const QColor navajowhite;
const QColor navy;
const QColor oldlace;
const QColor olive;
const QColor olivedrab;
const QColor orange;
const QColor orangered;
const QColor orchid;
const QColor palegoldenrod;
const QColor palegreen;
const QColor paleturquoise;
const QColor palevioletred;
const QColor papayawhip;
const QColor peachpuff;
const QColor peru;
const QColor pink;
const QColor plum;
const QColor powderblue;
const QColor purple;
const QColor red;
const QColor rosybrown;
const QColor royalblue;
const QColor saddlebrown;
const QColor salmon;
const QColor sandybrown;
const QColor seagreen;
const QColor seashell;
const QColor sienna;
const QColor silver;
const QColor skyblue;
const QColor slateblue;
const QColor slategray;
const QColor slategrey;
const QColor snow;
const QColor springgreen;
const QColor steelblue;
const QColor tan;
const QColor teal;
const QColor thistle;
const QColor tomato;
const QColor turquoise;
const QColor violet;
const QColor wheat;
const QColor white;
const QColor whitesmoke;
const QColor yellow;
const QColor yellowgreen;
};
};

View File

@@ -0,0 +1,193 @@
// qcolorspace.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QColorSpace
{
%TypeHeaderCode
#include <qcolorspace.h>
%End
public:
%If (Qt_6_8_0 -)
enum class ColorModel
{
Undefined,
Rgb,
Gray,
Cmyk,
};
%End
enum NamedColorSpace
{
SRgb,
SRgbLinear,
AdobeRgb,
DisplayP3,
ProPhotoRgb,
%If (Qt_6_8_0 -)
Bt2020,
%End
%If (Qt_6_8_0 -)
Bt2100Pq,
%End
%If (Qt_6_8_0 -)
Bt2100Hlg,
%End
};
enum class Primaries
{
Custom,
SRgb,
AdobeRgb,
DciP3D65,
ProPhotoRgb,
%If (Qt_6_8_0 -)
Bt2020,
%End
};
enum class TransferFunction
{
Custom,
Linear,
Gamma,
SRgb,
ProPhotoRgb,
%If (Qt_6_8_0 -)
Bt2020,
%End
%If (Qt_6_8_0 -)
St2084,
%End
%If (Qt_6_8_0 -)
Hlg,
%End
};
%If (Qt_6_8_0 -)
enum class TransformModel
{
ThreeComponentMatrix,
ElementListProcessing,
};
%End
QColorSpace();
QColorSpace(QColorSpace::NamedColorSpace namedColorSpace);
QColorSpace(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma = 0.F);
QColorSpace(QColorSpace::Primaries primaries, float gamma);
%If (Qt_6_1_0 -)
QColorSpace(QColorSpace::Primaries primaries, const QList<unsigned short> &transferFunctionTable);
%End
QColorSpace(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, QColorSpace::TransferFunction fun, float gamma = 0.F);
%If (Qt_6_1_0 -)
QColorSpace(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, const QList<unsigned short> &redTransferFunctionTable, const QList<unsigned short> &greenTransferFunctionTable, const QList<unsigned short> &blueTransferFunctionTable);
%End
%If (Qt_6_1_0 -)
QColorSpace(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint, const QList<unsigned short> &transferFunctionTable);
%End
%If (Qt_6_8_0 -)
QColorSpace(QPointF whitePoint, const QList<unsigned short> &transferFunctionTable);
%End
%If (Qt_6_8_0 -)
QColorSpace(QPointF whitePoint, QColorSpace::TransferFunction transferFunction, float gamma = 0.F);
%End
QColorSpace(const QColorSpace &colorSpace);
%If (Qt_6_9_0 -)
QColorSpace(const QColorSpace::PrimaryPoints &primaryPoints, QColorSpace::TransferFunction transferFunction, float gamma = 0.F);
%End
~QColorSpace();
void swap(QColorSpace &colorSpace /Constrained/);
QColorSpace::Primaries primaries() const;
QColorSpace::TransferFunction transferFunction() const;
float gamma() const;
void setTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = 0.F);
%If (Qt_6_1_0 -)
void setTransferFunction(const QList<unsigned short> &transferFunctionTable);
%End
%If (Qt_6_1_0 -)
void setTransferFunctions(const QList<unsigned short> &redTransferFunctionTable, const QList<unsigned short> &greenTransferFunctionTable, const QList<unsigned short> &blueTransferFunctionTable);
%End
%If (Qt_6_1_0 -)
QColorSpace withTransferFunction(const QList<unsigned short> &transferFunctionTable) const;
%End
QColorSpace withTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma = 0.F) const;
%If (Qt_6_1_0 -)
QColorSpace withTransferFunctions(const QList<unsigned short> &redTransferFunctionTable, const QList<unsigned short> &greenTransferFunctionTable, const QList<unsigned short> &blueTransferFunctionTable) const;
%End
void setPrimaries(QColorSpace::Primaries primariesId);
void setPrimaries(const QPointF &whitePoint, const QPointF &redPoint, const QPointF &greenPoint, const QPointF &bluePoint);
bool isValid() const;
static QColorSpace fromIccProfile(const QByteArray &iccProfile);
QByteArray iccProfile() const;
QColorTransform transformationToColorSpace(const QColorSpace &colorspace) const;
%If (Qt_6_2_0 -)
QString description() const;
%End
%If (Qt_6_2_0 -)
void setDescription(const QString &description);
%End
%If (Qt_6_8_0 -)
void setWhitePoint(QPointF whitePoint);
%End
%If (Qt_6_8_0 -)
QPointF whitePoint() const;
%End
%If (Qt_6_8_0 -)
QColorSpace::TransformModel transformModel() const;
%End
%If (Qt_6_8_0 -)
QColorSpace::ColorModel colorModel() const;
%End
%If (Qt_6_8_0 -)
bool isValidTarget() const;
%End
%If (Qt_6_9_0 -)
struct PrimaryPoints
{
%TypeHeaderCode
#include <qcolorspace.h>
%End
static QColorSpace::PrimaryPoints fromPrimaries(QColorSpace::Primaries primaries);
bool isValid() const;
};
%End
%If (Qt_6_9_0 -)
void setPrimaryPoints(const QColorSpace::PrimaryPoints &primaryPoints);
%End
%If (Qt_6_9_0 -)
QColorSpace::PrimaryPoints primaryPoints() const;
%End
};
bool operator==(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
bool operator!=(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
QDataStream &operator<<(QDataStream &, const QColorSpace & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QColorSpace & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,47 @@
// qcolortransform.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QColorTransform
{
%TypeHeaderCode
#include <qcolortransform.h>
%End
public:
QColorTransform();
QColorTransform(const QColorTransform &colorTransform);
~QColorTransform();
void swap(QColorTransform &other /Constrained/);
QRgb map(QRgb argb) const;
QRgba64 map(QRgba64 rgba64) const;
QColor map(const QColor &color) const;
%If (Qt_6_4_0 -)
bool isIdentity() const;
%End
};
%If (Qt_6_4_0 -)
bool operator==(const QColorTransform &ct1, const QColorTransform &ct2);
%End
%If (Qt_6_4_0 -)
bool operator!=(const QColorTransform &ct1, const QColorTransform &ct2);
%End

View File

@@ -0,0 +1,90 @@
// qcursor.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QCursor /TypeHintIn="Union[QCursor, Qt.CursorShape]"/
{
%TypeHeaderCode
#include <qcursor.h>
%End
%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// Qt::CursorShape to be used whenever a QCursor is expected.
bool is_cursor_shape = true;
int cursor_shape = sipConvertToEnum(sipPy, sipType_Qt_CursorShape);
if (PyErr_Occurred())
{
PyErr_Clear();
is_cursor_shape = false;
}
if (sipIsErr == NULL)
return (is_cursor_shape ||
sipCanConvertToType(sipPy, sipType_QCursor, SIP_NO_CONVERTORS));
if (is_cursor_shape)
{
*sipCppPtr = new QCursor(static_cast<Qt::CursorShape>(cursor_shape));
return sipGetState(sipTransferObj);
}
*sipCppPtr = reinterpret_cast<QCursor *>(sipConvertToType(sipPy, sipType_QCursor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
%End
public:
QCursor();
QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX = -1, int hotY = -1);
QCursor(const QPixmap &pixmap, int hotX = -1, int hotY = -1);
QCursor(const QCursor &cursor);
QCursor(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QCursor>())
sipCpp = new QCursor(a0->value<QCursor>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QCursor();
Qt::CursorShape shape() const;
void setShape(Qt::CursorShape newShape);
QBitmap bitmap() const;
QBitmap mask() const;
QPixmap pixmap() const;
QPoint hotSpot() const;
static QPoint pos();
static void setPos(int x, int y);
static void setPos(const QPoint &p);
static QPoint pos(const QScreen *screen);
static void setPos(QScreen *screen, int x, int y);
static void setPos(QScreen *screen, const QPoint &p);
void swap(QCursor &other);
};
QDataStream &operator<<(QDataStream &outS, const QCursor &cursor) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &inS, QCursor &cursor /Constrained/) /ReleaseGIL/;
bool operator==(const QCursor &lhs, const QCursor &rhs);
bool operator!=(const QCursor &lhs, const QCursor &rhs);

View File

@@ -0,0 +1,67 @@
// qdesktopservices.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QDesktopServices
{
%TypeHeaderCode
#include <qdesktopservices.h>
%End
public:
static bool openUrl(const QUrl &url) /ReleaseGIL/;
static void setUrlHandler(const QString &scheme, QObject *receiver, const char *method);
static void setUrlHandler(const QString &scheme, SIP_PYCALLABLE method /TypeHint="Callable[[QUrl], None]"/);
%MethodCode
// Allow a callable that must be a slot of a QObject, although we never tell
// the user if it isn't.
sipMethodDef pm;
if (sipGetMethod(a1, &pm))
{
int iserr = 0;
QObject *receiver = reinterpret_cast<QObject *>(sipForceConvertToType(
pm.pm_self, sipType_QObject, NULL, SIP_NOT_NONE, NULL, &iserr));
if (!iserr)
{
PyObject *f_name_obj = PyObject_GetAttrString(pm.pm_function, "__name__");
if (f_name_obj)
{
// We only want a borrowed reference.
Py_DECREF(f_name_obj);
const char *f_name = sipString_AsASCIIString(&f_name_obj);
if (f_name)
{
QDesktopServices::setUrlHandler(*a0, receiver, f_name);
Py_DECREF(f_name_obj);
}
}
}
}
%End
static void unsetUrlHandler(const QString &scheme);
};

View File

@@ -0,0 +1,55 @@
// qdrag.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QDrag : public QObject
{
%TypeHeaderCode
#include <qdrag.h>
%End
public:
explicit QDrag(QObject *dragSource /TransferThis/);
virtual ~QDrag();
Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction) /ReleaseGIL/;
Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultDropAction) /ReleaseGIL/;
void setMimeData(QMimeData *data /Transfer/);
QMimeData *mimeData() const;
void setPixmap(const QPixmap &);
QPixmap pixmap() const;
void setHotSpot(const QPoint &hotspot);
QPoint hotSpot() const;
QObject *source() const;
QObject *target() const;
void setDragCursor(const QPixmap &cursor, Qt::DropAction action);
signals:
void actionChanged(Qt::DropAction action);
void targetChanged(QObject *newTarget);
public:
QPixmap dragCursor(Qt::DropAction action) const;
Qt::DropActions supportedActions() const;
Qt::DropAction defaultAction() const;
%If (Android || Linux || WebAssembly || Windows)
static void cancel();
%End
};

View File

@@ -0,0 +1,877 @@
// qevent.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QInputEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
%ConvertToSubClassCode
switch (sipCpp->type())
{
case QEvent::ActionAdded:
case QEvent::ActionChanged:
case QEvent::ActionRemoved:
sipType = sipType_QActionEvent;
break;
case QEvent::Close:
sipType = sipType_QCloseEvent;
break;
case QEvent::ContextMenu:
sipType = sipType_QContextMenuEvent;
break;
case QEvent::DragEnter:
sipType = sipType_QDragEnterEvent;
break;
case QEvent::DragLeave:
sipType = sipType_QDragLeaveEvent;
break;
case QEvent::DragMove:
sipType = sipType_QDragMoveEvent;
break;
case QEvent::Drop:
sipType = sipType_QDropEvent;
break;
case QEvent::Enter:
sipType = sipType_QEnterEvent;
break;
case QEvent::FileOpen:
sipType = sipType_QFileOpenEvent;
break;
case QEvent::FocusIn:
case QEvent::FocusOut:
sipType = sipType_QFocusEvent;
break;
case QEvent::Hide:
sipType = sipType_QHideEvent;
break;
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
sipType = sipType_QHoverEvent;
break;
case QEvent::IconDrag:
sipType = sipType_QIconDragEvent;
break;
case QEvent::InputMethod:
sipType = sipType_QInputMethodEvent;
break;
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::ShortcutOverride:
sipType = sipType_QKeyEvent;
break;
case QEvent::MouseButtonDblClick:
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
sipType = sipType_QMouseEvent;
break;
case QEvent::Move:
sipType = sipType_QMoveEvent;
break;
case QEvent::Paint:
sipType = sipType_QPaintEvent;
break;
case QEvent::Resize:
sipType = sipType_QResizeEvent;
break;
case QEvent::Shortcut:
sipType = sipType_QShortcutEvent;
break;
case QEvent::Show:
sipType = sipType_QShowEvent;
break;
case QEvent::StatusTip:
sipType = sipType_QStatusTipEvent;
break;
case QEvent::TabletMove:
case QEvent::TabletPress:
case QEvent::TabletRelease:
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity:
sipType = sipType_QTabletEvent;
break;
case QEvent::ToolTip:
case QEvent::WhatsThis:
sipType = sipType_QHelpEvent;
break;
case QEvent::WhatsThisClicked:
sipType = sipType_QWhatsThisClickedEvent;
break;
case QEvent::Wheel:
sipType = sipType_QWheelEvent;
break;
case QEvent::WindowStateChange:
sipType = sipType_QWindowStateChangeEvent;
break;
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
case QEvent::TouchCancel:
sipType = sipType_QTouchEvent;
break;
case QEvent::InputMethodQuery:
sipType = sipType_QInputMethodQueryEvent;
break;
case QEvent::Expose:
sipType = sipType_QExposeEvent;
break;
case QEvent::ScrollPrepare:
sipType = sipType_QScrollPrepareEvent;
break;
case QEvent::Scroll:
sipType = sipType_QScrollEvent;
break;
case QEvent::NativeGesture:
sipType = sipType_QNativeGestureEvent;
break;
case QEvent::PlatformSurface:
sipType = sipType_QPlatformSurfaceEvent;
break;
#if QT_VERSION >= 0x060700
case QEvent::ChildWindowAdded:
case QEvent::ChildWindowRemoved:
sipType = sipType_QChildWindowEvent;
break;
#endif
default:
sipType = 0;
}
%End
public:
virtual ~QInputEvent();
Qt::KeyboardModifiers modifiers() const;
quint64 timestamp() const;
const QInputDevice *device() const;
QInputDevice::DeviceType deviceType() const;
virtual QInputEvent *clone() const /Factory/;
private:
QInputEvent(const QInputEvent &);
};
class QKeyEvent : public QInputEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text = QString(), bool autorep = false, quint16 count = 1, const QInputDevice *device = QInputDevice::primaryKeyboard());
QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text = QString(), bool autorep = false, quint16 count = 1);
virtual ~QKeyEvent();
int key() const;
Qt::KeyboardModifiers modifiers() const;
QString text() const;
bool isAutoRepeat() const;
int count() const /__len__/;
bool matches(QKeySequence::StandardKey key) const;
quint32 nativeModifiers() const;
quint32 nativeScanCode() const;
quint32 nativeVirtualKey() const;
QKeyCombination keyCombination() const;
virtual QKeyEvent *clone() const /Factory/;
};
bool operator==(QKeyEvent *e, QKeySequence::StandardKey key);
bool operator==(QKeySequence::StandardKey key, QKeyEvent *e);
class QFocusEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QFocusEvent(QEvent::Type type, Qt::FocusReason reason = Qt::OtherFocusReason);
virtual ~QFocusEvent();
bool gotFocus() const;
bool lostFocus() const;
Qt::FocusReason reason() const;
virtual QFocusEvent *clone() const /Factory/;
};
class QPaintEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QPaintEvent(const QRegion &paintRegion);
explicit QPaintEvent(const QRect &paintRect);
virtual ~QPaintEvent();
const QRect &rect() const;
const QRegion &region() const;
virtual QPaintEvent *clone() const /Factory/;
};
class QMoveEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QMoveEvent(const QPoint &pos, const QPoint &oldPos);
virtual ~QMoveEvent();
const QPoint &pos() const;
const QPoint &oldPos() const;
virtual QMoveEvent *clone() const /Factory/;
};
class QResizeEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QResizeEvent(const QSize &size, const QSize &oldSize);
virtual ~QResizeEvent();
const QSize &size() const;
const QSize &oldSize() const;
virtual QResizeEvent *clone() const /Factory/;
};
class QCloseEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QCloseEvent();
virtual ~QCloseEvent();
%If (Qt_6_4_0 -)
virtual QCloseEvent *clone() const /Factory/;
%End
};
class QIconDragEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QIconDragEvent();
virtual ~QIconDragEvent();
%If (Qt_6_4_0 -)
virtual QIconDragEvent *clone() const /Factory/;
%End
};
class QShowEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QShowEvent();
virtual ~QShowEvent();
%If (Qt_6_4_0 -)
virtual QShowEvent *clone() const /Factory/;
%End
};
class QHideEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QHideEvent();
virtual ~QHideEvent();
%If (Qt_6_4_0 -)
virtual QHideEvent *clone() const /Factory/;
%End
};
class QContextMenuEvent : public QInputEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
enum Reason
{
Mouse,
Keyboard,
Other,
};
QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos);
virtual ~QContextMenuEvent();
int x() const;
int y() const;
int globalX() const;
int globalY() const;
const QPoint &pos() const;
const QPoint &globalPos() const;
QContextMenuEvent::Reason reason() const;
virtual QContextMenuEvent *clone() const /Factory/;
};
class QInputMethodEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
enum AttributeType
{
TextFormat,
Cursor,
Language,
Ruby,
Selection,
%If (Qt_6_10_0 -)
MimeData,
%End
};
class Attribute
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
Attribute(QInputMethodEvent::AttributeType t, int s, int l, QVariant val);
Attribute(QInputMethodEvent::AttributeType typ, int s, int l);
QInputMethodEvent::AttributeType type;
int start;
int length;
QVariant value;
};
QInputMethodEvent();
QInputMethodEvent(const QString &preeditText, const QList<QInputMethodEvent::Attribute> &attributes);
virtual ~QInputMethodEvent();
void setCommitString(const QString &commitString, int from = 0, int length = 0);
const QList<QInputMethodEvent::Attribute> &attributes() const;
const QString &preeditString() const;
const QString &commitString() const;
int replacementStart() const;
int replacementLength() const;
virtual QInputMethodEvent *clone() const /Factory/;
};
bool operator==(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs);
bool operator!=(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs);
class QInputMethodQueryEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
virtual ~QInputMethodQueryEvent();
Qt::InputMethodQueries queries() const;
void setValue(Qt::InputMethodQuery query, const QVariant &value);
QVariant value(Qt::InputMethodQuery query) const;
virtual QInputMethodQueryEvent *clone() const /Factory/;
};
class QDropEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QDropEvent(const QPointF &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = QEvent::Drop);
virtual ~QDropEvent();
Qt::DropActions possibleActions() const;
Qt::DropAction proposedAction() const;
void acceptProposedAction();
Qt::DropAction dropAction() const;
void setDropAction(Qt::DropAction action);
QObject *source() const;
const QMimeData *mimeData() const;
QPointF position() const;
Qt::MouseButtons buttons() const;
Qt::KeyboardModifiers modifiers() const;
virtual QDropEvent *clone() const /Factory/;
};
class QDragMoveEvent : public QDropEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QEvent::Type type = QEvent::DragMove);
virtual ~QDragMoveEvent();
QRect answerRect() const;
void accept();
void ignore();
void accept(const QRect &r);
void ignore(const QRect &r);
virtual QDragMoveEvent *clone() const /Factory/;
};
class QDragEnterEvent : public QDragMoveEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
virtual ~QDragEnterEvent();
%If (Qt_6_4_0 -)
virtual QDragEnterEvent *clone() const /Factory/;
%End
};
class QDragLeaveEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QDragLeaveEvent();
virtual ~QDragLeaveEvent();
%If (Qt_6_4_0 -)
virtual QDragLeaveEvent *clone() const /Factory/;
%End
};
class QHelpEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QHelpEvent(QEvent::Type type, const QPoint &pos, const QPoint &globalPos);
virtual ~QHelpEvent();
int x() const;
int y() const;
int globalX() const;
int globalY() const;
const QPoint &pos() const;
const QPoint &globalPos() const;
virtual QHelpEvent *clone() const /Factory/;
};
class QStatusTipEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QStatusTipEvent(const QString &tip);
virtual ~QStatusTipEvent();
QString tip() const;
virtual QStatusTipEvent *clone() const /Factory/;
};
class QWhatsThisClickedEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QWhatsThisClickedEvent(const QString &href);
virtual ~QWhatsThisClickedEvent();
QString href() const;
virtual QWhatsThisClickedEvent *clone() const /Factory/;
};
class QActionEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QActionEvent(int type, QAction *action, QAction *before = 0);
virtual ~QActionEvent();
QAction *action() const;
QAction *before() const;
virtual QActionEvent *clone() const /Factory/;
};
class QFileOpenEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
virtual ~QFileOpenEvent();
QString file() const;
QUrl url() const;
bool openFile(QFile &file, QIODeviceBase::OpenMode flags) const /ReleaseGIL/;
virtual QFileOpenEvent *clone() const /Factory/;
private:
QFileOpenEvent(const QFileOpenEvent &);
};
class QShortcutEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
%If (Qt_6_5_0 -)
QShortcutEvent(const QKeySequence &key, const QShortcut *shortcut = 0, bool ambiguous = false);
%End
virtual ~QShortcutEvent();
bool isAmbiguous() const;
const QKeySequence &key() const;
int shortcutId() const;
virtual QShortcutEvent *clone() const /Factory/;
};
class QWindowStateChangeEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
virtual ~QWindowStateChangeEvent();
Qt::WindowStates oldState() const;
virtual QWindowStateChangeEvent *clone() const /Factory/;
private:
QWindowStateChangeEvent(const QWindowStateChangeEvent &);
};
class QExposeEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QExposeEvent(const QRegion &rgn);
virtual ~QExposeEvent();
virtual QExposeEvent *clone() const /Factory/;
};
class QScrollPrepareEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
explicit QScrollPrepareEvent(const QPointF &startPos);
virtual ~QScrollPrepareEvent();
QPointF startPos() const;
QSizeF viewportSize() const;
QRectF contentPosRange() const;
QPointF contentPos() const;
void setViewportSize(const QSizeF &size);
void setContentPosRange(const QRectF &rect);
void setContentPos(const QPointF &pos);
virtual QScrollPrepareEvent *clone() const /Factory/;
};
class QScrollEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
enum ScrollState
{
ScrollStarted,
ScrollUpdated,
ScrollFinished,
};
QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, QScrollEvent::ScrollState scrollState);
virtual ~QScrollEvent();
QPointF contentPos() const;
QPointF overshootDistance() const;
QScrollEvent::ScrollState scrollState() const;
virtual QScrollEvent *clone() const /Factory/;
};
class QPlatformSurfaceEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
enum SurfaceEventType
{
SurfaceCreated,
SurfaceAboutToBeDestroyed,
};
explicit QPlatformSurfaceEvent(QPlatformSurfaceEvent::SurfaceEventType surfaceEventType);
virtual ~QPlatformSurfaceEvent();
QPlatformSurfaceEvent::SurfaceEventType surfaceEventType() const;
virtual QPlatformSurfaceEvent *clone() const /Factory/;
};
class QPointerEvent : public QInputEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
virtual ~QPointerEvent();
const QPointingDevice *pointingDevice() const;
QPointingDevice::PointerType pointerType() const;
qsizetype pointCount() const;
QEventPoint &point(qsizetype i);
const QList<QEventPoint> &points() const;
QEventPoint *pointById(int id);
virtual bool isBeginEvent() const;
virtual bool isUpdateEvent() const;
virtual bool isEndEvent() const;
bool allPointsAccepted() const;
virtual void setAccepted(bool accepted);
virtual QPointerEvent *clone() const /Factory/;
private:
QPointerEvent(const QPointerEvent &);
};
class QSinglePointEvent : public QPointerEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
%If (Qt_6_4_0 -)
virtual ~QSinglePointEvent();
%End
Qt::MouseButton button() const;
Qt::MouseButtons buttons() const;
QPointF position() const;
QPointF scenePosition() const;
QPointF globalPosition() const;
virtual bool isBeginEvent() const;
virtual bool isUpdateEvent() const;
virtual bool isEndEvent() const;
QObject *exclusivePointGrabber() const;
void setExclusivePointGrabber(QObject *exclusiveGrabber);
virtual QSinglePointEvent *clone() const /Factory/;
private:
QSinglePointEvent(const QSinglePointEvent &);
};
class QEnterEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QEnterEvent(const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
virtual ~QEnterEvent();
virtual QEnterEvent *clone() const /Factory/;
};
class QMouseEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QMouseEvent(QEvent::Type type, const QPointF &localPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
QMouseEvent(QEvent::Type type, const QPointF &localPos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
QMouseEvent(QEvent::Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
virtual ~QMouseEvent();
QPoint pos() const;
Qt::MouseEventFlags flags() const;
virtual QMouseEvent *clone() const /Factory/;
};
class QHoverEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
%If (Qt_6_3_0 -)
QHoverEvent(QEvent::Type type, const QPointF &pos, const QPointF &globalPos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
%End
QHoverEvent(QEvent::Type type, const QPointF &pos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
virtual ~QHoverEvent();
virtual bool isUpdateEvent() const;
QPoint oldPos() const;
QPointF oldPosF() const;
virtual QHoverEvent *clone() const /Factory/;
};
class QWheelEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, bool inverted, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized, const QPointingDevice *device = QPointingDevice::primaryPointingDevice());
virtual ~QWheelEvent();
QPoint pixelDelta() const;
QPoint angleDelta() const;
Qt::ScrollPhase phase() const;
bool inverted() const;
virtual bool isBeginEvent() const;
virtual bool isUpdateEvent() const;
virtual bool isEndEvent() const;
virtual QWheelEvent *clone() const /Factory/;
};
class QTabletEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QTabletEvent(QEvent::Type t, const QPointingDevice *device, const QPointF &pos, const QPointF &globalPos, qreal pressure, float xTilt, float yTilt, float tangentialPressure, qreal rotation, float z, Qt::KeyboardModifiers keyState, Qt::MouseButton button, Qt::MouseButtons buttons);
virtual ~QTabletEvent();
qreal pressure() const;
qreal rotation() const;
qreal z() const;
qreal tangentialPressure() const;
qreal xTilt() const;
qreal yTilt() const;
virtual QTabletEvent *clone() const /Factory/;
};
class QNativeGestureEvent : public QSinglePointEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
%If (Qt_6_2_0 -)
QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *dev, int fingerCount, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, qreal value, const QPointF &delta, quint64 sequenceId = UINT64_MAX);
%End
QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, qreal value, quint64 sequenceId, quint64 intArgument);
virtual ~QNativeGestureEvent();
Qt::NativeGestureType gestureType() const;
qreal value() const;
virtual QNativeGestureEvent *clone() const /Factory/;
%If (Qt_6_2_0 -)
int fingerCount() const;
%End
%If (Qt_6_2_0 -)
QPointF delta() const;
%End
};
class QTouchEvent : public QPointerEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QTouchEvent(QEvent::Type eventType, const QPointingDevice *device = 0, Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QList<QEventPoint> &touchPoints = {});
virtual ~QTouchEvent();
QObject *target() const;
QEventPoint::States touchPointStates() const;
virtual bool isBeginEvent() const;
virtual bool isUpdateEvent() const;
virtual bool isEndEvent() const;
virtual QTouchEvent *clone() const /Factory/;
};
%If (Qt_6_7_0 -)
class QChildWindowEvent : public QEvent /NoDefaultCtors/
{
%TypeHeaderCode
#include <qevent.h>
%End
public:
QChildWindowEvent(QEvent::Type type, QWindow *childWindow);
virtual ~QChildWindowEvent();
QWindow *child() const;
virtual QChildWindowEvent *clone() const /Factory/;
};
%End

View File

@@ -0,0 +1,73 @@
// qeventpoint.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QEventPoint
{
%TypeHeaderCode
#include <qeventpoint.h>
%End
public:
enum State /BaseType=Flag/
{
Unknown,
Stationary,
Pressed,
Updated,
Released,
};
typedef QFlags<QEventPoint::State> States;
QEventPoint(int pointId, QEventPoint::State state, const QPointF &scenePosition, const QPointF &globalPosition);
QEventPoint(const QEventPoint &other);
bool operator==(const QEventPoint &other) const;
bool operator!=(const QEventPoint &other) const;
~QEventPoint();
void swap(QEventPoint &other /Constrained/);
QPointF position() const;
QPointF pressPosition() const;
QPointF grabPosition() const;
QPointF lastPosition() const;
QPointF scenePosition() const;
QPointF scenePressPosition() const;
QPointF sceneGrabPosition() const;
QPointF sceneLastPosition() const;
QPointF globalPosition() const;
QPointF globalPressPosition() const;
QPointF globalGrabPosition() const;
QPointF globalLastPosition() const;
QPointF normalizedPosition() const;
QVector2D velocity() const;
QEventPoint::State state() const;
const QPointingDevice *device() const;
int id() const;
QPointingDeviceUniqueId uniqueId() const;
ulong timestamp() const;
ulong lastTimestamp() const;
ulong pressTimestamp() const;
qreal timeHeld() const;
qreal pressure() const;
qreal rotation() const;
QSizeF ellipseDiameters() const;
bool isAccepted() const;
void setAccepted(bool accepted = true);
};

View File

@@ -0,0 +1,117 @@
// qfilesystemmodel.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QFileSystemModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qfilesystemmodel.h>
%End
public:
enum Roles /BaseType=IntEnum/
{
FileIconRole,
FilePathRole,
FileNameRole,
FilePermissions,
%If (Qt_6_8_0 -)
FileInfoRole,
%End
};
explicit QFileSystemModel(QObject *parent /TransferThis/ = 0);
virtual ~QFileSystemModel();
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(const QString &path, int column = 0) const;
virtual QModelIndex parent(const QModelIndex &child) const;
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
virtual bool canFetchMore(const QModelIndex &parent) const;
virtual void fetchMore(const QModelIndex &parent);
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant myComputer(int role = Qt::DisplayRole) 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 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
virtual QStringList mimeTypes() const;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
virtual Qt::DropActions supportedDropActions() const;
QModelIndex setRootPath(const QString &path);
QString rootPath() const;
QDir rootDirectory() const;
void setIconProvider(QAbstractFileIconProvider *provider /KeepReference/);
QAbstractFileIconProvider *iconProvider() const;
void setFilter(QDir::Filters filters);
QDir::Filters filter() const;
void setResolveSymlinks(bool enable);
bool resolveSymlinks() const;
void setReadOnly(bool enable);
bool isReadOnly() const;
void setNameFilterDisables(bool enable);
bool nameFilterDisables() const;
void setNameFilters(const QStringList &filters);
QStringList nameFilters() const;
QString filePath(const QModelIndex &index) const;
bool isDir(const QModelIndex &index) const;
qint64 size(const QModelIndex &index) const;
QString type(const QModelIndex &index) const;
QDateTime lastModified(const QModelIndex &index) const;
%If (Qt_6_6_0 -)
QDateTime lastModified(const QModelIndex &index, const QTimeZone &tz) const;
%End
QModelIndex mkdir(const QModelIndex &parent, const QString &name);
QFileDevice::Permissions permissions(const QModelIndex &index) const;
bool rmdir(const QModelIndex &index);
QString fileName(const QModelIndex &aindex) const;
QIcon fileIcon(const QModelIndex &aindex) const;
QFileInfo fileInfo(const QModelIndex &aindex) const;
bool remove(const QModelIndex &index);
signals:
void fileRenamed(const QString &path, const QString &oldName, const QString &newName);
void rootPathChanged(const QString &newPath);
void directoryLoaded(const QString &path);
protected:
virtual bool event(QEvent *event);
virtual void timerEvent(QTimerEvent *event);
public:
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
enum Option /BaseType=Flag/
{
DontWatchForChanges,
DontResolveSymlinks,
DontUseCustomDirectoryIcons,
};
typedef QFlags<QFileSystemModel::Option> Options;
void setOption(QFileSystemModel::Option option, bool on = true);
bool testOption(QFileSystemModel::Option option) const;
void setOptions(QFileSystemModel::Options options);
QFileSystemModel::Options options() const;
virtual QHash<int, QByteArray> roleNames() const;
};

View File

@@ -0,0 +1,339 @@
// qfont.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QFont
{
%TypeHeaderCode
#include <qfont.h>
%End
public:
enum StyleHint
{
Helvetica,
SansSerif,
Times,
Serif,
Courier,
TypeWriter,
OldEnglish,
Decorative,
System,
AnyStyle,
Cursive,
Monospace,
Fantasy,
};
enum StyleStrategy /BaseType=Flag/
{
PreferDefault,
PreferBitmap,
PreferDevice,
PreferOutline,
ForceOutline,
PreferMatch,
PreferQuality,
PreferAntialias,
NoAntialias,
NoSubpixelAntialias,
NoFontMerging,
PreferNoShaping,
%If (Qt_6_8_0 -)
ContextFontMerging,
%End
%If (Qt_6_8_0 -)
PreferTypoLineMetrics,
%End
};
enum Weight /BaseType=IntEnum/
{
Thin,
ExtraLight,
Light,
Normal,
Medium,
DemiBold,
Bold,
ExtraBold,
Black,
};
enum Style
{
StyleNormal,
StyleItalic,
StyleOblique,
};
enum Stretch /BaseType=IntEnum/
{
AnyStretch,
UltraCondensed,
ExtraCondensed,
Condensed,
SemiCondensed,
Unstretched,
SemiExpanded,
Expanded,
ExtraExpanded,
UltraExpanded,
};
QFont();
%If (Qt_6_1_0 -)
QFont(const QStringList &families, int pointSize = -1, int weight = -1, bool italic = false);
%End
QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
QFont(const QFont &);
QFont(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QFont>())
sipCpp = new QFont(a0->value<QFont>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QFont();
QString family() const;
void setFamily(const QString &);
int pointSize() const;
void setPointSize(int);
qreal pointSizeF() const;
void setPointSizeF(qreal);
int pixelSize() const;
void setPixelSize(int);
int weight() const [QFont::Weight ()];
void setWeight(int weight);
%MethodCode
sipCpp->setWeight(QFont::Weight(a0));
%End
void setStyle(QFont::Style style);
QFont::Style style() const;
bool underline() const;
void setUnderline(bool);
bool overline() const;
void setOverline(bool);
bool strikeOut() const;
void setStrikeOut(bool);
bool fixedPitch() const;
void setFixedPitch(bool);
bool kerning() const;
void setKerning(bool);
QFont::StyleHint styleHint() const;
QFont::StyleStrategy styleStrategy() const;
void setStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault);
void setStyleStrategy(QFont::StyleStrategy s);
int stretch() const;
void setStretch(int);
bool exactMatch() const;
bool operator==(const QFont &) const;
bool operator!=(const QFont &) const;
bool operator<(const QFont &) const;
bool isCopyOf(const QFont &) const;
QString key() const;
QString toString() const;
bool fromString(const QString &);
static QString substitute(const QString &);
static QStringList substitutes(const QString &);
static QStringList substitutions();
static void insertSubstitution(const QString &, const QString &);
static void insertSubstitutions(const QString &, const QStringList &);
static void removeSubstitutions(const QString &);
static void initialize();
static void cleanup();
static void cacheStatistics();
QString defaultFamily() const;
QFont resolve(const QFont &) const;
bool bold() const;
void setBold(bool enable);
bool italic() const;
void setItalic(bool b);
enum Capitalization
{
MixedCase,
AllUppercase,
AllLowercase,
SmallCaps,
Capitalize,
};
enum SpacingType
{
PercentageSpacing,
AbsoluteSpacing,
};
qreal letterSpacing() const;
QFont::SpacingType letterSpacingType() const;
void setLetterSpacing(QFont::SpacingType type, qreal spacing);
qreal wordSpacing() const;
void setWordSpacing(qreal spacing);
void setCapitalization(QFont::Capitalization);
QFont::Capitalization capitalization() const;
enum HintingPreference
{
PreferDefaultHinting,
PreferNoHinting,
PreferVerticalHinting,
PreferFullHinting,
};
QString styleName() const;
void setStyleName(const QString &styleName);
void setHintingPreference(QFont::HintingPreference hintingPreference);
QFont::HintingPreference hintingPreference() const;
void swap(QFont &other /Constrained/);
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
QStringList families() const;
void setFamilies(const QStringList &);
%If (Qt_6_7_0 -)
void setFeature(QFont::Tag tag, quint32 value);
%End
%If (Qt_6_6_0 - Qt_6_7_0)
void setFeature(quint32 tag, quint32 value);
%End
%If (Qt_6_6_0 - Qt_6_7_0)
void setFeature(const char *feature /Encoding="None"/, quint32 value);
%End
%If (Qt_6_7_0 -)
void unsetFeature(QFont::Tag tag);
%End
%If (Qt_6_6_0 - Qt_6_7_0)
void unsetFeature(const char *feature /Encoding="None"/);
%End
%If (Qt_6_6_0 - Qt_6_7_0)
void unsetFeature(quint32 tag);
%End
%If (Qt_6_7_0 -)
quint32 featureValue(QFont::Tag tag) const;
%End
%If (Qt_6_6_0 - Qt_6_7_0)
quint32 featureValue(quint32 tag) const;
%End
%If (Qt_6_7_0 -)
bool isFeatureSet(QFont::Tag tag) const;
%End
%If (Qt_6_6_0 - Qt_6_7_0)
bool isFeatureSet(quint32 tag) const;
%End
%If (Qt_6_7_0 -)
QList<QFont::Tag> featureTags() const;
%End
%If (Qt_6_6_0 - Qt_6_7_0)
QList<unsigned int> featureTags() const;
%End
%If (Qt_6_6_0 -)
void clearFeatures();
%End
%If (Qt_6_6_0 - Qt_6_7_0)
static QByteArray tagToString(quint32 tag);
%End
%If (Qt_6_6_0 - Qt_6_7_0)
static quint32 stringToTag(const char *tagString /Encoding="None"/);
%End
%If (Qt_6_7_0 -)
struct Tag
{
%TypeHeaderCode
#include <qfont.h>
%End
Tag();
Tag(QAnyStringView view);
%MethodCode
// This is the easiest way to implement this ctor.
std::optional<::QFont::Tag> opt_tag = ::QFont::Tag::fromString(*a0);
if (opt_tag.has_value())
sipCpp = new ::QFont::Tag(opt_tag.value());
else
sipCpp = new ::QFont::Tag;
%End
bool isValid() const;
quint32 value() const;
QByteArray toString() const;
static std::optional<QFont::Tag> fromValue(quint32 value);
static std::optional<QFont::Tag> fromString(QAnyStringView view);
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%End
%If (Qt_6_7_0 -)
void setVariableAxis(QFont::Tag tag, float value);
%End
%If (Qt_6_7_0 -)
void unsetVariableAxis(QFont::Tag tag);
%End
%If (Qt_6_7_0 -)
bool isVariableAxisSet(QFont::Tag tag) const;
%End
%If (Qt_6_7_0 -)
float variableAxisValue(QFont::Tag tag) const;
%End
%If (Qt_6_7_0 -)
void clearVariableAxes();
%End
%If (Qt_6_7_0 -)
QList<QFont::Tag> variableAxisTags() const;
%End
};
QDataStream &operator<<(QDataStream &, const QFont &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QFont & /Constrained/) /ReleaseGIL/;
%If (Qt_6_7_0 -)
QDataStream &operator<<(QDataStream &, QFont::Tag) /ReleaseGIL/;
%End
%If (Qt_6_7_0 -)
QDataStream &operator>>(QDataStream &, QFont::Tag & /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_7_0 -)
bool operator>=(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End
%If (Qt_6_7_0 -)
bool operator<=(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End
%If (Qt_6_7_0 -)
bool operator>(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End
%If (Qt_6_7_0 -)
bool operator<(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End
%If (Qt_6_7_0 -)
bool operator!=(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End
%If (Qt_6_7_0 -)
bool operator==(const QFont::Tag &lhs, const QFont::Tag &rhs);
%End

View File

@@ -0,0 +1,131 @@
// qfontdatabase.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QFontDatabase
{
%TypeHeaderCode
#include <qfontdatabase.h>
%End
public:
enum WritingSystem
{
Any,
Latin,
Greek,
Cyrillic,
Armenian,
Hebrew,
Arabic,
Syriac,
Thaana,
Devanagari,
Bengali,
Gurmukhi,
Gujarati,
Oriya,
Tamil,
Telugu,
Kannada,
Malayalam,
Sinhala,
Thai,
Lao,
Tibetan,
Myanmar,
Georgian,
Khmer,
SimplifiedChinese,
TraditionalChinese,
Japanese,
Korean,
Vietnamese,
Other,
Symbol,
Ogham,
Runic,
Nko,
};
static QList<int> standardSizes();
static QList<QFontDatabase::WritingSystem> writingSystems(const QString &family);
static QList<QFontDatabase::WritingSystem> writingSystems();
static QStringList families(QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any);
static QStringList styles(const QString &family);
static QList<int> pointSizes(const QString &family, const QString &style = QString());
static QList<int> smoothSizes(const QString &family, const QString &style);
static QString styleString(const QFontInfo &fontInfo);
static QString styleString(const QFont &font);
static QFont font(const QString &family, const QString &style, int pointSize);
static bool isBitmapScalable(const QString &family, const QString &style = QString());
static bool isSmoothlyScalable(const QString &family, const QString &style = QString());
static bool isScalable(const QString &family, const QString &style = QString());
static bool isFixedPitch(const QString &family, const QString &style = QString());
static bool italic(const QString &family, const QString &style);
static bool bold(const QString &family, const QString &style);
static int weight(const QString &family, const QString &style);
static QString writingSystemName(QFontDatabase::WritingSystem writingSystem);
static QString writingSystemSample(QFontDatabase::WritingSystem writingSystem);
static int addApplicationFont(const QString &fileName);
static int addApplicationFontFromData(const QByteArray &fontData);
static QStringList applicationFontFamilies(int id);
static bool removeApplicationFont(int id);
static bool removeAllApplicationFonts();
enum SystemFont
{
GeneralFont,
FixedFont,
TitleFont,
SmallestReadableFont,
};
static QFont systemFont(QFontDatabase::SystemFont type);
static bool isPrivateFamily(const QString &family);
%If (Qt_6_8_0 -)
static void addApplicationFallbackFontFamily(QChar::Script script, const QString &familyName);
%End
%If (Qt_6_8_0 -)
static bool removeApplicationFallbackFontFamily(QChar::Script script, const QString &familyName);
%End
%If (Qt_6_8_0 -)
static void setApplicationFallbackFontFamilies(QChar::Script, const QStringList &familyNames);
%End
%If (Qt_6_8_0 -)
static QStringList applicationFallbackFontFamilies(QChar::Script script);
%End
%If (Qt_6_9_0 -)
static void addApplicationEmojiFontFamily(const QString &familyName);
%End
%If (Qt_6_9_0 -)
static bool removeApplicationEmojiFontFamily(const QString &familyName);
%End
%If (Qt_6_9_0 -)
static void setApplicationEmojiFontFamilies(const QStringList &familyNames);
%End
%If (Qt_6_9_0 -)
static QStringList applicationEmojiFontFamilies();
%End
private:
QFontDatabase();
};

View File

@@ -0,0 +1,49 @@
// qfontinfo.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QFontInfo
{
%TypeHeaderCode
#include <qfontinfo.h>
%End
public:
QFontInfo(const QFont &);
QFontInfo(const QFontInfo &);
~QFontInfo();
QString family() const;
int pixelSize() const;
int pointSize() const;
qreal pointSizeF() const;
bool italic() const;
QFont::Style style() const;
int weight() const;
bool bold() const;
bool fixedPitch() const;
QFont::StyleHint styleHint() const;
bool exactMatch() const;
QString styleName() const;
void swap(QFontInfo &other /Constrained/);
%If (Qt_6_9_0 -)
QList<QFontVariableAxis> variableAxes() const;
%End
};

View File

@@ -0,0 +1,197 @@
// qfontmetrics.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QFontMetrics
{
%TypeHeaderCode
#include <qfontmetrics.h>
%End
public:
explicit QFontMetrics(const QFont &);
QFontMetrics(const QFont &font, const QPaintDevice *pd);
QFontMetrics(const QFontMetrics &);
~QFontMetrics();
int ascent() const;
int descent() const;
int height() const;
int leading() const;
int lineSpacing() const;
int minLeftBearing() const;
int minRightBearing() const;
int maxWidth() const;
int xHeight() const;
bool inFont(QChar) const;
int leftBearing(QChar) const;
int rightBearing(QChar) const;
%If (Qt_6_3_0 -)
QRect boundingRect(const QString &text, const QTextOption &textOption) const;
%End
QRect boundingRect(QChar) const /PyName=boundingRectChar/;
QRect boundingRect(const QString &text) const;
QRect boundingRect(const QRect &rect, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
%MethodCode
int *tabarray = qtgui_tabarray(a4);
sipRes = new QRect(sipCpp->boundingRect(*a0, a1, *a2, a3, tabarray));
if (!tabarray)
delete[] tabarray;
%End
QRect boundingRect(int x, int y, int width, int height, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
%MethodCode
int *tabarray = qtgui_tabarray(a7);
sipRes = new QRect(sipCpp->boundingRect(a0, a1, a2, a3, a4, *a5, a6, tabarray));
if (!tabarray)
delete[] tabarray;
%End
QSize size(int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
%MethodCode
int *tabarray = qtgui_tabarray(a3);
sipRes = new QSize(sipCpp->size(a0, *a1, a2, tabarray));
if (!tabarray)
delete[] tabarray;
%End
int underlinePos() const;
int overlinePos() const;
int strikeOutPos() const;
int lineWidth() const;
int averageCharWidth() const;
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
bool operator==(const QFontMetrics &other) const;
bool operator!=(const QFontMetrics &other) const;
%If (Qt_6_3_0 -)
QRect tightBoundingRect(const QString &text, const QTextOption &textOption) const;
%End
QRect tightBoundingRect(const QString &text) const;
bool inFontUcs4(uint character) const;
void swap(QFontMetrics &other /Constrained/);
int capHeight() const;
%If (Qt_6_3_0 -)
int horizontalAdvance(const QString &, const QTextOption &textOption) const;
%End
int horizontalAdvance(const QString &, int length = -1) const;
qreal fontDpi() const;
};
class QFontMetricsF
{
%TypeHeaderCode
#include <qfontmetrics.h>
%End
public:
explicit QFontMetricsF(const QFont &);
QFontMetricsF(const QFont &font, const QPaintDevice *pd);
QFontMetricsF(const QFontMetrics &);
QFontMetricsF(const QFontMetricsF &);
~QFontMetricsF();
qreal ascent() const;
qreal descent() const;
qreal height() const;
qreal leading() const;
qreal lineSpacing() const;
qreal minLeftBearing() const;
qreal minRightBearing() const;
qreal maxWidth() const;
qreal xHeight() const;
bool inFont(QChar) const;
qreal leftBearing(QChar) const;
qreal rightBearing(QChar) const;
%If (Qt_6_3_0 -)
QRectF boundingRect(const QString &text, const QTextOption &textOption) const;
%End
QRectF boundingRect(QChar) const /PyName=boundingRectChar/;
QRectF boundingRect(const QString &string) const;
QRectF boundingRect(const QRectF &rect, int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
%MethodCode
int *tabarray = qtgui_tabarray(a4);
sipRes = new QRectF(sipCpp->boundingRect(*a0, a1, *a2, a3, tabarray));
if (!tabarray)
delete[] tabarray;
%End
QSizeF size(int flags, const QString &text, int tabStops = 0, SIP_PYLIST tabArray /AllowNone,TypeHint="Optional[List[int]]"/ = 0) const;
%MethodCode
int *tabarray = qtgui_tabarray(a3);
sipRes = new QSizeF(sipCpp->size(a0, *a1, a2, tabarray));
if (!tabarray)
delete[] tabarray;
%End
qreal underlinePos() const;
qreal overlinePos() const;
qreal strikeOutPos() const;
qreal lineWidth() const;
qreal averageCharWidth() const;
QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
bool operator==(const QFontMetricsF &other) const;
bool operator!=(const QFontMetricsF &other) const;
%If (Qt_6_3_0 -)
QRectF tightBoundingRect(const QString &text, const QTextOption &textOption) const;
%End
QRectF tightBoundingRect(const QString &text) const;
bool inFontUcs4(uint character) const;
void swap(QFontMetricsF &other /Constrained/);
qreal capHeight() const;
%If (Qt_6_3_0 -)
qreal horizontalAdvance(const QString &string, const QTextOption &textOption) const;
%End
qreal horizontalAdvance(const QString &string, int length = -1) const;
qreal fontDpi() const;
};
%ModuleHeaderCode
// Used by QFontMetrics and QFontMetricsF.
int *qtgui_tabarray(PyObject *l);
%End
%ModuleCode
// Convert an optional Python list to a 0 terminated array of integers on the
// heap.
int *qtgui_tabarray(PyObject *l)
{
if (!l || l == Py_None)
return 0;
int *arr = new int[PyList_Size(l) + 1];
Py_ssize_t i;
for (i = 0; i < PyList_Size(l); ++i)
arr[i] = PyLong_AsLong(PyList_GetItem(l, i));
arr[i] = 0;
return arr;
}
%End

View File

@@ -0,0 +1,48 @@
// qfontvariableaxis.sip generated by MetaSIP
//
// This file is part of the QtGui 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 -)
class QFontVariableAxis
{
%TypeHeaderCode
#include <qfontvariableaxis.h>
%End
public:
QFontVariableAxis();
QFontVariableAxis(const QFontVariableAxis &axis);
~QFontVariableAxis();
void swap(QFontVariableAxis &other /Constrained/);
QFont::Tag tag() const;
void setTag(QFont::Tag tag);
QString name() const;
void setName(const QString &name);
qreal minimumValue() const;
void setMinimumValue(qreal minimumValue);
qreal maximumValue() const;
void setMaximumValue(qreal maximumValue);
qreal defaultValue() const;
void setDefaultValue(qreal defaultValue);
};
%End

View File

@@ -0,0 +1,942 @@
// qgenericmatrix.sip generated by MetaSIP
//
// This file is part of the QtGui 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.
// The implementation of QMatrix4x3.
class QMatrix4x3
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[12];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddddddddd",
(double)data[0], (double)data[1], (double)data[2],
(double)data[3], (double)data[4], (double)data[5],
(double)data[6], (double)data[7], (double)data[8],
(double)data[9], (double)data[10], (double)data[11]);
%End
public:
QMatrix4x3();
QMatrix4x3(const QMatrix4x3 &other);
explicit QMatrix4x3(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[12];
if ((sipError = qtgui_matrixDataFromSequence(a0, 12, values)) == sipErrorNone)
sipCpp = new QMatrix4x3(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[12];
PYQT_FLOAT data[12];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 12; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix4x3("
"%R, %R, %R, "
"%R, %R, %R, "
"%R, %R, %R, "
"%R, %R, %R)",
m[0], m[1], m[2],
m[3], m[4], m[5],
m[6], m[7], m[8],
m[9], m[10], m[11]);
}
for (i = 0; i < 12; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(12, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[12];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(12, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 3, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 3, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix3x4 transposed() const;
QMatrix4x3 &operator+=(const QMatrix4x3 &);
QMatrix4x3 &operator-=(const QMatrix4x3 &);
QMatrix4x3 &operator*=(float);
QMatrix4x3 &operator/=(float);
bool operator==(const QMatrix4x3 &) const;
bool operator!=(const QMatrix4x3 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix4x3 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix4x3 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix4x2.
class QMatrix4x2
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[8];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddddd",
(double)data[0], (double)data[1],
(double)data[2], (double)data[3],
(double)data[4], (double)data[5],
(double)data[6], (double)data[7]);
%End
public:
QMatrix4x2();
QMatrix4x2(const QMatrix4x2 &other);
explicit QMatrix4x2(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[8];
if ((sipError = qtgui_matrixDataFromSequence(a0, 8, values)) == sipErrorNone)
sipCpp = new QMatrix4x2(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[8];
PYQT_FLOAT data[8];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 8; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix4x2("
"%R, %R, "
"%R, %R, "
"%R, %R, "
"%R, %R)",
m[0], m[1],
m[2], m[3],
m[4], m[5],
m[6], m[7]);
}
for (i = 0; i < 8; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(8, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[8];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(8, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 2, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 2, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix2x4 transposed() const;
QMatrix4x2 &operator+=(const QMatrix4x2 &);
QMatrix4x2 &operator-=(const QMatrix4x2 &);
QMatrix4x2 &operator*=(float);
QMatrix4x2 &operator/=(float);
bool operator==(const QMatrix4x2 &) const;
bool operator!=(const QMatrix4x2 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix4x2 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix4x2 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix3x4.
class QMatrix3x4
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[12];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddddddddd",
(double)data[0], (double)data[1], (double)data[2],
(double)data[3], (double)data[4], (double)data[5],
(double)data[6], (double)data[7], (double)data[8],
(double)data[9], (double)data[10], (double)data[11]);
%End
public:
QMatrix3x4();
QMatrix3x4(const QMatrix3x4 &other);
explicit QMatrix3x4(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[12];
if ((sipError = qtgui_matrixDataFromSequence(a0, 12, values)) == sipErrorNone)
sipCpp = new QMatrix3x4(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[12];
PYQT_FLOAT data[12];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 12; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix3x4("
"%R, %R, %R, "
"%R, %R, %R, "
"%R, %R, %R, "
"%R, %R, %R)",
m[0], m[1], m[2],
m[3], m[4], m[5],
m[6], m[7], m[8],
m[9], m[10], m[11]);
}
for (i = 0; i < 12; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(12, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[12];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(12, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 4, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 4, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix4x3 transposed() const;
QMatrix3x4 &operator+=(const QMatrix3x4 &);
QMatrix3x4 &operator-=(const QMatrix3x4 &);
QMatrix3x4 &operator*=(float);
QMatrix3x4 &operator/=(float);
bool operator==(const QMatrix3x4 &) const;
bool operator!=(const QMatrix3x4 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix3x4 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix3x4 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix3x3.
class QMatrix3x3
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[9];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("ddddddddd",
(double)data[0], (double)data[1], (double)data[2],
(double)data[3], (double)data[4], (double)data[5],
(double)data[6], (double)data[7], (double)data[8]);
%End
public:
QMatrix3x3();
QMatrix3x3(const QMatrix3x3 &other);
explicit QMatrix3x3(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[9];
if ((sipError = qtgui_matrixDataFromSequence(a0, 9, values)) == sipErrorNone)
sipCpp = new QMatrix3x3(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[9];
PYQT_FLOAT data[9];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 9; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix3x3("
"%R, %R, %R, "
"%R, %R, %R, "
"%R, %R, %R)",
m[0], m[1], m[2],
m[3], m[4], m[5],
m[6], m[7], m[8]);
}
for (i = 0; i < 9; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(9, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[9];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(9, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 3, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 3, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix3x3 transposed() const;
QMatrix3x3 &operator+=(const QMatrix3x3 &);
QMatrix3x3 &operator-=(const QMatrix3x3 &);
QMatrix3x3 &operator*=(float);
QMatrix3x3 &operator/=(float);
bool operator==(const QMatrix3x3 &) const;
bool operator!=(const QMatrix3x3 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix3x3 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix3x3 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix3x2.
class QMatrix3x2
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[6];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddd",
(double)data[0], (double)data[1],
(double)data[2], (double)data[3],
(double)data[4], (double)data[5]);
%End
public:
QMatrix3x2();
QMatrix3x2(const QMatrix3x2 &other);
explicit QMatrix3x2(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[6];
if ((sipError = qtgui_matrixDataFromSequence(a0, 6, values)) == sipErrorNone)
sipCpp = new QMatrix3x2(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[6];
PYQT_FLOAT data[6];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 6; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix3x2("
"%R, %R, "
"%R, %R, "
"%R, %R)",
m[0], m[1],
m[2], m[3],
m[4], m[5]);
}
for (i = 0; i < 6; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(6, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[6];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(6, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 2, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 3, 2, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix2x3 transposed() const;
QMatrix3x2 &operator+=(const QMatrix3x2 &);
QMatrix3x2 &operator-=(const QMatrix3x2 &);
QMatrix3x2 &operator*=(float);
QMatrix3x2 &operator/=(float);
bool operator==(const QMatrix3x2 &) const;
bool operator!=(const QMatrix3x2 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix3x2 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix3x2 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix2x4.
class QMatrix2x4
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[8];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddddd",
(double)data[0], (double)data[1], (double)data[2], (double)data[3],
(double)data[4], (double)data[5], (double)data[6], (double)data[7]);
%End
public:
QMatrix2x4();
QMatrix2x4(const QMatrix2x4 &other);
explicit QMatrix2x4(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[8];
if ((sipError = qtgui_matrixDataFromSequence(a0, 8, values)) == sipErrorNone)
sipCpp = new QMatrix2x4(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[8];
PYQT_FLOAT data[8];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 8; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix2x4("
"%R, %R, %R, %R, "
"%R, %R, %R, %R)",
m[0], m[1], m[2], m[3],
m[4], m[5], m[6], m[7]);
}
for (i = 0; i < 8; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(8, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[8];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(8, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 4, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 4, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix4x2 transposed() const;
QMatrix2x4 &operator+=(const QMatrix2x4 &);
QMatrix2x4 &operator-=(const QMatrix2x4 &);
QMatrix2x4 &operator*=(float);
QMatrix2x4 &operator/=(float);
bool operator==(const QMatrix2x4 &) const;
bool operator!=(const QMatrix2x4 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix2x4 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix2x4 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix2x3.
class QMatrix2x3
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[6];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddd",
(double)data[0], (double)data[1], (double)data[2],
(double)data[3], (double)data[4], (double)data[5]);
%End
public:
QMatrix2x3();
QMatrix2x3(const QMatrix2x3 &other);
explicit QMatrix2x3(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[6];
if ((sipError = qtgui_matrixDataFromSequence(a0, 6, values)) == sipErrorNone)
sipCpp = new QMatrix2x3(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[6];
PYQT_FLOAT data[6];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 6; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix2x3("
"%R, %R, %R, "
"%R, %R, %R)",
m[0], m[1], m[2],
m[3], m[4], m[5]);
}
for (i = 0; i < 6; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(6, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[6];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(6, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 3, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 3, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix3x2 transposed() const;
QMatrix2x3 &operator+=(const QMatrix2x3 &);
QMatrix2x3 &operator-=(const QMatrix2x3 &);
QMatrix2x3 &operator*=(float);
QMatrix2x3 &operator/=(float);
bool operator==(const QMatrix2x3 &) const;
bool operator!=(const QMatrix2x3 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix2x3 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix2x3 & /Constrained/) /ReleaseGIL/;
// The implementation of QMatrix2x2.
class QMatrix2x2
{
%TypeHeaderCode
#include <qgenericmatrix.h>
%End
%PickleCode
PYQT_FLOAT data[4];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddd",
(double)data[0], (double)data[1],
(double)data[2], (double)data[3]);
%End
public:
QMatrix2x2();
QMatrix2x2(const QMatrix2x2 &other);
explicit QMatrix2x2(SIP_PYOBJECT values /TypeHint="Sequence[float]"/);
%MethodCode
PYQT_FLOAT values[4];
if ((sipError = qtgui_matrixDataFromSequence(a0, 4, values)) == sipErrorNone)
sipCpp = new QMatrix2x2(values);
%End
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[4];
PYQT_FLOAT data[4];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 4; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix2x2("
"%R, %R, "
"%R, %R)",
m[0], m[1],
m[2], m[3]);
}
for (i = 0; i < 4; ++i)
Py_XDECREF(m[i]);
%End
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(4, sipCpp->constData(), &sipRes);
%End
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
PYQT_FLOAT values[4];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(4, values, &sipRes);
%End
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 2, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, float);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 2, 2, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix2x2 transposed() const;
QMatrix2x2 &operator+=(const QMatrix2x2 &);
QMatrix2x2 &operator-=(const QMatrix2x2 &);
QMatrix2x2 &operator*=(float);
QMatrix2x2 &operator/=(float);
bool operator==(const QMatrix2x2 &) const;
bool operator!=(const QMatrix2x2 &) const;
};
QDataStream &operator<<(QDataStream &, const QMatrix2x2 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix2x2 & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,84 @@
// qglyphrun.sip generated by MetaSIP
//
// This file is part of the QtGui 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 (PyQt_RawFont)
class QGlyphRun
{
%TypeHeaderCode
#include <qglyphrun.h>
%End
public:
QGlyphRun();
QGlyphRun(const QGlyphRun &other);
~QGlyphRun();
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
QList<unsigned int> glyphIndexes() const;
void setGlyphIndexes(const QList<unsigned int> &glyphIndexes);
QList<QPointF> positions() const;
void setPositions(const QList<QPointF> &positions);
void clear();
bool operator==(const QGlyphRun &other) const;
bool operator!=(const QGlyphRun &other) const;
void setOverline(bool overline);
bool overline() const;
void setUnderline(bool underline);
bool underline() const;
void setStrikeOut(bool strikeOut);
bool strikeOut() const;
enum GlyphRunFlag /BaseType=Flag/
{
Overline,
Underline,
StrikeOut,
RightToLeft,
SplitLigature,
};
typedef QFlags<QGlyphRun::GlyphRunFlag> GlyphRunFlags;
void setRightToLeft(bool on);
bool isRightToLeft() const;
void setFlag(QGlyphRun::GlyphRunFlag flag, bool enabled = true);
void setFlags(QGlyphRun::GlyphRunFlags flags);
QGlyphRun::GlyphRunFlags flags() const;
void setBoundingRect(const QRectF &boundingRect);
QRectF boundingRect() const;
bool isEmpty() const;
void swap(QGlyphRun &other /Constrained/);
%If (Qt_6_5_0 -)
QList<qsizetype> stringIndexes() const;
%End
%If (Qt_6_5_0 -)
void setStringIndexes(const QList<qsizetype> &stringIndexes);
%End
%If (Qt_6_5_0 -)
void setSourceString(const QString &sourceString);
%End
%If (Qt_6_5_0 -)
QString sourceString() const;
%End
};
%End

View File

@@ -0,0 +1,302 @@
// qguiapplication.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QGuiApplication : public QCoreApplication
{
%TypeHeaderCode
#include <qguiapplication.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QAbstractTextDocumentLayout, &sipType_QAbstractTextDocumentLayout, -1, 1},
#if QT_VERSION >= 0x060a00
{sipName_QAccessibilityHints, &sipType_QAccessibilityHints, -1, 2},
#else
{0, 0, -1, 2},
#endif
{sipName_QAction, &sipType_QAction, -1, 3},
{sipName_QActionGroup, &sipType_QActionGroup, -1, 4},
{sipName_QClipboard, &sipType_QClipboard, -1, 5},
{sipName_QValidator, &sipType_QValidator, 27, 6},
{sipName_QDrag, &sipType_QDrag, -1, 7},
{sipName_QFileSystemModel, &sipType_QFileSystemModel, -1, 8},
{sipName_QGuiApplication, &sipType_QGuiApplication, -1, 9},
{sipName_QInputDevice, &sipType_QInputDevice, 30, 10},
{sipName_QInputMethod, &sipType_QInputMethod, -1, 11},
{sipName_QMovie, &sipType_QMovie, -1, 12},
{sipName_QOffscreenSurface, &sipType_QOffscreenSurface, -1, 13},
#if defined(SIP_FEATURE_PyQt_OpenGL)
{sipName_QOpenGLContext, &sipType_QOpenGLContext, -1, 14},
#else
{0, 0, -1, 14},
#endif
#if defined(SIP_FEATURE_PyQt_OpenGL)
{sipName_QOpenGLContextGroup, &sipType_QOpenGLContextGroup, -1, 15},
#else
{0, 0, -1, 15},
#endif
{sipName_QWindow, &sipType_QWindow, 31, 16},
{sipName_QPdfWriter, &sipType_QPdfWriter, -1, 17},
{sipName_QScreen, &sipType_QScreen, -1, 18},
#if defined(SIP_FEATURE_PyQt_SessionManager)
{sipName_QSessionManager, &sipType_QSessionManager, -1, 19},
#else
{0, 0, -1, 19},
#endif
{sipName_QShortcut, &sipType_QShortcut, -1, 20},
{sipName_QStandardItemModel, &sipType_QStandardItemModel, -1, 21},
{sipName_QStyleHints, &sipType_QStyleHints, -1, 22},
{sipName_QSyntaxHighlighter, &sipType_QSyntaxHighlighter, -1, 23},
{sipName_QTextObject, &sipType_QTextObject, 33, 24},
{sipName_QTextDocument, &sipType_QTextDocument, -1, 25},
{sipName_QUndoGroup, &sipType_QUndoGroup, -1, 26},
{sipName_QUndoStack, &sipType_QUndoStack, -1, -1},
{sipName_QDoubleValidator, &sipType_QDoubleValidator, -1, 28},
{sipName_QIntValidator, &sipType_QIntValidator, -1, 29},
{sipName_QRegularExpressionValidator, &sipType_QRegularExpressionValidator, -1, -1},
{sipName_QPointingDevice, &sipType_QPointingDevice, -1, -1},
{sipName_QPaintDeviceWindow, &sipType_QPaintDeviceWindow, 32, -1},
{sipName_QRasterWindow, &sipType_QRasterWindow, -1, -1},
{sipName_QTextBlockGroup, &sipType_QTextBlockGroup, 35, 34},
{sipName_QTextFrame, &sipType_QTextFrame, 36, -1},
{sipName_QTextList, &sipType_QTextList, -1, -1},
{sipName_QTextTable, &sipType_QTextTable, -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:
QGuiApplication(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_qtgui_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 sipQGuiApplication(nargc, argv, QT_VERSION);
Py_END_ALLOW_THREADS
// Now modify the original list.
pyqt6_qtgui_update_argv_list(a0, argc, argv);
}
%End
virtual ~QGuiApplication() /ReleaseGIL/;
%MethodCode
pyqt6_qtgui_cleanup_qobjects();
%End
static QWindowList allWindows();
static QWindowList topLevelWindows();
static QWindow *topLevelAt(const QPoint &pos);
static QString platformName();
static QWindow *focusWindow();
static QObject *focusObject();
static QScreen *primaryScreen();
static QList<QScreen *> screens();
static QCursor *overrideCursor();
static void setOverrideCursor(const QCursor &);
static void changeOverrideCursor(const QCursor &);
static void restoreOverrideCursor();
static QFont font();
static void setFont(const QFont &);
static QClipboard *clipboard();
static QPalette palette();
static void setPalette(const QPalette &pal);
static Qt::KeyboardModifiers keyboardModifiers();
static Qt::KeyboardModifiers queryKeyboardModifiers();
static Qt::MouseButtons mouseButtons();
static void setLayoutDirection(Qt::LayoutDirection direction);
static Qt::LayoutDirection layoutDirection();
static bool isRightToLeft();
static bool isLeftToRight();
static void setDesktopSettingsAware(bool on);
static bool desktopSettingsAware();
static void setQuitOnLastWindowClosed(bool quit);
static bool quitOnLastWindowClosed();
static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/;
virtual bool notify(QObject *, QEvent *);
signals:
void fontDatabaseChanged();
void screenAdded(QScreen *screen);
void lastWindowClosed();
void focusObjectChanged(QObject *focusObject);
%If (PyQt_SessionManager)
void commitDataRequest(QSessionManager &sessionManager);
%End
%If (PyQt_SessionManager)
void saveStateRequest(QSessionManager &sessionManager);
%End
void focusWindowChanged(QWindow *focusWindow);
void applicationStateChanged(Qt::ApplicationState state);
void applicationDisplayNameChanged();
public:
static void setApplicationDisplayName(const QString &name);
static QString applicationDisplayName();
static QWindow *modalWindow();
static QStyleHints *styleHints();
static QInputMethod *inputMethod();
qreal devicePixelRatio() const;
%If (PyQt_SessionManager)
bool isSessionRestored() const;
%End
%If (PyQt_SessionManager)
QString sessionId() const;
%End
%If (PyQt_SessionManager)
QString sessionKey() const;
%End
%If (PyQt_SessionManager)
bool isSavingSession() const;
%End
static Qt::ApplicationState applicationState();
static void sync();
static void setWindowIcon(const QIcon &icon);
static QIcon windowIcon();
signals:
void screenRemoved(QScreen *screen);
void layoutDirectionChanged(Qt::LayoutDirection direction);
void primaryScreenChanged(QScreen *screen);
public:
static void setDesktopFileName(const QString &name);
static QString desktopFileName();
static QScreen *screenAt(const QPoint &point);
static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
%If (Qt_6_5_0 -)
void setBadgeNumber(qint64 number);
%End
SIP_PYOBJECT nativeInterface(SIP_PYTYPE platform) const;
%MethodCode
bool handled = false;
#if defined(SIP_FEATURE_PyQt_Wayland)
if (a0 == (PyObject *)sipTypeAsPyTypeObject(sipType_QNativeInterface_QWaylandApplication))
{
auto *iface = sipCpp->nativeInterface<QNativeInterface::QWaylandApplication>();
if (iface)
{
sipRes = sipConvertFromType(iface, sipType_QNativeInterface_QWaylandApplication, SIP_NULLPTR);
handled = true;
}
}
#endif
#if defined(SIP_FEATURE_PyQt_XCB)
if (a0 == (PyObject *)sipTypeAsPyTypeObject(sipType_QNativeInterface_QX11Application))
{
auto *iface = sipCpp->nativeInterface<QNativeInterface::QX11Application>();
if (iface)
{
sipRes = sipConvertFromType(iface, sipType_QNativeInterface_QX11Application, SIP_NULLPTR);
handled = true;
}
}
#endif
if (!handled)
{
sipRes = Py_None;
Py_INCREF(sipRes);
}
%End
protected:
virtual bool event(QEvent *);
};
%ModuleHeaderCode
// Imports from QtCore.
typedef void (*pyqt6_qtgui_cleanup_qobjects_t)();
extern pyqt6_qtgui_cleanup_qobjects_t pyqt6_qtgui_cleanup_qobjects;
typedef char **(*pyqt6_qtgui_from_argv_list_t)(PyObject *, int &);
extern pyqt6_qtgui_from_argv_list_t pyqt6_qtgui_from_argv_list;
typedef void (*pyqt6_qtgui_update_argv_list_t)(PyObject *, int, char **);
extern pyqt6_qtgui_update_argv_list_t pyqt6_qtgui_update_argv_list;
%End
%ModuleCode
// Imports from QtCore.
pyqt6_qtgui_cleanup_qobjects_t pyqt6_qtgui_cleanup_qobjects;
pyqt6_qtgui_from_argv_list_t pyqt6_qtgui_from_argv_list;
pyqt6_qtgui_update_argv_list_t pyqt6_qtgui_update_argv_list;
// Forward declarations not in any header files but are part of the API.
void qt_set_sequence_auto_mnemonic(bool enable);
%End
%InitialisationCode
// Export our own helpers.
sipExportSymbol("qtgui_wrap_ancestors", (void *)qtgui_wrap_ancestors);
%End
%PostInitialisationCode
// Imports from QtCore.
pyqt6_qtgui_cleanup_qobjects = (pyqt6_qtgui_cleanup_qobjects_t)sipImportSymbol("pyqt6_cleanup_qobjects");
Q_ASSERT(pyqt6_qtgui_cleanup_qobjects);
pyqt6_qtgui_from_argv_list = (pyqt6_qtgui_from_argv_list_t)sipImportSymbol("pyqt6_from_argv_list");
Q_ASSERT(pyqt6_qtgui_from_argv_list);
pyqt6_qtgui_update_argv_list = (pyqt6_qtgui_update_argv_list_t)sipImportSymbol("pyqt6_update_argv_list");
Q_ASSERT(pyqt6_qtgui_update_argv_list);
%End

View File

@@ -0,0 +1,265 @@
// qicon.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QIcon /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qicon.h>
%End
public:
enum Mode
{
Normal,
Disabled,
Active,
Selected,
};
enum State
{
On,
Off,
};
%If (Qt_6_7_0 -)
enum class ThemeIcon
{
AddressBookNew,
ApplicationExit,
AppointmentNew,
CallStart,
CallStop,
ContactNew,
DocumentNew,
DocumentOpen,
DocumentOpenRecent,
DocumentPageSetup,
DocumentPrint,
DocumentPrintPreview,
DocumentProperties,
DocumentRevert,
DocumentSave,
DocumentSaveAs,
DocumentSend,
EditClear,
EditCopy,
EditCut,
EditDelete,
EditFind,
EditPaste,
EditRedo,
EditSelectAll,
EditUndo,
FolderNew,
FormatIndentLess,
FormatIndentMore,
FormatJustifyCenter,
FormatJustifyFill,
FormatJustifyLeft,
FormatJustifyRight,
FormatTextDirectionLtr,
FormatTextDirectionRtl,
FormatTextBold,
FormatTextItalic,
FormatTextUnderline,
FormatTextStrikethrough,
GoDown,
GoHome,
GoNext,
GoPrevious,
GoUp,
HelpAbout,
HelpFaq,
InsertImage,
InsertLink,
InsertText,
ListAdd,
ListRemove,
MailForward,
MailMarkImportant,
MailMarkRead,
MailMarkUnread,
MailMessageNew,
MailReplyAll,
MailReplySender,
MailSend,
MediaEject,
MediaPlaybackPause,
MediaPlaybackStart,
MediaPlaybackStop,
MediaRecord,
MediaSeekBackward,
MediaSeekForward,
MediaSkipBackward,
MediaSkipForward,
ObjectRotateLeft,
ObjectRotateRight,
ProcessStop,
SystemLockScreen,
SystemLogOut,
SystemSearch,
SystemReboot,
SystemShutdown,
ToolsCheckSpelling,
ViewFullscreen,
ViewRefresh,
ViewRestore,
WindowClose,
WindowNew,
ZoomFitBest,
ZoomIn,
ZoomOut,
AudioCard,
AudioInputMicrophone,
Battery,
CameraPhoto,
CameraVideo,
CameraWeb,
Computer,
DriveHarddisk,
DriveOptical,
InputGaming,
InputKeyboard,
InputMouse,
InputTablet,
MediaFlash,
MediaOptical,
MediaTape,
MultimediaPlayer,
NetworkWired,
NetworkWireless,
Phone,
Printer,
Scanner,
VideoDisplay,
AppointmentMissed,
AppointmentSoon,
AudioVolumeHigh,
AudioVolumeLow,
AudioVolumeMedium,
AudioVolumeMuted,
BatteryCaution,
BatteryLow,
DialogError,
DialogInformation,
DialogPassword,
DialogQuestion,
DialogWarning,
FolderDragAccept,
FolderOpen,
FolderVisiting,
ImageLoading,
ImageMissing,
MailAttachment,
MailUnread,
MailRead,
MailReplied,
MediaPlaylistRepeat,
MediaPlaylistShuffle,
NetworkOffline,
PrinterPrinting,
SecurityHigh,
SecurityLow,
SoftwareUpdateAvailable,
SoftwareUpdateUrgent,
SyncError,
SyncSynchronizing,
UserAvailable,
UserOffline,
WeatherClear,
WeatherClearNight,
WeatherFewClouds,
WeatherFewCloudsNight,
WeatherFog,
WeatherShowers,
WeatherSnow,
WeatherStorm,
};
%End
QIcon();
QIcon(const QPixmap &pixmap);
QIcon(const QIcon &other);
explicit QIcon(const QString &fileName);
explicit QIcon(QIconEngine *engine /GetWrapper/);
%MethodCode
sipCpp = new QIcon(a0);
// The QIconEngine is implicitly shared by copies of the QIcon and is destroyed
// by C++ when the last copy is destroyed. Therefore we need to transfer
// ownership but not to associate it with this QIcon. The Python object will
// get tidied up when the virtual dtor gets called.
sipTransferTo(a0Wrapper, Py_None);
%End
QIcon(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QIcon>())
sipCpp = new QIcon(a0->value<QIcon>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QIcon();
QPixmap pixmap(const QSize &size, qreal devicePixelRatio, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
QPixmap pixmap(const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
QPixmap pixmap(int w, int h, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
QPixmap pixmap(int extent, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
QSize actualSize(const QSize &size, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment = Qt::AlignCenter, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off) const;
bool isNull() const;
bool isDetached() const;
void addPixmap(const QPixmap &pixmap, QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off);
void addFile(const QString &fileName, const QSize &size = QSize(), QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off);
qint64 cacheKey() const;
static QIcon fromTheme(const QString &name);
static QIcon fromTheme(const QString &name, const QIcon &fallback);
%If (Qt_6_7_0 -)
static QIcon fromTheme(QIcon::ThemeIcon icon);
%End
%If (Qt_6_7_0 -)
static QIcon fromTheme(QIcon::ThemeIcon icon, const QIcon &fallback);
%End
static bool hasThemeIcon(const QString &name);
%If (Qt_6_7_0 -)
static bool hasThemeIcon(QIcon::ThemeIcon icon);
%End
static QStringList themeSearchPaths();
static void setThemeSearchPaths(const QStringList &searchpath);
static QString themeName();
static void setThemeName(const QString &path);
QString name() const;
void swap(QIcon &other /Constrained/);
void setIsMask(bool isMask);
bool isMask() const;
static QStringList fallbackSearchPaths();
static void setFallbackSearchPaths(const QStringList &paths);
static QString fallbackThemeName();
static void setFallbackThemeName(const QString &name);
};
QDataStream &operator<<(QDataStream &, const QIcon &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QIcon & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,70 @@
// qiconengine.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QIconEngine /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qiconengine.h>
%End
public:
QIconEngine();
protected:
QIconEngine(const QIconEngine &other);
public:
virtual ~QIconEngine();
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) = 0;
virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
virtual void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state);
virtual void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state);
virtual QString key() const;
virtual QIconEngine *clone() const = 0 /Factory/;
virtual bool read(QDataStream &in);
virtual bool write(QDataStream &out) const;
enum IconEngineHook
{
IsNullHook,
ScaledPixmapHook,
};
virtual QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal, QIcon::State state = QIcon::Off);
virtual QString iconName();
virtual bool isNull();
virtual QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale);
struct ScaledPixmapArgument
{
%TypeHeaderCode
#include <qiconengine.h>
%End
QSize size;
QIcon::Mode mode;
QIcon::State state;
qreal scale;
QPixmap pixmap;
};
};

View File

@@ -0,0 +1,419 @@
// qimage.sip generated by MetaSIP
//
// This file is part of the QtGui 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 (Windows)
typedef struct HBITMAP__ *HBITMAP;
%End
%If (Windows)
typedef struct HICON__ *HICON;
%End
class QImage : public QPaintDevice
{
%TypeHeaderCode
#include <qimage.h>
%End
%TypeCode
// The C++ closure that is passed to the QImage ctor.
struct QtGui_QImage_closure
{
PyObject *py_cleanup;
PyObject *py_closure;
};
// Return the optional C++ closure for a QImage ctor.
static QtGui_QImage_closure *QtGui_QImage_buffer(PyObject *py_cleanup,
PyObject *py_closure)
{
// The cleanup callable or nullptr if there isn't one.
if (py_cleanup == Py_None)
py_cleanup = nullptr;
if (!py_cleanup)
return nullptr;
QtGui_QImage_closure *closure = new QtGui_QImage_closure;
Py_INCREF(py_cleanup);
if (!py_closure)
py_closure = Py_None;
Py_INCREF(py_closure);
closure->py_cleanup = py_cleanup;
closure->py_closure = py_closure;
return closure;
}
// The cleanup function for a QImage ctor.
static void QtGui_QImage_cleanup(void *c)
{
SIP_BLOCK_THREADS
QtGui_QImage_closure *closure = reinterpret_cast<QtGui_QImage_closure *>(c);
bool is_exception = false;
PyObject *res = PyObject_CallFunctionObjArgs(closure->py_cleanup,
closure->py_closure, SIP_NULLPTR);
Py_DECREF(closure->py_closure);
Py_DECREF(closure->py_cleanup);
if (res)
Py_DECREF(res);
else
is_exception = true;
delete closure;
if (is_exception)
pyqt6_qtgui_err_print();
SIP_UNBLOCK_THREADS
}
%End
public:
enum InvertMode
{
InvertRgb,
InvertRgba,
};
enum Format
{
Format_Invalid,
Format_Mono,
Format_MonoLSB,
Format_Indexed8,
Format_RGB32,
Format_ARGB32,
Format_ARGB32_Premultiplied,
Format_RGB16,
Format_ARGB8565_Premultiplied,
Format_RGB666,
Format_ARGB6666_Premultiplied,
Format_RGB555,
Format_ARGB8555_Premultiplied,
Format_RGB888,
Format_RGB444,
Format_ARGB4444_Premultiplied,
Format_RGBX8888,
Format_RGBA8888,
Format_RGBA8888_Premultiplied,
Format_BGR30,
Format_A2BGR30_Premultiplied,
Format_RGB30,
Format_A2RGB30_Premultiplied,
Format_Alpha8,
Format_Grayscale8,
Format_RGBX64,
Format_RGBA64,
Format_RGBA64_Premultiplied,
Format_Grayscale16,
Format_BGR888,
%If (Qt_6_2_0 -)
Format_RGBX16FPx4,
%End
%If (Qt_6_2_0 -)
Format_RGBA16FPx4,
%End
%If (Qt_6_2_0 -)
Format_RGBA16FPx4_Premultiplied,
%End
%If (Qt_6_2_0 -)
Format_RGBX32FPx4,
%End
%If (Qt_6_2_0 -)
Format_RGBA32FPx4,
%End
%If (Qt_6_2_0 -)
Format_RGBA32FPx4_Premultiplied,
%End
%If (Qt_6_8_0 -)
Format_CMYK8888,
%End
};
QImage();
QImage(const QSize &size, QImage::Format format);
QImage(int width, int height, QImage::Format format);
QImage(const uchar *data /KeepReference/, int width, int height, QImage::Format format, SIP_PYCALLABLE cleanupFunction /AllowNone/ = 0, SIP_PYOBJECT cleanupInfo /AllowNone/ = 0) [(const uchar *data, int width, int height, QImage::Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0)];
%MethodCode
QtGui_QImage_closure *closure = QtGui_QImage_buffer(a4, a5);
sipCpp = new sipQImage(a0, a1, a2, a3,
(closure ? QtGui_QImage_cleanup : nullptr), closure);
%End
QImage(const uchar *data /KeepReference/, int width, int height, qsizetype bytesPerLine, QImage::Format format, SIP_PYCALLABLE cleanupFunction /AllowNone/ = 0, SIP_PYOBJECT cleanupInfo /AllowNone/ = 0) [(const uchar *data, int width, int height, qsizetype bytesPerLine, QImage::Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0)];
%MethodCode
QtGui_QImage_closure *closure = QtGui_QImage_buffer(a5, a6);
sipCpp = new sipQImage(a0, a1, a2, a3, a4,
(closure ? QtGui_QImage_cleanup : nullptr), closure);
%End
QImage(void *data /KeepReference/, int width, int height, QImage::Format format, SIP_PYCALLABLE cleanupFunction /AllowNone/ = 0, SIP_PYOBJECT cleanupInfo /AllowNone/ = 0) /NoTypeHint/ [(uchar *data, int width, int height, QImage::Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0)];
%MethodCode
QtGui_QImage_closure *closure = QtGui_QImage_buffer(a4, a5);
sipCpp = new sipQImage(reinterpret_cast<uchar *>(a0), a1, a2, a3,
(closure ? QtGui_QImage_cleanup : nullptr), closure);
%End
QImage(void *data /KeepReference/, int width, int height, qsizetype bytesPerLine, QImage::Format format, SIP_PYCALLABLE cleanupFunction /AllowNone/ = 0, SIP_PYOBJECT cleanupInfo /AllowNone/ = 0) /NoTypeHint/ [(uchar *data, int width, int height, qsizetype bytesPerLine, QImage::Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0)];
%MethodCode
QtGui_QImage_closure *closure = QtGui_QImage_buffer(a5, a6);
sipCpp = new sipQImage(reinterpret_cast<uchar *>(a0), a1, a2, a3, a4,
(closure ? QtGui_QImage_cleanup : nullptr), closure);
%End
explicit QImage(SIP_PYLIST xpm /TypeHint="List[str]"/) [(const char * const *xpm)];
%MethodCode
// The Python interface is a list of ASCII strings that make up the image.
const char **str = QtGui_ListToArray(a0);
if (str)
{
sipCpp = new sipQImage(str);
QtGui_DeleteArray(str);
}
else
sipIsErr = 1;
%End
QImage(const QString &fileName, const char *format = 0) /ReleaseGIL/;
QImage(const QImage &);
QImage(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QImage>())
sipCpp = new sipQImage(a0->value<QImage>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
virtual ~QImage();
bool isNull() const;
bool operator==(const QImage &) const;
bool operator!=(const QImage &) const;
QImage copy(const QRect &rect = QRect()) const;
QImage copy(int x, int y, int w, int h) const;
QImage::Format format() const;
QImage convertToFormat(QImage::Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
QImage convertToFormat(QImage::Format f, const QList<unsigned int> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
%If (Windows)
HBITMAP toHBITMAP() const;
%End
%If (Windows)
static QImage fromHBITMAP(HBITMAP hbitmap);
%End
%If (Windows)
HICON toHICON(const QImage &mask = {}) const;
%End
%If (Windows)
static QImage fromHICON(HICON hicon);
%End
int width() const;
int height() const;
QSize size() const;
QRect rect() const;
int depth() const;
QRgb color(int i) const;
void setColor(int i, QRgb c);
bool allGray() const;
bool isGrayscale() const;
void *bits() [uchar * ()];
const void *constBits() const [const uchar * ()];
void *scanLine(int) [uchar * (int)];
const void *constScanLine(int) const [const uchar * (int)];
qsizetype bytesPerLine() const;
bool valid(const QPoint &pt) const;
bool valid(int x, int y) const;
int pixelIndex(const QPoint &pt) const;
int pixelIndex(int x, int y) const;
QRgb pixel(const QPoint &pt) const;
QRgb pixel(int x, int y) const;
void setPixel(const QPoint &pt, uint index_or_rgb);
void setPixel(int x, int y, uint index_or_rgb);
QList<unsigned int> colorTable() const;
void setColorTable(const QList<unsigned int> &colors);
void fill(uint pixel);
void fill(Qt::GlobalColor color /Constrained/);
void fill(const QColor &color);
bool hasAlphaChannel() const;
void setAlphaChannel(const QImage &alphaChannel);
QImage createAlphaMask(Qt::ImageConversionFlags flags = Qt::AutoColor) const;
QImage createHeuristicMask(bool clipTight = true) const;
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
QImage scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
QImage scaledToWidth(int width, Qt::TransformationMode mode = Qt::FastTransformation) const;
QImage scaledToHeight(int height, Qt::TransformationMode mode = Qt::FastTransformation) const;
QImage mirrored(bool horizontal = false, bool vertical = true) const;
void mirror(bool horizontal = false, bool vertical = true);
QImage rgbSwapped() const;
void rgbSwap();
void invertPixels(QImage::InvertMode mode = QImage::InvertRgb);
bool load(QIODevice *device, const char *format) /ReleaseGIL/;
bool load(const QString &fileName, const char *format = 0) /ReleaseGIL/;
bool loadFromData(const uchar *data /Array/, int len /ArraySize/, const char *format = 0);
bool loadFromData(const QByteArray &data, const char *format = 0);
bool save(const QString &fileName, const char *format = 0, int quality = -1) const /ReleaseGIL/;
bool save(QIODevice *device, const char *format = 0, int quality = -1) const /ReleaseGIL/;
static QImage fromData(const uchar *data /Array/, int size /ArraySize/, const char *format = 0);
static QImage fromData(const QByteArray &data, const char *format = 0);
virtual QPaintEngine *paintEngine() const;
int dotsPerMeterX() const;
int dotsPerMeterY() const;
void setDotsPerMeterX(int);
void setDotsPerMeterY(int);
QPoint offset() const;
void setOffset(const QPoint &);
QStringList textKeys() const;
QString text(const QString &key = QString()) const;
void setText(const QString &key, const QString &value);
QImage createMaskFromColor(QRgb color, Qt::MaskMode mode = Qt::MaskInColor) const;
QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const;
static QTransform trueMatrix(const QTransform &, int w, int h);
qint64 cacheKey() const;
int colorCount() const;
void setColorCount(int);
int bitPlaneCount() const;
void swap(QImage &other /Constrained/);
qreal devicePixelRatio() const;
void setDevicePixelRatio(qreal scaleFactor);
QPixelFormat pixelFormat() const;
static QPixelFormat toPixelFormat(QImage::Format format);
static QImage::Format toImageFormat(QPixelFormat format);
QColor pixelColor(int x, int y) const;
QColor pixelColor(const QPoint &pt) const;
void setPixelColor(int x, int y, const QColor &c);
void setPixelColor(const QPoint &pt, const QColor &c);
bool reinterpretAsFormat(QImage::Format f);
qsizetype sizeInBytes() const;
QImage convertedTo(QImage::Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
void convertTo(QImage::Format f, Qt::ImageConversionFlags flags = Qt::AutoColor);
QColorSpace colorSpace() const;
void setColorSpace(const QColorSpace &);
QImage convertedToColorSpace(const QColorSpace &) const;
%If (Qt_6_8_0 -)
QImage convertedToColorSpace(const QColorSpace &colorSpace, QImage::Format format, Qt::ImageConversionFlags flags = Qt::AutoColor);
%End
void convertToColorSpace(const QColorSpace &);
%If (Qt_6_8_0 -)
void convertToColorSpace(const QColorSpace &colorSpace, QImage::Format format, Qt::ImageConversionFlags flags = Qt::AutoColor);
%End
void applyColorTransform(const QColorTransform &transform);
%If (Qt_6_8_0 -)
void applyColorTransform(const QColorTransform &transform, QImage::Format format, Qt::ImageConversionFlags flags = Qt::AutoColor);
%End
%If (Qt_6_2_0 -)
QSizeF deviceIndependentSize() const;
%End
%If (Qt_6_4_0 -)
QImage colorTransformed(const QColorTransform &transform) const;
%End
%If (Qt_6_8_0 -)
QImage colorTransformed(const QColorTransform &transform, QImage::Format format, Qt::ImageConversionFlags flags = Qt::AutoColor);
%End
%If (Qt_6_9_0 -)
QImage flipped(Qt::Orientations orient = Qt::Vertical) const;
%End
%If (Qt_6_9_0 -)
void flip(Qt::Orientations orient = Qt::Vertical);
%End
};
QDataStream &operator<<(QDataStream &, const QImage &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QImage & /Constrained/) /ReleaseGIL/;
%ModuleHeaderCode
// Helpers for QImage and QPixmap ctors.
const char **QtGui_ListToArray(PyObject *lst);
void QtGui_DeleteArray(const char **arr);
// Imports from QtCore.
typedef void (*pyqt6_qtgui_err_print_t)();
extern pyqt6_qtgui_err_print_t pyqt6_qtgui_err_print;
%End
%ModuleCode
// Convert a list of strings to an array of ASCII strings on the heap. Used by
// QImage and QPixmap.
const char **QtGui_ListToArray(PyObject *lst)
{
Py_ssize_t nstr = PyList_Size(lst);
const char **arr = new const char *[nstr + 1];
for (Py_ssize_t i = 0; i < nstr; ++i)
{
PyObject *ascii_obj = PyList_GetItem(lst, i);
const char *ascii = sipString_AsASCIIString(&ascii_obj);
if (!ascii)
{
while (i-- > 0)
delete[] arr[i];
delete[] arr;
return 0;
}
// Copy the string.
arr[i] = qstrdup(ascii);
Py_DECREF(ascii_obj);
}
// The sentinal.
arr[nstr] = 0;
return arr;
}
// Return a string array created by QtGui_ListToArray() to the heap.
void QtGui_DeleteArray(const char **arr)
{
for (Py_ssize_t i = 0; arr[i]; ++i)
delete[] arr[i];
delete[] arr;
}
// Imports from QtCore.
pyqt6_qtgui_err_print_t pyqt6_qtgui_err_print;
%End
%PostInitialisationCode
// Imports from QtCore.
pyqt6_qtgui_err_print = (pyqt6_qtgui_err_print_t)sipImportSymbol("pyqt6_err_print");
Q_ASSERT(pyqt6_qtgui_err_print);
%End

View File

@@ -0,0 +1,88 @@
// qimageiohandler.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QImageIOHandler
{
%TypeHeaderCode
#include <qimageiohandler.h>
%End
public:
enum ImageOption
{
Size,
ClipRect,
Description,
ScaledClipRect,
ScaledSize,
CompressionRatio,
Gamma,
Quality,
Name,
SubType,
IncrementalReading,
Endianness,
Animation,
BackgroundColor,
SupportedSubTypes,
OptimizedWrite,
ProgressiveScanWrite,
ImageTransformation,
};
QImageIOHandler();
virtual ~QImageIOHandler();
void setDevice(QIODevice *device);
QIODevice *device() const;
void setFormat(const QByteArray &format);
QByteArray format() const;
virtual bool canRead() const = 0;
virtual bool read(QImage *image) = 0;
virtual bool write(const QImage &image);
virtual QVariant option(QImageIOHandler::ImageOption option) const;
virtual void setOption(QImageIOHandler::ImageOption option, const QVariant &value);
virtual bool supportsOption(QImageIOHandler::ImageOption option) const;
virtual bool jumpToNextImage();
virtual bool jumpToImage(int imageNumber);
virtual int loopCount() const;
virtual int imageCount() const;
virtual int nextImageDelay() const;
virtual int currentImageNumber() const;
virtual QRect currentImageRect() const;
enum Transformation /BaseType=Flag/
{
TransformationNone,
TransformationMirror,
TransformationFlip,
TransformationRotate180,
TransformationRotate90,
TransformationMirrorAndRotate90,
TransformationFlipAndRotate90,
TransformationRotate270,
};
typedef QFlags<QImageIOHandler::Transformation> Transformations;
private:
QImageIOHandler(const QImageIOHandler &);
};

View File

@@ -0,0 +1,96 @@
// qimagereader.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QImageReader
{
%TypeHeaderCode
#include <qimagereader.h>
%End
public:
enum ImageReaderError
{
UnknownError,
FileNotFoundError,
DeviceError,
UnsupportedFormatError,
InvalidDataError,
};
QImageReader();
QImageReader(QIODevice *device, const QByteArray &format = QByteArray());
QImageReader(const QString &fileName, const QByteArray &format = QByteArray());
~QImageReader();
void setFormat(const QByteArray &format);
QByteArray format() const;
void setDevice(QIODevice *device);
QIODevice *device() const;
void setFileName(const QString &fileName);
QString fileName() const;
QSize size() const;
void setClipRect(const QRect &rect);
QRect clipRect() const;
void setScaledSize(const QSize &size);
QSize scaledSize() const;
void setScaledClipRect(const QRect &rect);
QRect scaledClipRect() const;
bool canRead() const;
QImage read() /ReleaseGIL/;
bool read(QImage *image) /ReleaseGIL/;
bool jumpToNextImage();
bool jumpToImage(int imageNumber);
int loopCount() const;
int imageCount() const;
int nextImageDelay() const;
int currentImageNumber() const;
QRect currentImageRect() const;
QImageReader::ImageReaderError error() const;
QString errorString() const;
static QByteArray imageFormat(const QString &fileName);
static QByteArray imageFormat(QIODevice *device);
static QList<QByteArray> supportedImageFormats();
QStringList textKeys() const;
QString text(const QString &key) const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
bool supportsAnimation() const;
void setQuality(int quality);
int quality() const;
bool supportsOption(QImageIOHandler::ImageOption option) const;
void setAutoDetectImageFormat(bool enabled);
bool autoDetectImageFormat() const;
QImage::Format imageFormat() const;
void setDecideFormatFromContent(bool ignored);
bool decideFormatFromContent() const;
static QList<QByteArray> supportedMimeTypes();
QByteArray subType() const;
QList<QByteArray> supportedSubTypes() const;
QImageIOHandler::Transformations transformation() const;
void setAutoTransform(bool enabled);
bool autoTransform() const;
static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
static int allocationLimit();
static void setAllocationLimit(int mbLimit);
private:
QImageReader(const QImageReader &);
};

View File

@@ -0,0 +1,73 @@
// qimagewriter.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QImageWriter
{
%TypeHeaderCode
#include <qimagewriter.h>
%End
public:
enum ImageWriterError
{
UnknownError,
DeviceError,
UnsupportedFormatError,
InvalidImageError,
};
QImageWriter();
QImageWriter(QIODevice *device, const QByteArray &format);
QImageWriter(const QString &fileName, const QByteArray &format = QByteArray());
~QImageWriter();
void setFormat(const QByteArray &format);
QByteArray format() const;
void setDevice(QIODevice *device);
QIODevice *device() const;
void setFileName(const QString &fileName);
QString fileName() const;
void setQuality(int quality);
int quality() const;
bool canWrite() const;
bool write(const QImage &image) /ReleaseGIL/;
QImageWriter::ImageWriterError error() const;
QString errorString() const;
static QList<QByteArray> supportedImageFormats();
void setText(const QString &key, const QString &text);
bool supportsOption(QImageIOHandler::ImageOption option) const;
void setCompression(int compression);
int compression() const;
static QList<QByteArray> supportedMimeTypes();
void setSubType(const QByteArray &type);
QByteArray subType() const;
QList<QByteArray> supportedSubTypes() const;
void setOptimizedWrite(bool optimize);
bool optimizedWrite() const;
void setProgressiveScanWrite(bool progressive);
bool progressiveScanWrite() const;
QImageIOHandler::Transformations transformation() const;
void setTransformation(QImageIOHandler::Transformations orientation);
static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
private:
QImageWriter(const QImageWriter &);
};

View File

@@ -0,0 +1,92 @@
// qinputdevice.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QInputDevice : public QObject
{
%TypeHeaderCode
#include <qinputdevice.h>
%End
public:
enum class DeviceType /BaseType=Flag/
{
Unknown,
Mouse,
TouchScreen,
TouchPad,
Puck,
Stylus,
Airbrush,
Keyboard,
AllDevices,
};
typedef QFlags<QInputDevice::DeviceType> DeviceTypes;
enum class Capability /BaseType=Flag/
{
None,
Position,
Area,
Pressure,
Velocity,
NormalizedPosition,
MouseEmulation,
%If (Qt_6_2_0 -)
PixelScroll,
%End
Scroll,
Hover,
Rotation,
XTilt,
YTilt,
TangentialPressure,
ZPosition,
All,
};
typedef QFlags<QInputDevice::Capability> Capabilities;
QInputDevice(const QString &name, qint64 systemId, QInputDevice::DeviceType type, const QString &seatName = QString(), QObject *parent /TransferThis/ = 0);
QInputDevice(QObject *parent /TransferThis/ = 0);
virtual ~QInputDevice();
QString name() const;
QInputDevice::DeviceType type() const;
QInputDevice::Capabilities capabilities() const;
bool hasCapability(QInputDevice::Capability cap) const;
qint64 systemId() const;
QString seatName() const;
QRect availableVirtualGeometry() const;
static QList<const QInputDevice *> devices();
static const QInputDevice *primaryKeyboard(const QString &seatName = QString());
bool operator==(const QInputDevice &other) const;
signals:
void availableVirtualGeometryChanged(QRect area);
%If (Qt_6_9_0 -)
void capabilitiesChanged(QInputDevice::Capabilities capabilities);
%End
public:
%If (Qt_6_3_0 -)
static QStringList seatNames();
%End
};

View File

@@ -0,0 +1,77 @@
// qinputmethod.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QInputMethod : public QObject
{
%TypeHeaderCode
#include <qinputmethod.h>
%End
public:
QTransform inputItemTransform() const;
void setInputItemTransform(const QTransform &transform);
QRectF cursorRectangle() const;
QRectF keyboardRectangle() const;
enum Action
{
Click,
ContextMenu,
};
bool isVisible() const;
void setVisible(bool visible);
bool isAnimating() const;
QLocale locale() const;
Qt::LayoutDirection inputDirection() const;
QRectF inputItemRectangle() const;
void setInputItemRectangle(const QRectF &rect);
static QVariant queryFocusObject(Qt::InputMethodQuery query, const QVariant &argument);
public slots:
void show();
void hide();
void update(Qt::InputMethodQueries queries);
void reset();
void commit();
void invokeAction(QInputMethod::Action a, int cursorPosition);
signals:
void cursorRectangleChanged();
void keyboardRectangleChanged();
void visibleChanged();
void animatingChanged();
void localeChanged();
void inputDirectionChanged(Qt::LayoutDirection newDirection);
public:
QRectF anchorRectangle() const;
QRectF inputItemClipRectangle() const;
signals:
void anchorRectangleChanged();
void inputItemClipRectangleChanged();
private:
QInputMethod();
virtual ~QInputMethod();
};

View File

@@ -0,0 +1,239 @@
// qkeysequence.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QKeySequence /TypeHintIn="Union[QKeySequence, QKeySequence.StandardKey, QString, int]"/
{
%TypeHeaderCode
#include <qkeysequence.h>
%End
%ConvertToTypeCode
// Allow a StandardKey, QString or an integer whenever a QKeySequence is
// expected.
if (sipIsErr == NULL)
{
if (sipCanConvertToType(sipPy, sipType_QKeySequence, SIP_NO_CONVERTORS))
return 1;
PyErr_Clear();
sipConvertToEnum(sipPy, sipType_QKeySequence_StandardKey);
if (!PyErr_Occurred())
return 1;
if (sipCanConvertToType(sipPy, sipType_QString, 0))
return 1;
PyErr_Clear();
PyLong_AsLong(sipPy);
return !PyErr_Occurred();
}
if (sipCanConvertToType(sipPy, sipType_QKeySequence, SIP_NO_CONVERTORS))
{
*sipCppPtr = reinterpret_cast<QKeySequence *>(sipConvertToType(sipPy, sipType_QKeySequence, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
}
PyErr_Clear();
int skey = sipConvertToEnum(sipPy, sipType_QKeySequence_StandardKey);
if (!PyErr_Occurred())
{
*sipCppPtr = new QKeySequence(static_cast<QKeySequence::StandardKey>(skey));
return sipGetState(sipTransferObj);
}
PyErr_Clear();
if (sipCanConvertToType(sipPy, sipType_QString, 0))
{
int state;
QString *qs = reinterpret_cast<QString *>(sipConvertToType(sipPy, sipType_QString, 0, 0, &state, sipIsErr));
if (*sipIsErr)
{
sipReleaseType(qs, sipType_QString, state);
return 0;
}
*sipCppPtr = new QKeySequence(*qs);
sipReleaseType(qs, sipType_QString, state);
return sipGetState(sipTransferObj);
}
int key = PyLong_AsLong(sipPy);
*sipCppPtr = new QKeySequence(key);
return sipGetState(sipTransferObj);
%End
%PickleCode
sipRes = Py_BuildValue("iiii", sipCpp->operator[](0), sipCpp->operator[](1), sipCpp->operator[](2), sipCpp->operator[](3));
%End
public:
enum SequenceFormat
{
NativeText,
PortableText,
};
enum SequenceMatch
{
NoMatch,
PartialMatch,
ExactMatch,
};
enum StandardKey
{
UnknownKey,
HelpContents,
WhatsThis,
Open,
Close,
Save,
New,
Delete,
Cut,
Copy,
Paste,
Undo,
Redo,
Back,
Forward,
Refresh,
ZoomIn,
ZoomOut,
Print,
AddTab,
NextChild,
PreviousChild,
Find,
FindNext,
FindPrevious,
Replace,
SelectAll,
Bold,
Italic,
Underline,
MoveToNextChar,
MoveToPreviousChar,
MoveToNextWord,
MoveToPreviousWord,
MoveToNextLine,
MoveToPreviousLine,
MoveToNextPage,
MoveToPreviousPage,
MoveToStartOfLine,
MoveToEndOfLine,
MoveToStartOfBlock,
MoveToEndOfBlock,
MoveToStartOfDocument,
MoveToEndOfDocument,
SelectNextChar,
SelectPreviousChar,
SelectNextWord,
SelectPreviousWord,
SelectNextLine,
SelectPreviousLine,
SelectNextPage,
SelectPreviousPage,
SelectStartOfLine,
SelectEndOfLine,
SelectStartOfBlock,
SelectEndOfBlock,
SelectStartOfDocument,
SelectEndOfDocument,
DeleteStartOfWord,
DeleteEndOfWord,
DeleteEndOfLine,
InsertParagraphSeparator,
InsertLineSeparator,
SaveAs,
Preferences,
Quit,
FullScreen,
Deselect,
DeleteCompleteLine,
Backspace,
Cancel,
};
QKeySequence();
QKeySequence(const QKeySequence &ks /Constrained/);
QKeySequence(QKeySequence::StandardKey key);
QKeySequence(const QString &key, QKeySequence::SequenceFormat format = QKeySequence::NativeText);
QKeySequence(int k1, int key2 = 0, int key3 = 0, int key4 = 0);
QKeySequence(QKeyCombination k1, QKeyCombination key2 = QKeyCombination::fromCombined(0), QKeyCombination key3 = QKeyCombination::fromCombined(0), QKeyCombination key4 = QKeyCombination::fromCombined(0));
QKeySequence(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QKeySequence>())
sipCpp = new QKeySequence(a0->value<QKeySequence>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QKeySequence();
int count() const /__len__/;
bool isEmpty() const;
QKeySequence::SequenceMatch matches(const QKeySequence &seq) const;
static QKeySequence mnemonic(const QString &text);
QKeyCombination operator[](int i) const;
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = new QKeyCombination(sipCpp->operator[]((uint)idx));
%End
bool operator==(const QKeySequence &other) const;
bool operator!=(const QKeySequence &other) const;
bool operator<(const QKeySequence &ks) const;
bool operator>(const QKeySequence &other) const;
bool operator<=(const QKeySequence &other) const;
bool operator>=(const QKeySequence &other) const;
bool isDetached() const;
void swap(QKeySequence &other /Constrained/);
QString toString(QKeySequence::SequenceFormat format = QKeySequence::PortableText) const;
static QKeySequence fromString(const QString &str, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
static QList<QKeySequence> keyBindings(QKeySequence::StandardKey key);
static QList<QKeySequence> listFromString(const QString &str, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
static QString listToString(const QList<QKeySequence> &list, QKeySequence::SequenceFormat format = QKeySequence::PortableText);
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
QDataStream &operator<<(QDataStream &in, const QKeySequence &ks) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &out, QKeySequence &ks /Constrained/) /ReleaseGIL/;
void qt_set_sequence_auto_mnemonic(bool b);

View File

@@ -0,0 +1,296 @@
// qmatrix4x4.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qmatrix4x4.h>
%End
class QMatrix4x4
{
%TypeHeaderCode
#include <qmatrix4x4.h>
%End
%PickleCode
PYQT_FLOAT data[16];
// We want the data in row-major order.
sipCpp->copyDataTo(data);
sipRes = Py_BuildValue("dddddddddddddddd",
(double)data[0], (double)data[1], (double)data[2], (double)data[3],
(double)data[4], (double)data[5], (double)data[6], (double)data[7],
(double)data[8], (double)data[9], (double)data[10], (double)data[11],
(double)data[12], (double)data[13], (double)data[14], (double)data[15]);
%End
public:
QMatrix4x4();
explicit QMatrix4x4(SIP_PYOBJECT values /TypeHint="Sequence[float]"/) [(const float *values)];
%MethodCode
float values[16];
if ((sipError = qtgui_matrixDataFromSequence(a0, 16, values)) == sipErrorNone)
sipCpp = new QMatrix4x4(values);
%End
QMatrix4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44);
QMatrix4x4(const QTransform &transform);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
bool bad = false;
int i;
PyObject *m[16];
PYQT_FLOAT data[16];
// The raw data is in column-major order but we want row-major order.
sipCpp->copyDataTo(data);
for (i = 0; i < 16; ++i)
{
m[i] = PyFloat_FromDouble(data[i]);
if (!m[i])
bad = true;
}
if (!bad)
{
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QMatrix4x4("
"%R, %R, %R, %R, "
"%R, %R, %R, %R, "
"%R, %R, %R, %R, "
"%R, %R, %R, %R)",
m[0], m[1], m[2], m[3],
m[4], m[5], m[6], m[7],
m[8], m[9], m[10], m[11],
m[12], m[13], m[14], m[15]);
}
for (i = 0; i < 16; ++i)
Py_XDECREF(m[i]);
%End
double determinant() const;
QMatrix4x4 inverted(bool *invertible = 0) const;
QMatrix4x4 transposed() const;
QMatrix3x3 normalMatrix() const;
void scale(const QVector3D &vector);
void scale(float x, float y);
void scale(float x, float y, float z);
void scale(float factor);
void translate(const QVector3D &vector);
void translate(float x, float y);
void translate(float x, float y, float z);
void rotate(float angle, const QVector3D &vector);
void rotate(float angle, float x, float y, float z = 0.F);
void rotate(const QQuaternion &quaternion);
void ortho(const QRect &rect);
void ortho(const QRectF &rect);
void ortho(float left, float right, float bottom, float top, float nearPlane, float farPlane);
void frustum(float left, float right, float bottom, float top, float nearPlane, float farPlane);
void perspective(float angle, float aspect, float nearPlane, float farPlane);
void lookAt(const QVector3D &eye, const QVector3D &center, const QVector3D &up);
SIP_PYLIST copyDataTo() const /TypeHint="List[float]"/;
%MethodCode
float values[16];
sipCpp->copyDataTo(values);
sipError = qtgui_matrixDataAsList(16, values, &sipRes);
%End
QTransform toTransform() const;
QTransform toTransform(float distanceToPlane) const;
QRect mapRect(const QRect &rect) const;
QRectF mapRect(const QRectF &rect) const;
SIP_PYLIST data() /TypeHint="List[float]"/;
%MethodCode
sipError = qtgui_matrixDataAsList(16, sipCpp->constData(), &sipRes);
%End
void optimize();
SIP_PYOBJECT __getitem__(SIP_PYOBJECT) const;
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 4, &row, &column)) == sipErrorNone)
{
sipRes = PyFloat_FromDouble(sipCpp->operator()(row, column));
if (!sipRes)
sipError = sipErrorFail;
}
%End
void __setitem__(SIP_PYOBJECT, qreal);
%MethodCode
int row, column;
if ((sipError = qtgui_matrixParseIndex(a0, 4, 4, &row, &column)) == sipErrorNone)
sipCpp->operator()(row, column) = a1;
%End
QVector4D column(int index) const;
void setColumn(int index, const QVector4D &value);
QVector4D row(int index) const;
void setRow(int index, const QVector4D &value);
bool isIdentity() const;
void setToIdentity();
void fill(float value);
QMatrix4x4 &operator+=(const QMatrix4x4 &other);
QMatrix4x4 &operator-=(const QMatrix4x4 &other);
QMatrix4x4 &operator*=(const QMatrix4x4 &other) /__imatmul__/;
QMatrix4x4 &operator*=(float factor);
QMatrix4x4 &operator/=(float divisor);
bool operator==(const QMatrix4x4 &other) const;
bool operator!=(const QMatrix4x4 &other) const;
QPoint map(const QPoint &point) const;
QPointF map(const QPointF &point) const;
QVector3D map(const QVector3D &point) const;
QVector3D mapVector(const QVector3D &vector) const;
QVector4D map(const QVector4D &point) const;
void viewport(float left, float bottom, float width, float height, float nearPlane = 0.F, float farPlane = 1.F);
void viewport(const QRectF &rect);
bool isAffine() const;
};
QMatrix4x4 operator/(const QMatrix4x4 &matrix, float divisor);
QMatrix4x4 operator+(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
QMatrix4x4 operator-(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
QMatrix4x4 operator*(const QMatrix4x4 &m1, const QMatrix4x4 &m2) /__matmul__/;
QPoint operator*(const QPoint &point, const QMatrix4x4 &matrix);
QPointF operator*(const QPointF &point, const QMatrix4x4 &matrix);
QPoint operator*(const QMatrix4x4 &matrix, const QPoint &point);
QPointF operator*(const QMatrix4x4 &matrix, const QPointF &point);
QMatrix4x4 operator-(const QMatrix4x4 &matrix);
QMatrix4x4 operator*(float factor, const QMatrix4x4 &matrix);
QMatrix4x4 operator*(const QMatrix4x4 &matrix, float factor);
bool qFuzzyCompare(const QMatrix4x4 &m1, const QMatrix4x4 &m2);
QDataStream &operator<<(QDataStream &, const QMatrix4x4 &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QMatrix4x4 & /Constrained/) /ReleaseGIL/;
%ModuleHeaderCode
// Helpers for the matrix classes.
typedef float PYQT_FLOAT;
sipErrorState qtgui_matrixParseIndex(PyObject *tup, int nr_rows,
int nr_columns, int *row, int *column);
sipErrorState qtgui_matrixDataFromSequence(PyObject *seq, int nr_values,
PYQT_FLOAT *values);
sipErrorState qtgui_matrixDataAsList(int nr_values, const PYQT_FLOAT *values,
PyObject **list);
%End
%ModuleCode
// Convert a Python object to a row and column.
sipErrorState qtgui_matrixParseIndex(PyObject *tup, int nr_rows,
int nr_columns, int *row, int *column)
{
sipErrorState es = sipErrorContinue;
if (PyTuple_Check(tup) && PyArg_ParseTuple(tup, "ii", row, column))
if (*row >= 0 && *row < nr_rows && *column >= 0 && *column < nr_columns)
es = sipErrorNone;
if (es == sipErrorContinue)
PyErr_Format(PyExc_IndexError, "an index must be a row in the range 0 to %d and a column in the range 0 to %d", nr_rows - 1, nr_columns - 1);
return es;
}
// Convert a Python object to an array of qreals.
sipErrorState qtgui_matrixDataFromSequence(PyObject *seq, int nr_values,
PYQT_FLOAT *values)
{
sipErrorState es;
if (PySequence_Size(seq) == nr_values)
{
es = sipErrorNone;
for (int i = 0; i < nr_values; ++i)
{
PyObject *value = PySequence_GetItem(seq, i);
if (!value)
{
es = sipErrorFail;
break;
}
PyErr_Clear();
double d = PyFloat_AsDouble(value);
if (PyErr_Occurred())
{
Py_DECREF(value);
es = sipErrorContinue;
break;
}
Py_DECREF(value);
*values++ = d;
}
}
else
{
es = sipErrorContinue;
}
if (es == sipErrorContinue)
PyErr_Format(PyExc_TypeError, "a sequence of %d floats is expected",
nr_values);
return es;
}
// Convert an array of qreals to a Python list.
sipErrorState qtgui_matrixDataAsList(int nr_values, const PYQT_FLOAT *values,
PyObject **list)
{
PyObject *l = PyList_New(nr_values);
if (!l)
return sipErrorFail;
for (int i = 0; i < nr_values; ++i)
{
PyObject *value = PyFloat_FromDouble(*values++);
if (!value)
{
Py_DECREF(l);
return sipErrorFail;
}
PyList_SetItem(l, i, value);
}
*list = l;
return sipErrorNone;
}
%End

View File

@@ -0,0 +1,91 @@
// qmovie.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QMovie : public QObject
{
%TypeHeaderCode
#include <qmovie.h>
%End
public:
enum MovieState
{
NotRunning,
Paused,
Running,
};
enum CacheMode
{
CacheNone,
CacheAll,
};
explicit QMovie(QObject *parent /TransferThis/ = 0);
QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent /TransferThis/ = 0);
QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent /TransferThis/ = 0);
virtual ~QMovie();
static QList<QByteArray> supportedFormats();
void setDevice(QIODevice *device);
QIODevice *device() const;
void setFileName(const QString &fileName);
QString fileName() const;
void setFormat(const QByteArray &format);
QByteArray format() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
QMovie::MovieState state() const;
QRect frameRect() const;
QImage currentImage() const;
QPixmap currentPixmap() const;
bool isValid() const;
bool jumpToFrame(int frameNumber);
int loopCount() const;
int frameCount() const;
int nextFrameDelay() const;
int currentFrameNumber() const;
void setSpeed(int percentSpeed);
int speed() const;
QSize scaledSize();
void setScaledSize(const QSize &size);
QMovie::CacheMode cacheMode() const;
void setCacheMode(QMovie::CacheMode mode);
signals:
void started();
void resized(const QSize &size);
void updated(const QRect &rect);
void stateChanged(QMovie::MovieState state);
void error(QImageReader::ImageReaderError error);
void finished();
void frameChanged(int frameNumber);
public slots:
void start();
bool jumpToNextFrame();
void setPaused(bool paused);
void stop();
public:
QImageReader::ImageReaderError lastError() const;
QString lastErrorString() const;
};

View File

@@ -0,0 +1,45 @@
// qoffscreensurface.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QOffscreenSurface : public QObject, public QSurface
{
%TypeHeaderCode
#include <qoffscreensurface.h>
%End
public:
QOffscreenSurface(QScreen *screen = 0, QObject *parent /TransferThis/ = 0);
virtual ~QOffscreenSurface();
virtual QSurface::SurfaceType surfaceType() const;
void create();
void destroy();
bool isValid() const;
void setFormat(const QSurfaceFormat &format);
virtual QSurfaceFormat format() const;
QSurfaceFormat requestedFormat() const;
virtual QSize size() const;
QScreen *screen() const;
void setScreen(QScreen *screen);
signals:
void screenChanged(QScreen *screen);
};

View File

@@ -0,0 +1,88 @@
// qopenglcontext.sip generated by MetaSIP
//
// This file is part of the QtGui 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 (PyQt_OpenGL)
class QOpenGLContextGroup : public QObject
{
%TypeHeaderCode
#include <qopenglcontext.h>
%End
public:
virtual ~QOpenGLContextGroup();
QList<QOpenGLContext *> shares() const;
static QOpenGLContextGroup *currentContextGroup();
private:
QOpenGLContextGroup();
};
%End
%If (PyQt_OpenGL)
class QOpenGLContext : public QObject
{
%TypeHeaderCode
#include <qopenglcontext.h>
%End
public:
explicit QOpenGLContext(QObject *parent /TransferThis/ = 0);
virtual ~QOpenGLContext();
void setFormat(const QSurfaceFormat &format);
void setShareContext(QOpenGLContext *shareContext);
void setScreen(QScreen *screen);
bool create();
bool isValid() const;
QSurfaceFormat format() const;
QOpenGLContext *shareContext() const;
QOpenGLContextGroup *shareGroup() const;
QScreen *screen() const;
GLuint defaultFramebufferObject() const;
bool makeCurrent(QSurface *surface);
void doneCurrent();
void swapBuffers(QSurface *surface);
QFunctionPointer getProcAddress(const QByteArray &procName) const;
QSurface *surface() const;
static QOpenGLContext *currentContext();
static bool areSharing(QOpenGLContext *first, QOpenGLContext *second);
QSet<QByteArray> extensions() const;
bool hasExtension(const QByteArray &extension) const;
signals:
void aboutToBeDestroyed();
public:
enum OpenGLModuleType
{
LibGL,
LibGLES,
};
static QOpenGLContext::OpenGLModuleType openGLModuleType();
bool isOpenGLES() const;
static bool supportsThreadedOpenGL();
static QOpenGLContext *globalShareContext();
};
%End

View File

@@ -0,0 +1,50 @@
// qpagedpaintdevice.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPagedPaintDevice : public QPaintDevice /NoDefaultCtors/
{
%TypeHeaderCode
#include <qpagedpaintdevice.h>
%End
public:
virtual ~QPagedPaintDevice();
virtual bool newPage() = 0;
enum PdfVersion
{
PdfVersion_1_4,
PdfVersion_A1b,
PdfVersion_1_6,
%If (Qt_6_8_0 -)
PdfVersion_X4,
%End
};
virtual bool setPageSize(const QPageSize &pageSize);
virtual bool setPageLayout(const QPageLayout &pageLayout);
QPageLayout pageLayout() const;
virtual bool setPageOrientation(QPageLayout::Orientation orientation);
virtual bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units = QPageLayout::Millimeter);
virtual void setPageRanges(const QPageRanges &ranges);
QPageRanges pageRanges() const;
};

View File

@@ -0,0 +1,124 @@
// qpagelayout.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPageLayout
{
%TypeHeaderCode
#include <qpagelayout.h>
%End
public:
enum Unit
{
Millimeter,
Point,
Inch,
Pica,
Didot,
Cicero,
};
enum Orientation
{
Portrait,
Landscape,
};
enum Mode
{
StandardMode,
FullPageMode,
};
%If (Qt_6_8_0 -)
enum class OutOfBoundsPolicy
{
Reject,
Clamp,
};
%End
QPageLayout();
QPageLayout(const QPageSize &pageSize, QPageLayout::Orientation orientation, const QMarginsF &margins, QPageLayout::Unit units = QPageLayout::Point, const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
QPageLayout(const QPageLayout &other);
~QPageLayout();
void swap(QPageLayout &other /Constrained/);
bool isEquivalentTo(const QPageLayout &other) const;
bool isValid() const;
void setMode(QPageLayout::Mode mode);
QPageLayout::Mode mode() const;
void setPageSize(const QPageSize &pageSize, const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
QPageSize pageSize() const;
void setOrientation(QPageLayout::Orientation orientation);
QPageLayout::Orientation orientation() const;
void setUnits(QPageLayout::Unit units);
QPageLayout::Unit units() const;
%If (Qt_6_8_0 -)
bool setMargins(const QMarginsF &margins, QPageLayout::OutOfBoundsPolicy outOfBoundsPolicy = QPageLayout::OutOfBoundsPolicy::Reject);
%End
%If (- Qt_6_8_0)
bool setMargins(const QMarginsF &margins);
%End
%If (Qt_6_8_0 -)
bool setLeftMargin(qreal leftMargin, QPageLayout::OutOfBoundsPolicy outOfBoundsPolicy = QPageLayout::OutOfBoundsPolicy::Reject);
%End
%If (- Qt_6_8_0)
bool setLeftMargin(qreal leftMargin);
%End
%If (Qt_6_8_0 -)
bool setRightMargin(qreal rightMargin, QPageLayout::OutOfBoundsPolicy outOfBoundsPolicy = QPageLayout::OutOfBoundsPolicy::Reject);
%End
%If (- Qt_6_8_0)
bool setRightMargin(qreal rightMargin);
%End
%If (Qt_6_8_0 -)
bool setTopMargin(qreal topMargin, QPageLayout::OutOfBoundsPolicy outOfBoundsPolicy = QPageLayout::OutOfBoundsPolicy::Reject);
%End
%If (- Qt_6_8_0)
bool setTopMargin(qreal topMargin);
%End
%If (Qt_6_8_0 -)
bool setBottomMargin(qreal bottomMargin, QPageLayout::OutOfBoundsPolicy outOfBoundsPolicy = QPageLayout::OutOfBoundsPolicy::Reject);
%End
%If (- Qt_6_8_0)
bool setBottomMargin(qreal bottomMargin);
%End
QMarginsF margins() const;
QMarginsF margins(QPageLayout::Unit units) const;
QMargins marginsPoints() const;
QMargins marginsPixels(int resolution) const;
void setMinimumMargins(const QMarginsF &minMargins);
QMarginsF minimumMargins() const;
QMarginsF maximumMargins() const;
QRectF fullRect() const;
QRectF fullRect(QPageLayout::Unit units) const;
QRect fullRectPoints() const;
QRect fullRectPixels(int resolution) const;
QRectF paintRect() const;
QRectF paintRect(QPageLayout::Unit units) const;
QRect paintRectPoints() const;
QRect paintRectPixels(int resolution) const;
};
bool operator==(const QPageLayout &lhs, const QPageLayout &rhs);
bool operator!=(const QPageLayout &lhs, const QPageLayout &rhs);

View File

@@ -0,0 +1,64 @@
// qpageranges.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPageRanges
{
%TypeHeaderCode
#include <qpageranges.h>
%End
public:
QPageRanges();
QPageRanges(const QPageRanges &other);
~QPageRanges();
void swap(QPageRanges &other /Constrained/);
struct Range
{
%TypeHeaderCode
#include <qpageranges.h>
%End
int from;
int to;
bool contains(int pageNumber) const;
};
void addPage(int pageNumber);
void addRange(int from, int to);
QList<QPageRanges::Range> toRangeList() const;
void clear();
QString toString() const;
static QPageRanges fromString(const QString &ranges);
bool contains(int pageNumber) const;
bool isEmpty() const;
int firstPage() const;
int lastPage() const;
};
bool operator==(QPageRanges::Range lhs, QPageRanges::Range rhs);
bool operator==(const QPageRanges &lhs, const QPageRanges &rhs);
bool operator!=(QPageRanges::Range lhs, QPageRanges::Range rhs);
bool operator!=(const QPageRanges &lhs, const QPageRanges &rhs);
bool operator<(QPageRanges::Range lhs, QPageRanges::Range rhs);
QDataStream &operator<<(QDataStream &, const QPageRanges &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QPageRanges & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,216 @@
// qpagesize.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPageSize
{
%TypeHeaderCode
#include <qpagesize.h>
%End
public:
enum PageSizeId
{
A4,
B5,
Letter,
Legal,
Executive,
A0,
A1,
A2,
A3,
A5,
A6,
A7,
A8,
A9,
B0,
B1,
B10,
B2,
B3,
B4,
B6,
B7,
B8,
B9,
C5E,
Comm10E,
DLE,
Folio,
Ledger,
Tabloid,
Custom,
A10,
A3Extra,
A4Extra,
A4Plus,
A4Small,
A5Extra,
B5Extra,
JisB0,
JisB1,
JisB2,
JisB3,
JisB4,
JisB5,
JisB6,
JisB7,
JisB8,
JisB9,
JisB10,
AnsiC,
AnsiD,
AnsiE,
LegalExtra,
LetterExtra,
LetterPlus,
LetterSmall,
TabloidExtra,
ArchA,
ArchB,
ArchC,
ArchD,
ArchE,
Imperial7x9,
Imperial8x10,
Imperial9x11,
Imperial9x12,
Imperial10x11,
Imperial10x13,
Imperial10x14,
Imperial12x11,
Imperial15x11,
ExecutiveStandard,
Note,
Quarto,
Statement,
SuperA,
SuperB,
Postcard,
DoublePostcard,
Prc16K,
Prc32K,
Prc32KBig,
FanFoldUS,
FanFoldGerman,
FanFoldGermanLegal,
EnvelopeB4,
EnvelopeB5,
EnvelopeB6,
EnvelopeC0,
EnvelopeC1,
EnvelopeC2,
EnvelopeC3,
EnvelopeC4,
EnvelopeC6,
EnvelopeC65,
EnvelopeC7,
Envelope9,
Envelope11,
Envelope12,
Envelope14,
EnvelopeMonarch,
EnvelopePersonal,
EnvelopeChou3,
EnvelopeChou4,
EnvelopeInvite,
EnvelopeItalian,
EnvelopeKaku2,
EnvelopeKaku3,
EnvelopePrc1,
EnvelopePrc2,
EnvelopePrc3,
EnvelopePrc4,
EnvelopePrc5,
EnvelopePrc6,
EnvelopePrc7,
EnvelopePrc8,
EnvelopePrc9,
EnvelopePrc10,
EnvelopeYou4,
AnsiA,
AnsiB,
EnvelopeC5,
EnvelopeDL,
Envelope10,
LastPageSize,
};
enum Unit
{
Millimeter,
Point,
Inch,
Pica,
Didot,
Cicero,
};
enum SizeMatchPolicy
{
FuzzyMatch,
FuzzyOrientationMatch,
ExactMatch,
};
QPageSize();
%If (Qt_6_2_0 -)
QPageSize(QPageSize::PageSizeId pageSizeId);
%End
%If (- Qt_6_2_0)
explicit QPageSize(QPageSize::PageSizeId pageSizeId);
%End
QPageSize(const QSize &pointSize, const QString &name = QString(), QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
QPageSize(const QSizeF &size, QPageSize::Unit units, const QString &name = QString(), QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
QPageSize(const QPageSize &other);
~QPageSize();
void swap(QPageSize &other /Constrained/);
bool isEquivalentTo(const QPageSize &other) const;
bool isValid() const;
QString key() const;
QString name() const;
QPageSize::PageSizeId id() const;
int windowsId() const;
QSizeF definitionSize() const;
QPageSize::Unit definitionUnits() const;
QSizeF size(QPageSize::Unit units) const;
QSize sizePoints() const;
QSize sizePixels(int resolution) const;
QRectF rect(QPageSize::Unit units) const;
QRect rectPoints() const;
QRect rectPixels(int resolution) const;
static QString key(QPageSize::PageSizeId pageSizeId);
static QString name(QPageSize::PageSizeId pageSizeId);
static QPageSize::PageSizeId id(const QSize &pointSize, QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
static QPageSize::PageSizeId id(const QSizeF &size, QPageSize::Unit units, QPageSize::SizeMatchPolicy matchPolicy = QPageSize::FuzzyMatch);
static QPageSize::PageSizeId id(int windowsId);
static int windowsId(QPageSize::PageSizeId pageSizeId);
static QSizeF definitionSize(QPageSize::PageSizeId pageSizeId);
static QPageSize::Unit definitionUnits(QPageSize::PageSizeId pageSizeId);
static QSizeF size(QPageSize::PageSizeId pageSizeId, QPageSize::Unit units);
static QSize sizePoints(QPageSize::PageSizeId pageSizeId);
static QSize sizePixels(QPageSize::PageSizeId pageSizeId, int resolution);
};
bool operator==(const QPageSize &lhs, const QPageSize &rhs);
bool operator!=(const QPageSize &lhs, const QPageSize &rhs);

View File

@@ -0,0 +1,77 @@
// qpaintdevice.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPaintDevice
{
%TypeHeaderCode
#include <qpaintdevice.h>
%End
public:
enum PaintDeviceMetric
{
PdmWidth,
PdmHeight,
PdmWidthMM,
PdmHeightMM,
PdmNumColors,
PdmDepth,
PdmDpiX,
PdmDpiY,
PdmPhysicalDpiX,
PdmPhysicalDpiY,
PdmDevicePixelRatio,
PdmDevicePixelRatioScaled,
%If (Qt_6_8_0 -)
PdmDevicePixelRatioF_EncodedA,
%End
%If (Qt_6_8_0 -)
PdmDevicePixelRatioF_EncodedB,
%End
};
virtual ~QPaintDevice();
virtual QPaintEngine *paintEngine() const = 0;
int width() const;
int height() const;
int widthMM() const;
int heightMM() const;
int logicalDpiX() const;
int logicalDpiY() const;
int physicalDpiX() const;
int physicalDpiY() const;
int depth() const;
bool paintingActive() const;
int colorCount() const;
qreal devicePixelRatio() const;
protected:
QPaintDevice();
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
public:
qreal devicePixelRatioF() const;
static qreal devicePixelRatioFScale();
private:
QPaintDevice(const QPaintDevice &);
};

View File

@@ -0,0 +1,41 @@
// qpaintdevicewindow.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPaintDeviceWindow : public QWindow, public QPaintDevice /NoDefaultCtors/
{
%TypeHeaderCode
#include <qpaintdevicewindow.h>
%End
public:
void update(const QRect &rect);
void update(const QRegion &region);
public slots:
void update();
protected:
virtual void paintEvent(QPaintEvent *event);
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
virtual void exposeEvent(QExposeEvent *);
virtual bool event(QEvent *event);
};

View File

@@ -0,0 +1,189 @@
// qpaintengine.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextItem
{
%TypeHeaderCode
#include <qpaintengine.h>
%End
public:
enum RenderFlag /BaseType=Flag/
{
RightToLeft,
Overline,
Underline,
StrikeOut,
};
typedef QFlags<QTextItem::RenderFlag> RenderFlags;
qreal descent() const;
qreal ascent() const;
qreal width() const;
QTextItem::RenderFlags renderFlags() const;
QString text() const;
QFont font() const;
};
class QPaintEngine
{
%TypeHeaderCode
#include <qpaintengine.h>
%End
public:
enum PaintEngineFeature /BaseType=Flag/
{
PrimitiveTransform,
PatternTransform,
PixmapTransform,
PatternBrush,
LinearGradientFill,
RadialGradientFill,
ConicalGradientFill,
AlphaBlend,
PorterDuff,
PainterPaths,
Antialiasing,
BrushStroke,
ConstantOpacity,
MaskedBrush,
PaintOutsidePaintEvent,
PerspectiveTransform,
BlendModes,
ObjectBoundingModeGradients,
RasterOpModes,
AllFeatures,
};
typedef QFlags<QPaintEngine::PaintEngineFeature> PaintEngineFeatures;
enum DirtyFlag /BaseType=Flag/
{
DirtyPen,
DirtyBrush,
DirtyBrushOrigin,
DirtyFont,
DirtyBackground,
DirtyBackgroundMode,
DirtyTransform,
DirtyClipRegion,
DirtyClipPath,
DirtyHints,
DirtyCompositionMode,
DirtyClipEnabled,
DirtyOpacity,
AllDirty,
};
typedef QFlags<QPaintEngine::DirtyFlag> DirtyFlags;
enum PolygonDrawMode
{
OddEvenMode,
WindingMode,
ConvexMode,
PolylineMode,
};
explicit QPaintEngine(QPaintEngine::PaintEngineFeatures features = QPaintEngine::PaintEngineFeatures());
virtual ~QPaintEngine();
bool isActive() const;
void setActive(bool newState);
virtual bool begin(QPaintDevice *pdev) = 0;
virtual bool end() = 0;
virtual void updateState(const QPaintEngineState &state /NoCopy/) = 0;
virtual void drawRects(const QRect *rects /Array/, int rectCount /ArraySize/);
virtual void drawRects(const QRectF *rects /Array/, int rectCount /ArraySize/);
virtual void drawLines(const QLine *lines /Array/, int lineCount /ArraySize/);
virtual void drawLines(const QLineF *lines /Array/, int lineCount /ArraySize/);
virtual void drawEllipse(const QRectF &r);
virtual void drawEllipse(const QRect &r);
virtual void drawPath(const QPainterPath &path);
virtual void drawPoints(const QPointF *points /Array/, int pointCount /ArraySize/);
virtual void drawPoints(const QPoint *points /Array/, int pointCount /ArraySize/);
virtual void drawPolygon(const QPointF *points /Array/, int pointCount /ArraySize/, QPaintEngine::PolygonDrawMode mode);
virtual void drawPolygon(const QPoint *points /Array/, int pointCount /ArraySize/, QPaintEngine::PolygonDrawMode mode);
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) = 0;
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem /NoCopy/);
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor);
void setPaintDevice(QPaintDevice *device);
QPaintDevice *paintDevice() const;
enum Type
{
X11,
Windows,
QuickDraw,
CoreGraphics,
MacPrinter,
QWindowSystem,
OpenGL,
Picture,
SVG,
Raster,
Direct3D,
Pdf,
OpenVG,
OpenGL2,
PaintBuffer,
Blitter,
Direct2D,
User,
MaxUser,
};
virtual QPaintEngine::Type type() const = 0;
QPainter *painter() const;
bool hasFeature(QPaintEngine::PaintEngineFeatures feature) const;
private:
QPaintEngine(const QPaintEngine &);
};
class QPaintEngineState
{
%TypeHeaderCode
#include <qpaintengine.h>
%End
public:
QPaintEngine::DirtyFlags state() const;
QPen pen() const;
QBrush brush() const;
QPointF brushOrigin() const;
QBrush backgroundBrush() const;
Qt::BGMode backgroundMode() const;
QFont font() const;
qreal opacity() const;
Qt::ClipOperation clipOperation() const;
QRegion clipRegion() const;
QPainterPath clipPath() const;
bool isClipEnabled() const;
QPainter::RenderHints renderHints() const;
QPainter::CompositionMode compositionMode() const;
QPainter *painter() const;
QTransform transform() const;
bool brushNeedsResolving() const;
bool penNeedsResolving() const;
};

View File

@@ -0,0 +1,554 @@
// qpainter.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPainter
{
%TypeHeaderCode
#include <qpainter.h>
%End
%TypeCode
// Return an array on the heap of class instances extracted from a set of
// Python arguments.
template<class TYPE>
static TYPE *qtgui_inst_array(const TYPE *first, PyObject *t, sipTypeDef *td)
{
TYPE *arr = new TYPE[1 + PyTuple_Size(t)];
arr[0] = *first;
for (Py_ssize_t i = 0; i < PyTuple_Size(t); ++i)
{
int iserr = 0, state;
TYPE *itm;
itm = reinterpret_cast<TYPE *>(sipForceConvertToType(PyTuple_GetItem(t, i), td, 0, SIP_NOT_NONE, &state, &iserr));
if (iserr)
{
sipReleaseType(itm, td, state);
PyErr_Format(PyExc_TypeError, "each argument must be an instance of %s", sipPyTypeName(sipTypeAsPyTypeObject(td)));
delete[] arr;
return 0;
}
arr[1 + i] = *itm;
sipReleaseType(itm, td, state);
}
return arr;
}
%End
public:
enum RenderHint /BaseType=Flag/
{
Antialiasing,
TextAntialiasing,
SmoothPixmapTransform,
LosslessImageRendering,
%If (Qt_6_1_0 -)
VerticalSubpixelPositioning,
%End
%If (Qt_6_4_0 -)
NonCosmeticBrushPatterns,
%End
};
typedef QFlags<QPainter::RenderHint> RenderHints;
QPainter();
explicit QPainter(QPaintDevice *);
~QPainter();
SIP_PYOBJECT __enter__();
%MethodCode
// Check a device was passed.
if (sipCpp->isActive())
{
// Just return a reference to self.
sipRes = sipSelf;
Py_INCREF(sipRes);
}
else
{
PyErr_SetString(PyExc_ValueError, "QPainter must be created with a device");
sipRes = 0;
}
%End
void __exit__(SIP_PYOBJECT type, SIP_PYOBJECT value, SIP_PYOBJECT traceback);
%MethodCode
sipCpp->end();
%End
QPaintDevice *device() const;
bool begin(QPaintDevice *);
bool end();
bool isActive() const;
enum CompositionMode
{
CompositionMode_SourceOver,
CompositionMode_DestinationOver,
CompositionMode_Clear,
CompositionMode_Source,
CompositionMode_Destination,
CompositionMode_SourceIn,
CompositionMode_DestinationIn,
CompositionMode_SourceOut,
CompositionMode_DestinationOut,
CompositionMode_SourceAtop,
CompositionMode_DestinationAtop,
CompositionMode_Xor,
CompositionMode_Plus,
CompositionMode_Multiply,
CompositionMode_Screen,
CompositionMode_Overlay,
CompositionMode_Darken,
CompositionMode_Lighten,
CompositionMode_ColorDodge,
CompositionMode_ColorBurn,
CompositionMode_HardLight,
CompositionMode_SoftLight,
CompositionMode_Difference,
CompositionMode_Exclusion,
RasterOp_SourceOrDestination,
RasterOp_SourceAndDestination,
RasterOp_SourceXorDestination,
RasterOp_NotSourceAndNotDestination,
RasterOp_NotSourceOrNotDestination,
RasterOp_NotSourceXorDestination,
RasterOp_NotSource,
RasterOp_NotSourceAndDestination,
RasterOp_SourceAndNotDestination,
RasterOp_NotSourceOrDestination,
RasterOp_SourceOrNotDestination,
RasterOp_ClearDestination,
RasterOp_SetDestination,
RasterOp_NotDestination,
};
void setCompositionMode(QPainter::CompositionMode mode);
QPainter::CompositionMode compositionMode() const;
const QFont &font() const;
void setFont(const QFont &f);
QFontMetrics fontMetrics() const;
QFontInfo fontInfo() const;
void setPen(const QColor &color);
void setPen(const QPen &pen);
void setPen(Qt::PenStyle style);
const QPen &pen() const;
void setBrush(const QBrush &brush);
void setBrush(Qt::BrushStyle style);
const QBrush &brush() const;
void setBackgroundMode(Qt::BGMode mode);
Qt::BGMode backgroundMode() const;
QPoint brushOrigin() const;
void setBrushOrigin(const QPointF &);
void setBackground(const QBrush &bg);
const QBrush &background() const;
QRegion clipRegion() const;
QPainterPath clipPath() const;
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation = Qt::ReplaceClip);
void setClipRegion(const QRegion &region, Qt::ClipOperation operation = Qt::ReplaceClip);
void setClipPath(const QPainterPath &path, Qt::ClipOperation operation = Qt::ReplaceClip);
void setClipping(bool enable);
bool hasClipping() const;
void save();
void restore();
void scale(qreal sx, qreal sy);
void shear(qreal sh, qreal sv);
void rotate(qreal a);
void translate(const QPointF &offset);
QRect window() const;
void setWindow(const QRect &window);
QRect viewport() const;
void setViewport(const QRect &viewport);
void setViewTransformEnabled(bool enable);
bool viewTransformEnabled() const;
void strokePath(const QPainterPath &path, const QPen &pen);
void fillPath(const QPainterPath &path, const QBrush &brush);
void drawPath(const QPainterPath &path);
void drawPoints(const QPolygonF &points);
void drawPoints(const QPolygon &points);
void drawPoints(const QPointF *points /Array/, int pointCount /ArraySize/);
void drawPoints(const QPointF *point, ... /TypeHint="QPointF"/);
%MethodCode
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
if (points)
{
sipCpp->drawPoints(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawPoints(const QPoint *points /Array/, int pointCount /ArraySize/);
void drawPoints(const QPoint *point, ... /TypeHint="QPoint"/);
%MethodCode
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
if (points)
{
sipCpp->drawPoints(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawLines(const QLineF *lines /Array/, int lineCount /ArraySize/);
void drawLines(const QLineF *line, ... /TypeHint="QLineF"/);
%MethodCode
QLineF *lines = qtgui_inst_array<QLineF>(a0, a1, sipType_QLineF);
if (lines)
{
sipCpp->drawLines(lines, 1 + PyTuple_Size(a1));
delete[] lines;
}
else
sipIsErr = 1;
%End
void drawLines(const QPointF *pointPairs /Array/, int lineCount /ArraySize/);
%MethodCode
sipCpp->drawLines(a0, a1 / 2);
%End
void drawLines(const QPointF *pointPair, ... /TypeHint="QPointF"/);
%MethodCode
QPointF *pairs = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
if (pairs)
{
sipCpp->drawLines(pairs, (1 + PyTuple_Size(a1)) / 2);
delete[] pairs;
}
else
sipIsErr = 1;
%End
void drawLines(const QLine *lines /Array/, int lineCount /ArraySize/);
void drawLines(const QLine *line, ... /TypeHint="QLine"/);
%MethodCode
QLine *lines = qtgui_inst_array<QLine>(a0, a1, sipType_QLine);
if (lines)
{
sipCpp->drawLines(lines, 1 + PyTuple_Size(a1));
delete[] lines;
}
else
sipIsErr = 1;
%End
void drawLines(const QPoint *pointPairs /Array/, int lineCount /ArraySize/);
%MethodCode
sipCpp->drawLines(a0, a1 / 2);
%End
void drawLines(const QPoint *pointPair, ... /TypeHint="QPoint"/);
%MethodCode
QPoint *pairs = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
if (pairs)
{
sipCpp->drawLines(pairs, (1 + PyTuple_Size(a1)) / 2);
delete[] pairs;
}
else
sipIsErr = 1;
%End
void drawRects(const QRectF *rects /Array/, int rectCount /ArraySize/);
void drawRects(const QRectF *rect, ... /TypeHint="QRectF"/);
%MethodCode
QRectF *rects = qtgui_inst_array<QRectF>(a0, a1, sipType_QRectF);
if (rects)
{
sipCpp->drawRects(rects, 1 + PyTuple_Size(a1));
delete[] rects;
}
else
sipIsErr = 1;
%End
void drawRects(const QRect *rects /Array/, int rectCount /ArraySize/);
void drawRects(const QRect *rect, ... /TypeHint="QRect"/);
%MethodCode
QRect *rects = qtgui_inst_array<QRect>(a0, a1, sipType_QRect);
if (rects)
{
sipCpp->drawRects(rects, 1 + PyTuple_Size(a1));
delete[] rects;
}
else
sipIsErr = 1;
%End
void drawEllipse(const QRectF &r);
void drawEllipse(const QRect &r);
void drawPolyline(const QPolygonF &polyline);
void drawPolyline(const QPolygon &polyline);
void drawPolyline(const QPointF *points /Array/, int pointCount /ArraySize/);
void drawPolyline(const QPointF *point, ... /TypeHint="QPointF"/);
%MethodCode
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
if (points)
{
sipCpp->drawPolyline(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawPolyline(const QPoint *points /Array/, int pointCount /ArraySize/);
void drawPolyline(const QPoint *point, ... /TypeHint="QPoint"/);
%MethodCode
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
if (points)
{
sipCpp->drawPolyline(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawPolygon(const QPolygonF &points, Qt::FillRule fillRule = Qt::OddEvenFill);
void drawPolygon(const QPolygon &points, Qt::FillRule fillRule = Qt::OddEvenFill);
void drawPolygon(const QPointF *points /Array/, int pointCount /ArraySize/, Qt::FillRule fillRule = Qt::OddEvenFill);
void drawPolygon(const QPointF *point, ... /TypeHint="QPointF"/);
%MethodCode
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
if (points)
{
sipCpp->drawPolygon(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawPolygon(const QPoint *points /Array/, int pointCount /ArraySize/, Qt::FillRule fillRule = Qt::OddEvenFill);
void drawPolygon(const QPoint *point, ... /TypeHint="QPoint"/);
%MethodCode
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
if (points)
{
sipCpp->drawPolygon(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawConvexPolygon(const QPolygonF &poly);
void drawConvexPolygon(const QPolygon &poly);
void drawConvexPolygon(const QPointF *points /Array/, int pointCount /ArraySize/);
void drawConvexPolygon(const QPointF *point, ... /TypeHint="QPointF"/);
%MethodCode
QPointF *points = qtgui_inst_array<QPointF>(a0, a1, sipType_QPointF);
if (points)
{
sipCpp->drawConvexPolygon(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawConvexPolygon(const QPoint *points /Array/, int pointCount /ArraySize/);
void drawConvexPolygon(const QPoint *point, ... /TypeHint="QPoint"/);
%MethodCode
QPoint *points = qtgui_inst_array<QPoint>(a0, a1, sipType_QPoint);
if (points)
{
sipCpp->drawConvexPolygon(points, 1 + PyTuple_Size(a1));
delete[] points;
}
else
sipIsErr = 1;
%End
void drawArc(const QRectF &rect, int a, int alen);
void drawPie(const QRectF &rect, int a, int alen);
void drawChord(const QRectF &rect, int a, int alen);
void drawTiledPixmap(const QRectF &rectangle, const QPixmap &pixmap, const QPointF &pos = QPointF());
void drawPicture(const QPointF &p, const QPicture &picture);
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect);
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;
void drawText(const QPointF &p, const QString &s);
void drawText(const QRectF &rectangle, int flags, const QString &text, QRectF *boundingRect /Out/ = 0);
void drawText(const QRect &rectangle, int flags, const QString &text, QRect *boundingRect /Out/ = 0);
void drawText(const QRectF &rectangle, const QString &text, const QTextOption &option = QTextOption());
QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
QRect boundingRect(const QRect &rect, int flags, const QString &text);
QRectF boundingRect(const QRectF &rectangle, const QString &text, const QTextOption &option = QTextOption());
void fillRect(const QRectF &, const QBrush &);
void fillRect(const QRect &, const QBrush &);
void eraseRect(const QRectF &);
void setRenderHint(QPainter::RenderHint hint, bool on = true);
QPainter::RenderHints renderHints() const;
void setRenderHints(QPainter::RenderHints hints, bool on = true);
QPaintEngine *paintEngine() const;
void drawLine(const QLineF &l);
void drawLine(const QLine &line);
void drawLine(int x1, int y1, int x2, int y2);
void drawLine(const QPoint &p1, const QPoint &p2);
void drawLine(const QPointF &p1, const QPointF &p2);
void drawRect(const QRectF &rect);
void drawRect(int x, int y, int w, int h);
void drawRect(const QRect &r);
void drawPoint(const QPointF &p);
void drawPoint(int x, int y);
void drawPoint(const QPoint &p);
void drawEllipse(int x, int y, int w, int h);
void drawArc(const QRect &r, int a, int alen);
void drawArc(int x, int y, int w, int h, int a, int alen);
void drawPie(const QRect &rect, int a, int alen);
void drawPie(int x, int y, int w, int h, int a, int alen);
void drawChord(const QRect &rect, int a, int alen);
void drawChord(int x, int y, int w, int h, int a, int alen);
void setClipRect(int x, int y, int width, int height, Qt::ClipOperation operation = Qt::ReplaceClip);
void setClipRect(const QRect &rectangle, Qt::ClipOperation operation = Qt::ReplaceClip);
void eraseRect(const QRect &rect);
void eraseRect(int x, int y, int w, int h);
void fillRect(int x, int y, int w, int h, const QBrush &b);
void setBrushOrigin(int x, int y);
void setBrushOrigin(const QPoint &p);
void drawTiledPixmap(const QRect &rectangle, const QPixmap &pixmap, const QPoint &pos = QPoint());
void drawTiledPixmap(int x, int y, int width, int height, const QPixmap &pixmap, int sx = 0, int sy = 0);
void drawPixmap(const QRect &targetRect, const QPixmap &pixmap, const QRect &sourceRect);
void drawPixmap(const QPointF &p, const QPixmap &pm);
void drawPixmap(const QPoint &p, const QPixmap &pm);
void drawPixmap(const QRect &r, const QPixmap &pm);
void drawPixmap(int x, int y, const QPixmap &pm);
void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
void drawPixmap(int x, int y, int w, int h, const QPixmap &pm, int sx, int sy, int sw, int sh);
void drawPixmap(int x, int y, const QPixmap &pm, int sx, int sy, int sw, int sh);
void drawPixmap(const QPointF &p, const QPixmap &pm, const QRectF &sr);
void drawPixmap(const QPoint &p, const QPixmap &pm, const QRect &sr);
void drawImage(const QRectF &r, const QImage &image);
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags = Qt::AutoColor);
void drawImage(const QRect &r, const QImage &image);
void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect, Qt::ImageConversionFlags flags = Qt::AutoColor);
void drawImage(const QPointF &p, const QImage &image);
void drawImage(const QPointF &p, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor);
void drawImage(const QPoint &p, const QImage &image);
void drawImage(const QPoint &p, const QImage &image, const QRect &sr, Qt::ImageConversionFlags flags = Qt::AutoColor);
void drawImage(int x, int y, const QImage &image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor);
void drawText(const QPoint &p, const QString &s);
void drawText(int x, int y, int width, int height, int flags, const QString &text, QRect *boundingRect /Out/ = 0);
void drawText(int x, int y, const QString &s);
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
qreal opacity() const;
void setOpacity(qreal opacity);
void translate(qreal dx, qreal dy);
void translate(const QPoint &offset);
void setViewport(int x, int y, int w, int h);
void setWindow(int x, int y, int w, int h);
bool worldMatrixEnabled() const;
void setWorldMatrixEnabled(bool enabled);
void drawPicture(int x, int y, const QPicture &p);
void drawPicture(const QPoint &pt, const QPicture &p);
void setTransform(const QTransform &transform, bool combine = false);
const QTransform &transform() const;
const QTransform &deviceTransform() const;
void resetTransform();
void setWorldTransform(const QTransform &matrix, bool combine = false);
const QTransform &worldTransform() const;
QTransform combinedTransform() const;
bool testRenderHint(QPainter::RenderHint hint) const;
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
void drawRoundedRect(int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
void drawRoundedRect(const QRect &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
void drawEllipse(const QPointF &center, qreal rx, qreal ry);
void drawEllipse(const QPoint &center, int rx, int ry);
void fillRect(const QRectF &, const QColor &color);
void fillRect(const QRect &, const QColor &color);
void fillRect(int x, int y, int w, int h, const QColor &b);
void fillRect(int x, int y, int w, int h, Qt::GlobalColor c);
void fillRect(const QRect &r, Qt::GlobalColor c);
void fillRect(const QRectF &r, Qt::GlobalColor c);
void fillRect(int x, int y, int w, int h, Qt::BrushStyle style);
void fillRect(const QRect &r, Qt::BrushStyle style);
void fillRect(const QRectF &r, Qt::BrushStyle style);
void beginNativePainting();
void endNativePainting();
class PixmapFragment
{
%TypeHeaderCode
#include <qpainter.h>
%End
public:
qreal x;
qreal y;
qreal sourceLeft;
qreal sourceTop;
qreal width;
qreal height;
qreal scaleX;
qreal scaleY;
qreal rotation;
qreal opacity;
static QPainter::PixmapFragment create(const QPointF &pos, const QRectF &sourceRect, qreal scaleX = 1, qreal scaleY = 1, qreal rotation = 0, qreal opacity = 1) /Factory/;
};
enum PixmapFragmentHint /BaseType=Flag/
{
OpaqueHint,
};
typedef QFlags<QPainter::PixmapFragmentHint> PixmapFragmentHints;
void drawPixmapFragments(const QPainter::PixmapFragment *fragments /Array/, int fragmentCount /ArraySize/, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints = QPainter::PixmapFragmentHints());
void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText);
void drawStaticText(const QPoint &p, const QStaticText &staticText);
void drawStaticText(int x, int y, const QStaticText &staticText);
QRectF clipBoundingRect() const;
%If (PyQt_RawFont)
void drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun);
%End
void fillRect(int x, int y, int w, int h, QGradient::Preset preset);
void fillRect(const QRect &r, QGradient::Preset preset);
void fillRect(const QRectF &r, QGradient::Preset preset);
private:
QPainter(const QPainter &);
};

View File

@@ -0,0 +1,174 @@
// qpainterpath.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPainterPath
{
%TypeHeaderCode
#include <qpainterpath.h>
%End
public:
enum ElementType
{
MoveToElement,
LineToElement,
CurveToElement,
CurveToDataElement,
};
class Element
{
%TypeHeaderCode
#include <qpainterpath.h>
%End
public:
qreal x;
qreal y;
QPainterPath::ElementType type;
bool isMoveTo() const;
bool isLineTo() const;
bool isCurveTo() const;
bool operator==(const QPainterPath::Element &e) const;
bool operator!=(const QPainterPath::Element &e) const;
operator QPointF() const;
};
QPainterPath();
explicit QPainterPath(const QPointF &startPoint);
QPainterPath(const QPainterPath &other);
~QPainterPath();
void closeSubpath();
void moveTo(const QPointF &p);
void lineTo(const QPointF &p);
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength);
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt);
void quadTo(const QPointF &ctrlPt, const QPointF &endPt);
QPointF currentPosition() const;
void addRect(const QRectF &rect);
void addEllipse(const QRectF &rect);
void addPolygon(const QPolygonF &polygon);
void addText(const QPointF &point, const QFont &f, const QString &text);
void addPath(const QPainterPath &path);
void addRegion(const QRegion &region);
void connectPath(const QPainterPath &path);
bool contains(const QPointF &pt) const;
bool contains(const QRectF &rect) const;
bool intersects(const QRectF &rect) const;
QRectF boundingRect() const;
QRectF controlPointRect() const;
Qt::FillRule fillRule() const;
void setFillRule(Qt::FillRule fillRule);
QPainterPath toReversed() const;
QList<QPolygonF> toSubpathPolygons(const QTransform &matrix = QTransform()) const;
QList<QPolygonF> toFillPolygons(const QTransform &matrix = QTransform()) const;
QPolygonF toFillPolygon(const QTransform &matrix = QTransform()) const;
bool operator==(const QPainterPath &other) const;
bool operator!=(const QPainterPath &other) const;
void moveTo(qreal x, qreal y);
void arcMoveTo(const QRectF &rect, qreal angle);
void arcMoveTo(qreal x, qreal y, qreal w, qreal h, qreal angle);
void arcTo(qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLenght);
void lineTo(qreal x, qreal y);
void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty);
void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty);
void addEllipse(qreal x, qreal y, qreal w, qreal h);
void addRect(qreal x, qreal y, qreal w, qreal h);
void addText(qreal x, qreal y, const QFont &f, const QString &text);
bool isEmpty() const;
int elementCount() const;
QPainterPath::Element elementAt(int i) const;
void setElementPositionAt(int i, qreal x, qreal y);
qreal length() const;
qreal percentAtLength(qreal t) const;
QPointF pointAtPercent(qreal t) const;
qreal angleAtPercent(qreal t) const;
qreal slopeAtPercent(qreal t) const;
bool intersects(const QPainterPath &p) const;
bool contains(const QPainterPath &p) const;
QPainterPath united(const QPainterPath &r) const;
QPainterPath intersected(const QPainterPath &r) const;
QPainterPath subtracted(const QPainterPath &r) const;
void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
void addRoundedRect(qreal x, qreal y, qreal w, qreal h, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize);
void addEllipse(const QPointF &center, qreal rx, qreal ry);
QPainterPath simplified() const;
QPainterPath operator&(const QPainterPath &other) const;
QPainterPath operator|(const QPainterPath &other) const;
QPainterPath operator+(const QPainterPath &other) const;
QPainterPath operator-(const QPainterPath &other) const;
QPainterPath &operator&=(const QPainterPath &other);
QPainterPath &operator|=(const QPainterPath &other);
QPainterPath &operator+=(const QPainterPath &other);
QPainterPath &operator-=(const QPainterPath &other);
void translate(qreal dx, qreal dy);
QPainterPath translated(qreal dx, qreal dy) const;
void translate(const QPointF &offset);
QPainterPath translated(const QPointF &offset) const;
void swap(QPainterPath &other /Constrained/);
void clear();
void reserve(int size);
int capacity() const;
%If (Qt_6_10_0 -)
bool isCachingEnabled() const;
%End
%If (Qt_6_10_0 -)
void setCachingEnabled(bool enabled);
%End
%If (Qt_6_10_0 -)
QPainterPath trimmed(qreal fromFraction, qreal toFraction, qreal offset = 0) const;
%End
};
QDataStream &operator<<(QDataStream &, const QPainterPath &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QPainterPath & /Constrained/) /ReleaseGIL/;
class QPainterPathStroker
{
%TypeHeaderCode
#include <qpainterpath.h>
%End
public:
QPainterPathStroker();
explicit QPainterPathStroker(const QPen &pen);
~QPainterPathStroker();
void setWidth(qreal width);
qreal width() const;
void setCapStyle(Qt::PenCapStyle style);
Qt::PenCapStyle capStyle() const;
void setJoinStyle(Qt::PenJoinStyle style);
Qt::PenJoinStyle joinStyle() const;
void setMiterLimit(qreal length);
qreal miterLimit() const;
void setCurveThreshold(qreal threshold);
qreal curveThreshold() const;
void setDashPattern(Qt::PenStyle);
void setDashPattern(const QList<qreal> &dashPattern);
QList<qreal> dashPattern() const;
QPainterPath createStroke(const QPainterPath &path) const;
void setDashOffset(qreal offset);
qreal dashOffset() const;
private:
QPainterPathStroker(const QPainterPathStroker &);
};

View File

@@ -0,0 +1,48 @@
// qpainterstateguard.sip generated by MetaSIP
//
// This file is part of the QtGui 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 -)
class QPainterStateGuard
{
%TypeHeaderCode
#include <qpainterstateguard.h>
%End
public:
enum class InitialState
{
Save,
NoSave,
};
QPainterStateGuard(QPainter *painter, QPainterStateGuard::InitialState state = QPainterStateGuard::InitialState::Save);
~QPainterStateGuard();
void swap(QPainterStateGuard &other /Constrained/);
void save();
void restore();
private:
QPainterStateGuard(const QPainterStateGuard &);
};
%End

View File

@@ -0,0 +1,131 @@
// qpalette.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPalette
{
%TypeHeaderCode
#include <qpalette.h>
%End
public:
QPalette();
QPalette(const QColor &button);
QPalette(Qt::GlobalColor button);
QPalette(const QColor &button, const QColor &background);
QPalette(const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background);
QPalette(const QPalette &palette);
QPalette(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QPalette>())
sipCpp = new QPalette(a0->value<QPalette>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QPalette();
enum ColorGroup
{
Active,
Disabled,
Inactive,
NColorGroups,
Current,
All,
Normal,
};
enum ColorRole
{
WindowText,
Button,
Light,
Midlight,
Dark,
Mid,
Text,
BrightText,
ButtonText,
Base,
Window,
Shadow,
Highlight,
HighlightedText,
Link,
LinkVisited,
AlternateBase,
ToolTipBase,
ToolTipText,
PlaceholderText,
%If (Qt_6_6_0 -)
Accent,
%End
NoRole,
NColorRoles,
};
QPalette::ColorGroup currentColorGroup() const;
void setCurrentColorGroup(QPalette::ColorGroup cg);
const QColor &color(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
const QBrush &brush(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
void setBrush(QPalette::ColorGroup cg, QPalette::ColorRole cr, const QBrush &brush);
void setColorGroup(QPalette::ColorGroup cr, const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background);
bool isEqual(QPalette::ColorGroup cr1, QPalette::ColorGroup cr2) const;
const QColor &color(QPalette::ColorRole cr) const;
const QBrush &brush(QPalette::ColorRole cr) const;
const QBrush &windowText() const;
const QBrush &button() const;
const QBrush &light() const;
const QBrush &dark() const;
const QBrush &mid() const;
const QBrush &text() const;
const QBrush &base() const;
const QBrush &alternateBase() const;
const QBrush &window() const;
const QBrush &midlight() const;
const QBrush &brightText() const;
const QBrush &buttonText() const;
const QBrush &shadow() const;
const QBrush &highlight() const;
const QBrush &highlightedText() const;
const QBrush &link() const;
const QBrush &linkVisited() const;
const QBrush &toolTipBase() const;
const QBrush &toolTipText() const;
const QBrush &placeholderText() const;
bool operator==(const QPalette &p) const;
bool operator!=(const QPalette &p) const;
bool isCopyOf(const QPalette &p) const;
QPalette resolve(const QPalette &) const;
void setColor(QPalette::ColorGroup acg, QPalette::ColorRole acr, const QColor &acolor);
void setColor(QPalette::ColorRole acr, const QColor &acolor);
void setBrush(QPalette::ColorRole acr, const QBrush &abrush);
bool isBrushSet(QPalette::ColorGroup cg, QPalette::ColorRole cr) const;
qint64 cacheKey() const;
void swap(QPalette &other /Constrained/);
%If (Qt_6_6_0 -)
const QBrush &accent() const;
%End
};
QDataStream &operator<<(QDataStream &s, const QPalette &p) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &ds, QPalette &p /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,46 @@
// qpdfoutputintent.sip generated by MetaSIP
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_8_0 -)
class QPdfOutputIntent
{
%TypeHeaderCode
#include <qpdfoutputintent.h>
%End
public:
QPdfOutputIntent();
QPdfOutputIntent(const QPdfOutputIntent &other);
~QPdfOutputIntent();
void swap(QPdfOutputIntent &other);
QString outputConditionIdentifier() const;
void setOutputConditionIdentifier(const QString &identifier);
QString outputCondition() const;
void setOutputCondition(const QString &condition);
QUrl registryName() const;
void setRegistryName(const QUrl &name);
QColorSpace outputProfile() const;
void setOutputProfile(const QColorSpace &profile);
};
%End

View File

@@ -0,0 +1,86 @@
// qpdfwriter.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPdfWriter : public QObject, public QPagedPaintDevice
{
%TypeHeaderCode
#include <qpdfwriter.h>
%End
public:
explicit QPdfWriter(const QString &filename);
explicit QPdfWriter(QIODevice *device);
virtual ~QPdfWriter();
QString title() const;
void setTitle(const QString &title);
QString creator() const;
void setCreator(const QString &creator);
virtual bool newPage();
protected:
virtual QPaintEngine *paintEngine() const;
virtual int metric(QPaintDevice::PaintDeviceMetric id) const;
public:
void setResolution(int resolution);
int resolution() const;
void setPdfVersion(QPagedPaintDevice::PdfVersion version);
QPagedPaintDevice::PdfVersion pdfVersion() const;
void setDocumentXmpMetadata(const QByteArray &xmpMetadata);
QByteArray documentXmpMetadata() const;
void addFileAttachment(const QString &fileName, const QByteArray &data, const QString &mimeType = QString());
%If (Qt_6_8_0 -)
QUuid documentId() const;
%End
%If (Qt_6_8_0 -)
void setDocumentId(QUuid documentId);
%End
%If (Qt_6_8_0 -)
enum class ColorModel
{
RGB,
Grayscale,
CMYK,
Auto,
};
%End
%If (Qt_6_8_0 -)
QPdfWriter::ColorModel colorModel() const;
%End
%If (Qt_6_8_0 -)
void setColorModel(QPdfWriter::ColorModel model);
%End
%If (Qt_6_8_0 -)
QPdfOutputIntent outputIntent() const;
%End
%If (Qt_6_8_0 -)
void setOutputIntent(const QPdfOutputIntent &intent);
%End
%If (Qt_6_9_0 -)
QString author() const;
%End
%If (Qt_6_9_0 -)
void setAuthor(const QString &author);
%End
};

View File

@@ -0,0 +1,121 @@
// qpen.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPen /TypeHintIn="Union[QPen, QColor]"/
{
%TypeHeaderCode
#include <qpen.h>
%End
%ConvertToTypeCode
// SIP doesn't support automatic type convertors so we explicitly allow a
// QColor to be used whenever a QPen is expected.
if (sipIsErr == NULL)
return (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS) ||
sipCanConvertToType(sipPy, sipType_QColor, 0));
if (sipCanConvertToType(sipPy, sipType_QPen, SIP_NO_CONVERTORS))
{
*sipCppPtr = reinterpret_cast<QPen *>(sipConvertToType(sipPy, sipType_QPen, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
return 0;
}
int state;
QColor *c = reinterpret_cast<QColor *>(sipConvertToType(sipPy, sipType_QColor, 0, 0, &state, sipIsErr));
if (*sipIsErr)
{
sipReleaseType(c, sipType_QColor, state);
return 0;
}
*sipCppPtr = new QPen(*c);
sipReleaseType(c, sipType_QColor, state);
return sipGetState(sipTransferObj);
%End
public:
QPen();
QPen(Qt::PenStyle);
QPen(const QBrush &brush, qreal width, Qt::PenStyle style = Qt::SolidLine, Qt::PenCapStyle cap = Qt::SquareCap, Qt::PenJoinStyle join = Qt::BevelJoin);
QPen(const QPen &pen);
QPen(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QPen>())
sipCpp = new QPen(a0->value<QPen>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QPen();
Qt::PenStyle style() const;
void setStyle(Qt::PenStyle);
qreal widthF() const;
void setWidthF(qreal width);
int width() const;
void setWidth(int width);
QColor color() const;
void setColor(const QColor &color);
QBrush brush() const;
void setBrush(const QBrush &brush);
bool isSolid() const;
Qt::PenCapStyle capStyle() const;
void setCapStyle(Qt::PenCapStyle pcs);
Qt::PenJoinStyle joinStyle() const;
void setJoinStyle(Qt::PenJoinStyle pcs);
QList<qreal> dashPattern() const;
void setDashPattern(const QList<qreal> &pattern);
qreal miterLimit() const;
void setMiterLimit(qreal limit);
bool operator==(const QPen &p) const;
bool operator!=(const QPen &p) const;
qreal dashOffset() const;
void setDashOffset(qreal doffset);
bool isCosmetic() const;
void setCosmetic(bool cosmetic);
void swap(QPen &other /Constrained/);
};
QDataStream &operator<<(QDataStream &, const QPen &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QPen & /Constrained/) /ReleaseGIL/;
%If (Qt_6_9_0 -)
bool operator!=(const QPen &lhs, const Qt::PenStyle &rhs);
%End
%If (Qt_6_9_0 -)
bool operator!=(const QPen &lhs, const QColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator!=(const QColor &lhs, const QPen &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QPen &lhs, const Qt::PenStyle &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QPen &lhs, const QColor &rhs);
%End
%If (Qt_6_9_0 -)
bool operator==(const QColor &lhs, const QPen &rhs);
%End

View File

@@ -0,0 +1,57 @@
// qpicture.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPicture : public QPaintDevice
{
%TypeHeaderCode
#include <qpicture.h>
%End
public:
explicit QPicture(int formatVersion = -1);
QPicture(const QPicture &);
virtual ~QPicture();
bool isNull() const;
virtual int devType() const;
uint size() const;
const char *data() const /Encoding="None"/;
virtual void setData(const char *data /Array/, uint size /ArraySize/);
bool play(QPainter *p);
bool load(const QString &fileName) /ReleaseGIL/;
bool load(QIODevice *dev) /ReleaseGIL/;
bool save(const QString &fileName) /ReleaseGIL/;
bool save(QIODevice *dev) /ReleaseGIL/;
QRect boundingRect() const;
void setBoundingRect(const QRect &r);
void detach();
bool isDetached() const;
virtual QPaintEngine *paintEngine() const;
protected:
virtual int metric(QPaintDevice::PaintDeviceMetric m) const;
public:
void swap(QPicture &other /Constrained/);
};
QDataStream &operator<<(QDataStream &in, const QPicture &p) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &in, QPicture &p /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,134 @@
// qpixelformat.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qpixelformat.h>
%End
class QPixelFormat
{
%TypeHeaderCode
#include <qpixelformat.h>
%End
public:
enum ColorModel
{
RGB,
BGR,
Indexed,
Grayscale,
CMYK,
HSL,
HSV,
YUV,
Alpha,
};
enum AlphaUsage
{
UsesAlpha,
IgnoresAlpha,
};
enum AlphaPosition
{
AtBeginning,
AtEnd,
};
enum AlphaPremultiplied
{
NotPremultiplied,
Premultiplied,
};
enum TypeInterpretation
{
UnsignedInteger,
UnsignedShort,
UnsignedByte,
FloatingPoint,
};
enum YUVLayout
{
YUV444,
YUV422,
YUV411,
YUV420P,
YUV420SP,
YV12,
UYVY,
YUYV,
NV12,
NV21,
IMC1,
IMC2,
IMC3,
IMC4,
Y8,
Y16,
};
enum ByteOrder
{
LittleEndian,
BigEndian,
CurrentSystemEndian,
};
QPixelFormat();
QPixelFormat(QPixelFormat::ColorModel mdl, uchar firstSize /PyInt/, uchar secondSize /PyInt/, uchar thirdSize /PyInt/, uchar fourthSize /PyInt/, uchar fifthSize /PyInt/, uchar alfa /PyInt/, QPixelFormat::AlphaUsage usage, QPixelFormat::AlphaPosition position, QPixelFormat::AlphaPremultiplied premult, QPixelFormat::TypeInterpretation typeInterp, QPixelFormat::ByteOrder byteOrder = QPixelFormat::CurrentSystemEndian, uchar subEnum /PyInt/ = 0);
QPixelFormat::ColorModel colorModel() const;
uchar channelCount() const /PyInt/;
uchar redSize() const /PyInt/;
uchar greenSize() const /PyInt/;
uchar blueSize() const /PyInt/;
uchar cyanSize() const /PyInt/;
uchar magentaSize() const /PyInt/;
uchar yellowSize() const /PyInt/;
uchar blackSize() const /PyInt/;
uchar hueSize() const /PyInt/;
uchar saturationSize() const /PyInt/;
uchar lightnessSize() const /PyInt/;
uchar brightnessSize() const /PyInt/;
uchar alphaSize() const /PyInt/;
uchar bitsPerPixel() const /PyInt/;
QPixelFormat::AlphaUsage alphaUsage() const;
QPixelFormat::AlphaPosition alphaPosition() const;
QPixelFormat::AlphaPremultiplied premultiplied() const;
QPixelFormat::TypeInterpretation typeInterpretation() const;
QPixelFormat::ByteOrder byteOrder() const;
QPixelFormat::YUVLayout yuvLayout() const;
uchar subEnum() const /PyInt/;
};
bool operator==(QPixelFormat fmt1, QPixelFormat fmt2);
bool operator!=(QPixelFormat fmt1, QPixelFormat fmt2);
QPixelFormat qPixelFormatRgba(uchar red /PyInt/, uchar green /PyInt/, uchar blue /PyInt/, uchar alfa /PyInt/, QPixelFormat::AlphaUsage usage, QPixelFormat::AlphaPosition position, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
QPixelFormat qPixelFormatGrayscale(uchar channelSize /PyInt/, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
QPixelFormat qPixelFormatCmyk(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);
QPixelFormat qPixelFormatHsl(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint);
QPixelFormat qPixelFormatHsv(uchar channelSize /PyInt/, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::FloatingPoint);
QPixelFormat qPixelFormatYuv(QPixelFormat::YUVLayout layout, uchar alphaSize /PyInt/ = 0, QPixelFormat::AlphaUsage alphaUsage = QPixelFormat::IgnoresAlpha, QPixelFormat::AlphaPosition alphaPosition = QPixelFormat::AtBeginning, QPixelFormat::AlphaPremultiplied premultiplied = QPixelFormat::NotPremultiplied, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedByte, QPixelFormat::ByteOrder byteOrder = QPixelFormat::LittleEndian);
QPixelFormat qPixelFormatAlpha(uchar channelSize /PyInt/, QPixelFormat::TypeInterpretation typeInterpretation = QPixelFormat::UnsignedInteger);

View File

@@ -0,0 +1,111 @@
// qpixmap.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPixmap : public QPaintDevice
{
%TypeHeaderCode
#include <qpixmap.h>
%End
public:
QPixmap();
QPixmap(int w, int h);
explicit QPixmap(const QSize &);
QPixmap(const QString &fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
explicit QPixmap(SIP_PYLIST xpm /TypeHint="List[str]"/) [(const char * const *xpm)];
%MethodCode
// The Python interface is a list of ASCII strings that make up the image.
const char **str = QtGui_ListToArray(a0);
if (str)
{
sipCpp = new sipQPixmap(str);
QtGui_DeleteArray(str);
}
else
sipIsErr = 1;
%End
QPixmap(const QPixmap &);
QPixmap(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QPixmap>())
sipCpp = new sipQPixmap(a0->value<QPixmap>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
virtual ~QPixmap();
bool isNull() const;
virtual int devType() const;
int width() const;
int height() const;
QSize size() const;
QRect rect() const;
int depth() const;
static int defaultDepth();
void fill(const QColor &color = Qt::white);
QBitmap mask() const;
void setMask(const QBitmap &);
bool hasAlpha() const;
bool hasAlphaChannel() const;
QBitmap createHeuristicMask(bool clipTight = true) const;
QBitmap createMaskFromColor(const QColor &maskColor, Qt::MaskMode mode = Qt::MaskInColor) const;
QPixmap scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
QPixmap scaled(const QSize &size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation) const;
QPixmap scaledToWidth(int width, Qt::TransformationMode mode = Qt::FastTransformation) const;
QPixmap scaledToHeight(int height, Qt::TransformationMode mode = Qt::FastTransformation) const;
QImage toImage() const;
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
static QPixmap fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool load(const QString &fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool loadFromData(const uchar *buf /Array/, uint len /ArraySize/, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool loadFromData(const QByteArray &buf, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool save(const QString &fileName, const char *format = 0, int quality = -1) const;
bool save(QIODevice *device, const char *format = 0, int quality = -1) const;
QPixmap copy(const QRect &rect = QRect()) const;
void detach();
bool isQBitmap() const;
virtual QPaintEngine *paintEngine() const;
protected:
virtual int metric(QPaintDevice::PaintDeviceMetric) const;
public:
QPixmap copy(int ax, int ay, int awidth, int aheight) const;
QPixmap transformed(const QTransform &transform, Qt::TransformationMode mode = Qt::FastTransformation) const;
static QTransform trueMatrix(const QTransform &m, int w, int h);
qint64 cacheKey() const;
void scroll(int dx, int dy, const QRect &rect, QRegion *exposed /Out/ = 0);
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed /Out/ = 0);
void swap(QPixmap &other /Constrained/);
qreal devicePixelRatio() const;
void setDevicePixelRatio(qreal scaleFactor);
%If (Qt_6_2_0 -)
QSizeF deviceIndependentSize() const;
%End
};
QDataStream &operator<<(QDataStream &, const QPixmap &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QPixmap & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,83 @@
// qpixmapcache.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPixmapCache
{
%TypeHeaderCode
#include <qpixmapcache.h>
%End
public:
class Key
{
%TypeHeaderCode
#include <qpixmapcache.h>
%End
public:
Key();
Key(const QPixmapCache::Key &other);
~Key();
bool operator==(const QPixmapCache::Key &key) const;
bool operator!=(const QPixmapCache::Key &key) const;
void swap(QPixmapCache::Key &other /Constrained/);
bool isValid() const;
%If (Qt_6_6_0 -)
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
%End
};
static int cacheLimit();
static void clear();
static QPixmap find(const QString &key);
%MethodCode
sipRes = new QPixmap;
if (!QPixmapCache::find(*a0, sipRes))
{
delete sipRes;
sipRes = 0;
}
%End
static QPixmap find(const QPixmapCache::Key &key);
%MethodCode
sipRes = new QPixmap;
if (!QPixmapCache::find(*a0, sipRes))
{
delete sipRes;
sipRes = 0;
}
%End
static bool insert(const QString &key, const QPixmap &);
static QPixmapCache::Key insert(const QPixmap &pixmap);
static void remove(const QString &key);
static void remove(const QPixmapCache::Key &key);
static bool replace(const QPixmapCache::Key &key, const QPixmap &pixmap);
static void setCacheLimit(int);
};

View File

@@ -0,0 +1,71 @@
// qpointingdevice.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPointingDeviceUniqueId
{
%TypeHeaderCode
#include <qpointingdevice.h>
%End
public:
QPointingDeviceUniqueId();
static QPointingDeviceUniqueId fromNumericId(qint64 id);
bool isValid() const;
qint64 numericId() const;
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs);
bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs);
class QPointingDevice : public QInputDevice
{
%TypeHeaderCode
#include <qpointingdevice.h>
%End
public:
enum class PointerType /BaseType=Flag/
{
Unknown,
Generic,
Finger,
Pen,
Eraser,
Cursor,
AllPointerTypes,
};
typedef QFlags<QPointingDevice::PointerType> PointerTypes;
QPointingDevice(const QString &name, qint64 systemId, QInputDevice::DeviceType devType, QPointingDevice::PointerType pType, QInputDevice::Capabilities caps, int maxPoints, int buttonCount, const QString &seatName = QString(), QPointingDeviceUniqueId uniqueId = QPointingDeviceUniqueId(), QObject *parent /TransferThis/ = 0);
QPointingDevice(QObject *parent /TransferThis/ = 0);
virtual ~QPointingDevice();
QPointingDevice::PointerType pointerType() const;
int maximumPoints() const;
int buttonCount() const;
QPointingDeviceUniqueId uniqueId() const;
static const QPointingDevice *primaryPointingDevice(const QString &seatName = QString());
bool operator==(const QPointingDevice &other) const;
};

View File

@@ -0,0 +1,461 @@
// qpolygon.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QPolygon
{
%TypeHeaderCode
#include <qpolygon.h>
%End
%PickleCode
PyObject *pl = PyList_New(sipCpp->count() * 2);
for (int p = 0, i = 0; i < sipCpp->count(); ++i, p += 2)
{
int x, y;
sipCpp->point(i, &x, &y);
PyList_SetItem(pl, p, PyLong_FromLong(x));
PyList_SetItem(pl, p + 1, PyLong_FromLong(y));
}
sipRes = Py_BuildValue("(N)", pl);
%End
public:
QPolygon();
QPolygon(const QRect &r, bool closed = false);
QPolygon(const QList<QPoint> &v);
QPolygon(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QPolygon>())
sipCpp = new QPolygon(a0->value<QPolygon>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
void swap(QPolygon &other /Constrained/);
void translate(int dx, int dy);
void translate(const QPoint &offset);
QPolygon translated(int dx, int dy) const;
QPolygon translated(const QPoint &offset) const;
QRect boundingRect() const;
QPoint point(int i) const;
void setPoint(int index, int x, int y);
void setPoint(int index, const QPoint &p);
void setPoints(int firstx, int firsty, ... /TypeHint="int"/);
%MethodCode
// Accept at least one pair of integer coordinates.
int nPoints = 1 + ((PyTuple_Size(a2) + 1) >> 1);
int *points = new int[nPoints * 2];
points[0] = a0;
points[1] = a1;
for (Py_ssize_t i = 0; i < PyTuple_Size(a2); ++i)
points[2 + i] = PyLong_AsLong(PyTuple_GetItem(a2, i));
sipCpp->setPoints(nPoints, points);
delete[] points;
%End
void putPoints(int index, int firstx, int firsty, ... /TypeHint="int"/);
%MethodCode
// Accept at least one pair of integer coordinates.
int nPoints = 1 + ((PyTuple_Size(a3) + 1) >> 1);
int *points = new int[nPoints * 2];
points[0] = a1;
points[1] = a2;
for (Py_ssize_t i = 0; i < PyTuple_Size(a3); ++i)
points[2 + i] = PyLong_AsLong(PyTuple_GetItem(a3, i));
sipCpp->putPoints(a0, nPoints, points);
delete[] points;
%End
void putPoints(int index, int nPoints, const QPolygon &fromPolygon, int from = 0);
bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
QPolygon united(const QPolygon &r) const;
QPolygon intersected(const QPolygon &r) const;
QPolygon subtracted(const QPolygon &r) const;
bool intersects(const QPolygon &r) const;
// Methods inherited from QList<QPoint> and Python special methods.
// Keep in sync with QPolygonF and QXmlStreamAttributes.
void append(const QPoint &value);
const QPoint &at(int i) const;
void clear();
bool contains(const QPoint &value) const;
int count(const QPoint &value) const;
int count() const /__len__/;
void *data();
// Note the Qt return value is discarded as it would require handwritten code
// and seems pretty useless.
void fill(const QPoint &value, int size = -1);
QPoint &first();
int indexOf(const QPoint &value, int from = 0) const;
void insert(int i, const QPoint &value);
bool isEmpty() const;
QPoint &last();
int lastIndexOf(const QPoint &value, int from = -1) const;
// Note the Qt return type is QList<QPoint>.
QPolygon mid(int pos, int length = -1) const;
void prepend(const QPoint &value);
void remove(int i);
void remove(int i, int count);
void replace(int i, const QPoint &value);
void resize(qsizetype size);
int size() const;
QPoint value(int i) const;
QPoint value(int i, const QPoint &defaultValue) const;
bool operator!=(const QPolygon &other) const;
// Note the Qt return type is QList<QPoint>.
QPolygon operator+(const QPolygon &other) const;
QPolygon &operator+=(const QPolygon &other);
QPolygon &operator+=(const QPoint &value);
bool operator==(const QPolygon &other) const;
SIP_PYOBJECT operator<<(const QPoint &value);
%MethodCode
*a0 << *a1;
sipRes = sipArg0;
Py_INCREF(sipRes);
%End
QPoint &operator[](int i);
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = &sipCpp->operator[]((int)idx);
%End
// Some additional Python special methods.
void __setitem__(int i, const QPoint &value);
%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 QPolygon &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
{
QList<QPoint>::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->remove(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->remove(start);
start += step - 1;
}
}
%End
QPolygon 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 QPolygon();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
(*sipRes) += (*sipCpp)[start];
start += step;
}
}
%End
int __contains__(const QPoint &value);
%MethodCode
sipRes = bool(sipCpp->contains(*a0));
%End
%If (Qt_6_4_0 -)
QPolygonF toPolygonF() const;
%End
};
QDataStream &operator<<(QDataStream &stream, const QPolygon &polygon) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &stream, QPolygon &polygon /Constrained/) /ReleaseGIL/;
class QPolygonF
{
%TypeHeaderCode
#include <qpolygon.h>
%End
public:
QPolygonF();
QPolygonF(const QList<QPointF> &v);
QPolygonF(const QRectF &r);
QPolygonF(const QPolygon &a);
QPolygonF(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QPolygonF>())
sipCpp = new QPolygonF(a0->value<QPolygonF>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
void swap(QPolygonF &other /Constrained/);
void translate(qreal dx, qreal dy);
void translate(const QPointF &offset);
QPolygonF translated(qreal dx, qreal dy) const;
QPolygonF translated(const QPointF &offset) const;
QPolygon toPolygon() const;
bool isClosed() const;
QRectF boundingRect() const;
bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
QPolygonF united(const QPolygonF &r) const;
QPolygonF intersected(const QPolygonF &r) const;
QPolygonF subtracted(const QPolygonF &r) const;
bool intersects(const QPolygonF &r) const;
// Methods inherited from QList<QPointF> and Python special methods.
// Keep in sync with QPolygon and QXmlStreamAttributes.
void append(const QPointF &value);
const QPointF &at(int i) const;
void clear();
bool contains(const QPointF &value) const;
int count(const QPointF &value) const;
int count() const /__len__/;
void *data();
// Note the Qt return value is discarded as it would require handwritten code
// and seems pretty useless.
void fill(const QPointF &value, int size = -1);
QPointF &first();
int indexOf(const QPointF &value, int from = 0) const;
void insert(int i, const QPointF &value);
bool isEmpty() const;
QPointF &last();
int lastIndexOf(const QPointF &value, int from = -1) const;
// Note the Qt return type is QList<QPointF>.
QPolygonF mid(int pos, int length = -1) const;
void prepend(const QPointF &value);
void remove(int i);
void remove(int i, int count);
void replace(int i, const QPointF &value);
void resize(qsizetype size);
int size() const;
QPointF value(int i) const;
QPointF value(int i, const QPointF &defaultValue) const;
bool operator!=(const QPolygonF &other) const;
// Note the Qt return type is QList<QPointF>.
QPolygonF operator+(const QPolygonF &other) const;
QPolygonF &operator+=(const QPolygonF &other);
QPolygonF &operator+=(const QPointF &value);
bool operator==(const QPolygonF &other) const;
SIP_PYOBJECT operator<<(const QPointF &value);
%MethodCode
*a0 << *a1;
sipRes = sipArg0;
Py_INCREF(sipRes);
%End
QPointF &operator[](int i);
%MethodCode
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
sipRes = &sipCpp->operator[]((int)idx);
%End
// Some additional Python special methods.
void __setitem__(int i, const QPointF &value);
%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 QPolygonF &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
{
QList<QPointF>::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->remove(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->remove(start);
start += step - 1;
}
}
%End
QPolygonF 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 QPolygonF();
for (Py_ssize_t i = 0; i < slicelength; ++i)
{
(*sipRes) += (*sipCpp)[start];
start += step;
}
}
%End
int __contains__(const QPointF &value);
%MethodCode
sipRes = bool(sipCpp->contains(*a0));
%End
};
QDataStream &operator<<(QDataStream &stream, const QPolygonF &array) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &stream, QPolygonF &array /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,48 @@
// This is the SIP specifications of the native interface support.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
namespace QNativeInterface
{
%If (PyQt_XCB)
struct QX11Application /Abstract/
{
%TypeHeaderCode
#include <QGuiApplication>
%End
virtual void *connection() const = 0;
};
%End
%If (PyQt_Wayland)
struct QWaylandApplication /Abstract/
{
%TypeHeaderCode
#include <QGuiApplication>
%End
virtual void *display() const = 0;
};
%End
};

View File

@@ -0,0 +1,102 @@
// This is the SIP interface definition for the QList based mapped types
// specific to the QtGui 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.
%MappedType QList<QFontDatabase::WritingSystem>
/TypeHintIn="Sequence[QFontDatabase.WritingSystem]",
TypeHintOut="List[QFontDatabase.WritingSystem]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qfontdatabase.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
PyObject *eobj = sipConvertFromEnum(sipCpp->at(i),
sipType_QFontDatabase_WritingSystem);
if (!eobj)
{
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, eobj);
}
return l;
%End
%ConvertToTypeCode
if (!sipIsErr)
return (PySequence_Check(sipPy) && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
Py_ssize_t len = PySequence_Size(sipPy);
if (len < 0)
return 0;
QList<QFontDatabase::WritingSystem> *ql = new QList<QFontDatabase::WritingSystem>;
for (Py_ssize_t i = 0; i < len; ++i)
{
PyObject *itm = PySequence_GetItem(sipPy, i);
if (!itm)
{
delete ql;
*sipIsErr = 1;
return 0;
}
int v = sipConvertToEnum(itm, sipType_QFontDatabase_WritingSystem);
if (PyErr_Occurred())
{
PyErr_Format(PyExc_TypeError,
"element %zd has type '%s' but 'QFontDatabase.WritingSystem' is expected",
i, sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete ql;
*sipIsErr = 1;
return 0;
}
ql->append(static_cast<QFontDatabase::WritingSystem>(v));
Py_DECREF(itm);
}
*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End
};

View File

@@ -0,0 +1,96 @@
// This is the SIP specifications of the Vulkan support.
//
// 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 (PyQt_Vulkan)
%ModuleCode
#include <qvulkaninstance.h>
%End
typedef void *VkSurfaceKHR;
struct QVulkanExtension
{
%TypeHeaderCode
#include <qvulkaninstance.h>
%End
QByteArray name;
unsigned version; // Actually uint32_t.
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
bool operator==(const QVulkanExtension &, const QVulkanExtension &);
bool operator!=(const QVulkanExtension &, const QVulkanExtension &);
struct QVulkanLayer
{
%TypeHeaderCode
#include <qvulkaninstance.h>
%End
QByteArray description;
QByteArray name;
QVersionNumber specVersion;
unsigned version; // Actually uint32_t.
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
bool operator==(const QVulkanLayer &, const QVulkanLayer &);
bool operator!=(const QVulkanLayer &, const QVulkanLayer &);
class QVulkanInstance
{
%TypeHeaderCode
#include <qvulkaninstance.h>
%End
public:
QVulkanInstance();
~QVulkanInstance();
QVersionNumber apiVersion() const;
void setApiVersion(const QVersionNumber &vulkanVersion);
QVersionNumber supportedApiVersion() const;
QList<QVulkanExtension> supportedExtensions() const;
QList<QVulkanLayer> supportedLayers() const;
bool create();
void destroy();
bool isValid() const;
static VkSurfaceKHR surfaceForWindow(QWindow *window);
private:
QVulkanInstance(const QVulkanInstance &);
};
%End

View File

@@ -0,0 +1,152 @@
// qquaternion.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qquaternion.h>
%End
class QQuaternion
{
%TypeHeaderCode
#include <qquaternion.h>
%End
%PickleCode
sipRes = Py_BuildValue("dddd", (double)sipCpp->scalar(),
(double)sipCpp->x(), (double)sipCpp->y(), (double)sipCpp->z());
%End
public:
QQuaternion();
QQuaternion(float aScalar, float xpos, float ypos, float zpos);
QQuaternion(float aScalar, const QVector3D &aVector);
explicit QQuaternion(const QVector4D &aVector);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
PyObject *scalar = PyFloat_FromDouble(sipCpp->scalar());
PyObject *x = PyFloat_FromDouble(sipCpp->x());
PyObject *y = PyFloat_FromDouble(sipCpp->y());
PyObject *z = PyFloat_FromDouble(sipCpp->z());
if (scalar && x && y && z)
sipRes = PyUnicode_FromFormat(
"PyQt6.QtGui.QQuaternion(%R, %R, %R, %R)", scalar,
x, y, z);
Py_XDECREF(scalar);
Py_XDECREF(x);
Py_XDECREF(y);
Py_XDECREF(z);
%End
float length() const;
float lengthSquared() const;
QQuaternion normalized() const;
void normalize();
QVector3D rotatedVector(const QVector3D &vector) const;
static QQuaternion fromAxisAndAngle(const QVector3D &axis, float angle);
static QQuaternion fromAxisAndAngle(float x, float y, float z, float angle);
static QQuaternion slerp(const QQuaternion &q1, const QQuaternion &q2, float t);
static QQuaternion nlerp(const QQuaternion &q1, const QQuaternion &q2, float t);
bool isNull() const;
bool isIdentity() const;
float x() const;
float y() const;
float z() const;
float scalar() const;
void setX(float aX);
void setY(float aY);
void setZ(float aZ);
void setScalar(float aScalar);
QQuaternion &operator+=(const QQuaternion &quaternion);
QQuaternion &operator-=(const QQuaternion &quaternion);
QQuaternion &operator*=(float factor);
QQuaternion &operator*=(const QQuaternion &quaternion);
QQuaternion &operator/=(float divisor);
void setVector(const QVector3D &aVector);
QVector3D vector() const;
void setVector(float aX, float aY, float aZ);
QVector4D toVector4D() const;
void getAxisAndAngle(QVector3D *axis /Out/, float *angle) const;
void getEulerAngles(float *pitch, float *yaw, float *roll) const;
static QQuaternion fromEulerAngles(float pitch, float yaw, float roll);
QMatrix3x3 toRotationMatrix() const;
static QQuaternion fromRotationMatrix(const QMatrix3x3 &rot3x3);
void getAxes(QVector3D *xAxis /Out/, QVector3D *yAxis /Out/, QVector3D *zAxis /Out/) const;
static QQuaternion fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis);
static QQuaternion fromDirection(const QVector3D &direction, const QVector3D &up);
static QQuaternion rotationTo(const QVector3D &from, const QVector3D &to);
static float dotProduct(const QQuaternion &q1, const QQuaternion &q2);
QQuaternion inverted() const;
QQuaternion conjugated() const;
QVector3D toEulerAngles() const;
static QQuaternion fromEulerAngles(const QVector3D &eulerAngles);
};
bool operator==(const QQuaternion &q1, const QQuaternion &q2);
bool operator!=(const QQuaternion &q1, const QQuaternion &q2);
%If (Qt_6_7_0 -)
QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (- Qt_6_7_0)
const QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (Qt_6_7_0 -)
QQuaternion operator*(const QQuaternion &quaternion, float factor);
%End
%If (- Qt_6_7_0)
const QQuaternion operator*(const QQuaternion &quaternion, float factor);
%End
%If (Qt_6_7_0 -)
QQuaternion operator*(float factor, const QQuaternion &quaternion);
%End
%If (- Qt_6_7_0)
const QQuaternion operator*(float factor, const QQuaternion &quaternion);
%End
QVector3D operator*(const QQuaternion &quaternion, const QVector3D &vec);
%If (Qt_6_7_0 -)
QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (- Qt_6_7_0)
const QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (Qt_6_7_0 -)
QQuaternion operator-(const QQuaternion &quaternion);
%End
%If (- Qt_6_7_0)
const QQuaternion operator-(const QQuaternion &quaternion);
%End
%If (Qt_6_7_0 -)
QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (- Qt_6_7_0)
const QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2);
%End
%If (Qt_6_7_0 -)
QQuaternion operator/(const QQuaternion &quaternion, float divisor);
%End
%If (- Qt_6_7_0)
const QQuaternion operator/(const QQuaternion &quaternion, float divisor);
%End
bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2);
QDataStream &operator<<(QDataStream &, const QQuaternion &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QQuaternion & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,38 @@
// qrasterwindow.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QRasterWindow : public QPaintDeviceWindow
{
%TypeHeaderCode
#include <qrasterwindow.h>
%End
public:
explicit QRasterWindow(QWindow *parent /TransferThis/ = 0);
virtual ~QRasterWindow();
protected:
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const;
%If (Qt_6_7_0 -)
virtual void resizeEvent(QResizeEvent *event);
%End
};

View File

@@ -0,0 +1,95 @@
// qrawfont.sip generated by MetaSIP
//
// This file is part of the QtGui 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 (PyQt_RawFont)
class QRawFont
{
%TypeHeaderCode
#include <qrawfont.h>
%End
public:
enum AntialiasingType
{
PixelAntialiasing,
SubPixelAntialiasing,
};
QRawFont();
QRawFont(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
QRawFont(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
QRawFont(const QRawFont &other);
~QRawFont();
bool isValid() const;
bool operator==(const QRawFont &other) const;
bool operator!=(const QRawFont &other) const;
QString familyName() const;
QString styleName() const;
QFont::Style style() const;
int weight() const;
QList<unsigned int> glyphIndexesForString(const QString &text) const;
QList<QPointF> advancesForGlyphIndexes(const QList<unsigned int> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const;
QList<QPointF> advancesForGlyphIndexes(const QList<unsigned int> &glyphIndexes) const;
QImage alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = QRawFont::SubPixelAntialiasing, const QTransform &transform = QTransform()) const;
QPainterPath pathForGlyph(quint32 glyphIndex) const;
void setPixelSize(qreal pixelSize);
qreal pixelSize() const;
QFont::HintingPreference hintingPreference() const;
qreal ascent() const;
qreal descent() const;
qreal leading() const;
qreal xHeight() const;
qreal averageCharWidth() const;
qreal maxCharWidth() const;
qreal unitsPerEm() const;
void loadFromFile(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
void loadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
bool supportsCharacter(uint ucs4) const;
bool supportsCharacter(QChar character) const;
QList<QFontDatabase::WritingSystem> supportedWritingSystems() const;
QByteArray fontTable(const char *tagName) const;
%If (Qt_6_7_0 -)
QByteArray fontTable(QFont::Tag tag) const;
%End
static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any);
QRectF boundingRect(quint32 glyphIndex) const;
qreal lineThickness() const;
qreal underlinePosition() const;
void swap(QRawFont &other /Constrained/);
enum LayoutFlag /BaseType=Flag/
{
SeparateAdvances,
KernedAdvances,
UseDesignMetrics,
};
typedef QFlags<QRawFont::LayoutFlag> LayoutFlags;
qreal capHeight() const;
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
%End

View File

@@ -0,0 +1,112 @@
// qregion.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QRegion
{
%TypeHeaderCode
#include <qregion.h>
%End
public:
enum RegionType
{
Rectangle,
Ellipse,
};
QRegion();
QRegion(int x, int y, int w, int h, QRegion::RegionType type = QRegion::Rectangle);
QRegion(const QRect &r, QRegion::RegionType type = QRegion::Rectangle);
QRegion(const QPolygon &a, Qt::FillRule fillRule = Qt::OddEvenFill);
QRegion(const QBitmap &bitmap);
QRegion(const QRegion &region);
QRegion(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QRegion>())
sipCpp = new QRegion(a0->value<QRegion>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QRegion();
bool isEmpty() const;
int __bool__() const;
%MethodCode
sipRes = !sipCpp->isEmpty();
%End
bool contains(const QPoint &p) const;
int __contains__(const QPoint &p) const;
%MethodCode
sipRes = sipCpp->contains(*a0);
%End
bool contains(const QRect &r) const;
int __contains__(const QRect &r) const;
%MethodCode
sipRes = sipCpp->contains(*a0);
%End
void translate(int dx, int dy);
void translate(const QPoint &p);
QRegion translated(int dx, int dy) const;
QRegion translated(const QPoint &p) const;
QRegion united(const QRegion &r) const;
QRegion united(const QRect &r) const;
QRect boundingRect() const;
QRegion operator|(const QRegion &r) const;
void setRects(const QList<QRect> &);
%MethodCode
if (a0->size())
sipCpp->setRects(a0->data(), a0->size());
else
sipCpp->setRects(0, 0);
%End
QRegion operator+(const QRegion &r) const;
QRegion operator+(const QRect &r) const;
QRegion operator&(const QRegion &r) const;
QRegion operator&(const QRect &r) const;
QRegion operator-(const QRegion &r) const;
QRegion operator^(const QRegion &r) const;
QRegion &operator|=(const QRegion &r);
QRegion &operator+=(const QRegion &r);
QRegion &operator+=(const QRect &r);
QRegion &operator&=(const QRegion &r);
QRegion &operator&=(const QRect &r);
QRegion &operator-=(const QRegion &r);
QRegion &operator^=(const QRegion &r);
bool operator==(const QRegion &r) const;
bool operator!=(const QRegion &r) const;
QRegion intersected(const QRegion &r) const;
QRegion intersected(const QRect &r) const;
QRegion subtracted(const QRegion &r) const;
QRegion xored(const QRegion &r) const;
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;
int rectCount() const;
void swap(QRegion &other /Constrained/);
bool isNull() const;
};
QDataStream &operator<<(QDataStream &, const QRegion &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QRegion & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,37 @@
// qrgb.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qrgb.h>
%End
typedef unsigned int QRgb;
int qRed(QRgb rgb);
int qGreen(QRgb rgb);
int qBlue(QRgb rgb);
int qAlpha(QRgb rgb);
QRgb qRgb(int r, int g, int b);
QRgb qRgba(int r, int g, int b, int a);
int qGray(int r, int g, int b);
int qGray(QRgb rgb);
QRgb qPremultiply(QRgb x);
QRgb qUnpremultiply(QRgb p);

View File

@@ -0,0 +1,67 @@
// qrgba64.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qrgba64.h>
%End
class QRgba64
{
%TypeHeaderCode
#include <qrgba64.h>
%End
public:
QRgba64();
static QRgba64 fromRgba64(quint64 c);
static QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha);
static QRgba64 fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha);
static QRgba64 fromArgb32(uint rgb);
bool isOpaque() const;
bool isTransparent() const;
quint16 red() const;
quint16 green() const;
quint16 blue() const;
quint16 alpha() const;
void setRed(quint16 _red);
void setGreen(quint16 _green);
void setBlue(quint16 _blue);
void setAlpha(quint16 _alpha);
quint8 red8() const;
quint8 green8() const;
quint8 blue8() const;
quint8 alpha8() const;
uint toArgb32() const;
ushort toRgb16() const;
QRgba64 premultiplied() const;
QRgba64 unpremultiplied() const;
operator quint64() const;
};
QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a);
QRgba64 qRgba64(quint64 c);
QRgba64 qPremultiply(QRgba64 c);
QRgba64 qUnpremultiply(QRgba64 c);
uint qRed(QRgba64 rgb);
uint qGreen(QRgba64 rgb);
uint qBlue(QRgba64 rgb);
uint qAlpha(QRgba64 rgb);

View File

@@ -0,0 +1,77 @@
// qscreen.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QScreen : public QObject /NoDefaultCtors/
{
%TypeHeaderCode
#include <qscreen.h>
%End
public:
virtual ~QScreen();
QString name() const;
int depth() const;
QSize size() const;
QRect geometry() const;
QSizeF physicalSize() const;
qreal physicalDotsPerInchX() const;
qreal physicalDotsPerInchY() const;
qreal physicalDotsPerInch() const;
qreal logicalDotsPerInchX() const;
qreal logicalDotsPerInchY() const;
qreal logicalDotsPerInch() const;
QSize availableSize() const;
QRect availableGeometry() const;
QList<QScreen *> virtualSiblings() const;
QSize virtualSize() const;
QRect virtualGeometry() const;
QSize availableVirtualSize() const;
QRect availableVirtualGeometry() const;
Qt::ScreenOrientation nativeOrientation() const;
Qt::ScreenOrientation primaryOrientation() const;
Qt::ScreenOrientation orientation() const;
int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const;
QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const;
QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const;
bool isPortrait(Qt::ScreenOrientation orientation) const;
bool isLandscape(Qt::ScreenOrientation orientation) const;
QPixmap grabWindow(WId window = 0, int x = 0, int y = 0, int width = -1, int height = -1);
qreal refreshRate() const;
qreal devicePixelRatio() const;
signals:
void geometryChanged(const QRect &geometry);
void physicalDotsPerInchChanged(qreal dpi);
void logicalDotsPerInchChanged(qreal dpi);
void primaryOrientationChanged(Qt::ScreenOrientation orientation);
void orientationChanged(Qt::ScreenOrientation orientation);
void refreshRateChanged(qreal refreshRate);
void physicalSizeChanged(const QSizeF &size);
void virtualGeometryChanged(const QRect &rect);
void availableGeometryChanged(const QRect &geometry);
public:
QString manufacturer() const;
QString model() const;
QString serialNumber() const;
QScreen *virtualSiblingAt(QPoint point);
};

View File

@@ -0,0 +1,62 @@
// qsessionmanager.sip generated by MetaSIP
//
// This file is part of the QtGui 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 (PyQt_SessionManager)
class QSessionManager : public QObject
{
%TypeHeaderCode
#include <qsessionmanager.h>
%End
QSessionManager(QGuiApplication *app /TransferThis/, QString &id, QString &key);
virtual ~QSessionManager();
public:
QString sessionId() const;
QString sessionKey() const;
bool allowsInteraction();
bool allowsErrorInteraction();
void release();
void cancel();
enum RestartHint
{
RestartIfRunning,
RestartAnyway,
RestartImmediately,
RestartNever,
};
void setRestartHint(QSessionManager::RestartHint);
QSessionManager::RestartHint restartHint() const;
void setRestartCommand(const QStringList &);
QStringList restartCommand() const;
void setDiscardCommand(const QStringList &);
QStringList discardCommand() const;
void setManagerProperty(const QString &name, const QString &value);
void setManagerProperty(const QString &name, const QStringList &value);
bool isPhase2() const;
void requestPhase2();
};
%End

View File

@@ -0,0 +1,171 @@
// qshortcut.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QShortcut : public QObject
{
%TypeHeaderCode
#include <qshortcut.h>
%End
public:
QShortcut(QKeySequence::StandardKey key, QObject *parent /TransferThis/, SIP_PYOBJECT member /TypeHint="PYQT_SLOT"/ = 0, SIP_PYOBJECT ambiguousMember /TypeHint="PYQT_SLOT"/ = 0, Qt::ShortcutContext context = Qt::WindowShortcut) [(QKeySequence::StandardKey key, QObject *parent, const char *member = 0, const char *ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut)];
%MethodCode
// Construct the shortcut without any connections.
Py_BEGIN_ALLOW_THREADS
sipCpp = new sipQShortcut(a0, a1, 0, 0, a4);
Py_END_ALLOW_THREADS
if (a2)
{
QObject *rx2;
QByteArray member2;
if ((sipError = pyqt6_qtgui_get_connection_parts(a2, sipCpp, "()", false, &rx2, member2)) == sipErrorNone)
{
Py_BEGIN_ALLOW_THREADS
QObject::connect(sipCpp, SIGNAL(activated()), rx2,
member2.constData());
Py_END_ALLOW_THREADS
}
else
{
delete sipCpp;
if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(2, a2);
}
}
if (a3)
{
QObject *rx3;
QByteArray member3;
if ((sipError = pyqt6_qtgui_get_connection_parts(a3, sipCpp, "()", false, &rx3, member3)) == sipErrorNone)
{
Py_BEGIN_ALLOW_THREADS
QObject::connect(sipCpp, SIGNAL(activatedAmbiguously()), rx3,
member3.constData());
Py_END_ALLOW_THREADS
}
else
{
delete sipCpp;
if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(3, a3);
}
}
%End
QShortcut(const QKeySequence &key, QObject *parent /TransferThis/, SIP_PYOBJECT member /TypeHint="PYQT_SLOT"/ = 0, SIP_PYOBJECT ambiguousMember /TypeHint="PYQT_SLOT"/ = 0, Qt::ShortcutContext context = Qt::WindowShortcut) [(const QKeySequence &key, QObject *parent, const char *member = 0, const char *ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut)];
%MethodCode
// Construct the shortcut without any connections.
Py_BEGIN_ALLOW_THREADS
sipCpp = new sipQShortcut(*a0, a1, 0, 0, a4);
Py_END_ALLOW_THREADS
if (a2)
{
QObject *rx2;
QByteArray member2;
if ((sipError = pyqt6_qtgui_get_connection_parts(a2, sipCpp, "()", false, &rx2, member2)) == sipErrorNone)
{
Py_BEGIN_ALLOW_THREADS
QObject::connect(sipCpp, SIGNAL(activated()), rx2,
member2.constData());
Py_END_ALLOW_THREADS
}
else
{
delete sipCpp;
if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(2, a2);
}
}
if (a3)
{
QObject *rx3;
QByteArray member3;
if ((sipError = pyqt6_qtgui_get_connection_parts(a3, sipCpp, "()", false, &rx3, member3)) == sipErrorNone)
{
Py_BEGIN_ALLOW_THREADS
QObject::connect(sipCpp, SIGNAL(activatedAmbiguously()), rx3,
member3.constData());
Py_END_ALLOW_THREADS
}
else
{
delete sipCpp;
if (sipError == sipErrorContinue)
sipError = sipBadCallableArg(3, a3);
}
}
%End
explicit QShortcut(QObject *parent /TransferThis/);
virtual ~QShortcut();
void setKey(const QKeySequence &key);
QKeySequence key() const;
void setEnabled(bool enable);
bool isEnabled() const;
void setContext(Qt::ShortcutContext context);
Qt::ShortcutContext context() const;
void setWhatsThis(const QString &text);
QString whatsThis() const;
void setAutoRepeat(bool on);
bool autoRepeat() const;
signals:
void activated();
void activatedAmbiguously();
public:
void setKeys(const QList<QKeySequence> &keys);
void setKeys(QKeySequence::StandardKey key);
QList<QKeySequence> keys() const;
protected:
virtual bool event(QEvent *e);
};
%ModuleHeaderCode
// Imports from QtCore.
typedef sipErrorState (*pyqt6_qtgui_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
extern pyqt6_qtgui_get_connection_parts_t pyqt6_qtgui_get_connection_parts;
%End
%ModuleCode
// Imports from QtCore.
pyqt6_qtgui_get_connection_parts_t pyqt6_qtgui_get_connection_parts;
%End
%PostInitialisationCode
// Imports from QtCore.
pyqt6_qtgui_get_connection_parts = (pyqt6_qtgui_get_connection_parts_t)sipImportSymbol("pyqt6_get_connection_parts");
Q_ASSERT(pyqt6_qtgui_get_connection_parts);
%End

View File

@@ -0,0 +1,207 @@
// qstandarditemmodel.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QStandardItemModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qstandarditemmodel.h>
%End
public:
explicit QStandardItemModel(QObject *parent /TransferThis/ = 0);
QStandardItemModel(int rows, int columns, QObject *parent /TransferThis/ = 0);
virtual ~QStandardItemModel();
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex parent(const QModelIndex &child) const;
QObject *parent() const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) 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 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 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 Qt::ItemFlags flags(const QModelIndex &index) const;
void clear();
virtual Qt::DropActions supportedDropActions() const;
virtual QMap<int, QVariant> itemData(const QModelIndex &index) const;
virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
QStandardItem *itemFromIndex(const QModelIndex &index) const;
QModelIndex indexFromItem(const QStandardItem *item) const;
QStandardItem *item(int row, int column = 0) const;
void setItem(int row, int column, QStandardItem *item /Transfer/);
void setItem(int arow, QStandardItem *aitem /Transfer/);
QStandardItem *invisibleRootItem() const /Transfer/;
QStandardItem *horizontalHeaderItem(int column) const;
void setHorizontalHeaderItem(int column, QStandardItem *item /Transfer/);
QStandardItem *verticalHeaderItem(int row) const;
void setVerticalHeaderItem(int row, QStandardItem *item /Transfer/);
void setHorizontalHeaderLabels(const QStringList &labels);
void setVerticalHeaderLabels(const QStringList &labels);
void setRowCount(int rows);
void setColumnCount(int columns);
void appendRow(const QList<QStandardItem *> &items /Transfer/);
void appendColumn(const QList<QStandardItem *> &items /Transfer/);
void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
QStandardItem *takeItem(int row, int column = 0) /TransferBack/;
QList<QStandardItem *> takeRow(int row) /TransferBack/;
QList<QStandardItem *> takeColumn(int column) /TransferBack/;
QStandardItem *takeHorizontalHeaderItem(int column) /TransferBack/;
QStandardItem *takeVerticalHeaderItem(int row) /TransferBack/;
const QStandardItem *itemPrototype() const;
void setItemPrototype(const QStandardItem *item /Transfer/);
QList<QStandardItem *> findItems(const QString &text, Qt::MatchFlags flags = Qt::MatchExactly, int column = 0) const;
int sortRole() const;
void setSortRole(int role);
void appendRow(QStandardItem *aitem /Transfer/);
void insertRow(int arow, QStandardItem *aitem /Transfer/);
bool insertRow(int row, const QModelIndex &parent = QModelIndex());
bool insertColumn(int column, const QModelIndex &parent = QModelIndex());
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);
void setItemRoleNames(const QHash<int, QByteArray> &roleNames);
virtual bool clearItemData(const QModelIndex &index);
virtual QHash<int, QByteArray> roleNames() const;
signals:
void itemChanged(QStandardItem *item);
};
class QStandardItem /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qstandarditemmodel.h>
%End
public:
QStandardItem();
explicit QStandardItem(const QString &text);
QStandardItem(const QIcon &icon, const QString &text);
QStandardItem(int rows, int columns = 1);
virtual ~QStandardItem();
virtual QVariant data(int role = Qt::UserRole + 1) const;
virtual void setData(const QVariant &value, int role = Qt::UserRole + 1);
QString text() const;
QIcon icon() const;
QString toolTip() const;
QString statusTip() const;
QString whatsThis() const;
QSize sizeHint() const;
QFont font() const;
Qt::Alignment textAlignment() const;
QBrush background() const;
QBrush foreground() const;
Qt::CheckState checkState() const;
QString accessibleText() const;
QString accessibleDescription() const;
Qt::ItemFlags flags() const;
void setFlags(Qt::ItemFlags flags);
bool isEnabled() const;
void setEnabled(bool enabled);
bool isEditable() const;
void setEditable(bool editable);
bool isSelectable() const;
void setSelectable(bool selectable);
bool isCheckable() const;
void setCheckable(bool checkable);
bool isDragEnabled() const;
void setDragEnabled(bool dragEnabled);
bool isDropEnabled() const;
void setDropEnabled(bool dropEnabled);
QStandardItem *parent() const;
int row() const;
int column() const;
QModelIndex index() const;
QStandardItemModel *model() const;
int rowCount() const;
void setRowCount(int rows);
int columnCount() const;
void setColumnCount(int columns);
bool hasChildren() const;
QStandardItem *child(int row, int column = 0) const;
void setChild(int row, int column, QStandardItem *item /Transfer/);
void setChild(int arow, QStandardItem *aitem /Transfer/);
void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
void insertRow(int arow, QStandardItem *aitem /Transfer/);
void insertRows(int row, int count);
void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
void insertColumns(int column, int count);
void removeRow(int row);
void removeColumn(int column);
void removeRows(int row, int count);
void removeColumns(int column, int count);
QStandardItem *takeChild(int row, int column = 0) /TransferBack/;
QList<QStandardItem *> takeRow(int row) /TransferBack/;
QList<QStandardItem *> takeColumn(int column) /TransferBack/;
void sortChildren(int column, Qt::SortOrder order = Qt::AscendingOrder);
virtual QStandardItem *clone() const /Factory/;
enum ItemType
{
Type,
UserType,
};
virtual int type() const;
virtual void read(QDataStream &in);
virtual void write(QDataStream &out) const;
virtual bool operator<(const QStandardItem &other /NoCopy/) const;
void setText(const QString &atext);
void setIcon(const QIcon &aicon);
void setToolTip(const QString &atoolTip);
void setStatusTip(const QString &astatusTip);
void setWhatsThis(const QString &awhatsThis);
void setSizeHint(const QSize &asizeHint);
void setFont(const QFont &afont);
void setTextAlignment(Qt::Alignment atextAlignment);
void setBackground(const QBrush &abrush);
void setForeground(const QBrush &abrush);
void setCheckState(Qt::CheckState acheckState);
void setAccessibleText(const QString &aaccessibleText);
void setAccessibleDescription(const QString &aaccessibleDescription);
void appendRow(const QList<QStandardItem *> &items /Transfer/);
void appendRow(QStandardItem *aitem /Transfer/);
void appendColumn(const QList<QStandardItem *> &items /Transfer/);
void insertRows(int row, const QList<QStandardItem *> &items /Transfer/);
void appendRows(const QList<QStandardItem *> &items /Transfer/);
protected:
QStandardItem(const QStandardItem &other);
void emitDataChanged();
public:
bool isAutoTristate() const;
void setAutoTristate(bool tristate);
bool isUserTristate() const;
void setUserTristate(bool tristate);
void clearData();
};
QDataStream &operator<<(QDataStream &out, const QStandardItem &item) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &in, QStandardItem &item /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,55 @@
// qstatictext.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QStaticText
{
%TypeHeaderCode
#include <qstatictext.h>
%End
public:
enum PerformanceHint
{
ModerateCaching,
AggressiveCaching,
};
QStaticText();
explicit QStaticText(const QString &text);
QStaticText(const QStaticText &other);
~QStaticText();
void setText(const QString &text);
QString text() const;
void setTextFormat(Qt::TextFormat textFormat);
Qt::TextFormat textFormat() const;
void setTextWidth(qreal textWidth);
qreal textWidth() const;
void setTextOption(const QTextOption &textOption);
QTextOption textOption() const;
QSizeF size() const;
void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
void setPerformanceHint(QStaticText::PerformanceHint performanceHint);
QStaticText::PerformanceHint performanceHint() const;
bool operator==(const QStaticText &) const;
bool operator!=(const QStaticText &) const;
void swap(QStaticText &other /Constrained/);
};

View File

@@ -0,0 +1,127 @@
// qstylehints.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QStyleHints : public QObject
{
%TypeHeaderCode
#include <qstylehints.h>
%End
public:
int mouseDoubleClickInterval() const;
int startDragDistance() const;
int startDragTime() const;
int startDragVelocity() const;
int keyboardInputInterval() const;
int keyboardAutoRepeatRate() const;
int cursorFlashTime() const;
bool showIsFullScreen() const;
int passwordMaskDelay() const;
qreal fontSmoothingGamma() const;
bool useRtlExtensions() const;
QChar passwordMaskCharacter() const;
bool setFocusOnTouchRelease() const;
int mousePressAndHoldInterval() const;
Qt::TabFocusBehavior tabFocusBehavior() const;
bool singleClickActivation() const;
signals:
void cursorFlashTimeChanged(int cursorFlashTime);
void keyboardInputIntervalChanged(int keyboardInputInterval);
void mouseDoubleClickIntervalChanged(int mouseDoubleClickInterval);
void startDragDistanceChanged(int startDragDistance);
void startDragTimeChanged(int startDragTime);
void mousePressAndHoldIntervalChanged(int mousePressAndHoldInterval);
void tabFocusBehaviorChanged(Qt::TabFocusBehavior tabFocusBehavior);
public:
bool showIsMaximized() const;
bool useHoverEffects() const;
void setUseHoverEffects(bool useHoverEffects);
signals:
void useHoverEffectsChanged(bool useHoverEffects);
public:
int wheelScrollLines() const;
signals:
void wheelScrollLinesChanged(int scrollLines);
public:
bool showShortcutsInContextMenus() const;
int mouseQuickSelectionThreshold() const;
signals:
void mouseQuickSelectionThresholdChanged(int threshold);
public:
void setShowShortcutsInContextMenus(bool showShortcutsInContextMenus);
signals:
void showShortcutsInContextMenusChanged(bool);
public:
int mouseDoubleClickDistance() const;
int touchDoubleTapDistance() const;
%If (Qt_6_5_0 -)
qreal keyboardAutoRepeatRateF() const;
%End
%If (Qt_6_5_0 -)
Qt::ColorScheme colorScheme() const;
%End
signals:
%If (Qt_6_5_0 -)
void colorSchemeChanged(Qt::ColorScheme colorScheme);
%End
public:
%If (Qt_6_8_0 -)
Qt::ContextMenuTrigger contextMenuTrigger() const;
%End
%If (Qt_6_8_0 -)
void setContextMenuTrigger(Qt::ContextMenuTrigger contextMenuTrigger);
%End
%If (Qt_6_8_0 -)
void setColorScheme(Qt::ColorScheme scheme);
%End
%If (Qt_6_8_0 -)
void unsetColorScheme();
%End
signals:
%If (Qt_6_8_0 -)
void contextMenuTriggerChanged(Qt::ContextMenuTrigger contextMenuTrigger);
%End
public:
%If (Qt_6_10_0 -)
bool menuSelectionWraps() const;
%End
%If (Qt_6_10_0 -)
const QAccessibilityHints *accessibility() const;
%End
private:
QStyleHints();
};

View File

@@ -0,0 +1,58 @@
// qsurface.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QSurface /Abstract/
{
%TypeHeaderCode
#include <qsurface.h>
%End
public:
enum SurfaceClass
{
Window,
Offscreen,
};
enum SurfaceType
{
RasterSurface,
OpenGLSurface,
RasterGLSurface,
OpenVGSurface,
VulkanSurface,
MetalSurface,
%If (Qt_6_1_0 -)
Direct3DSurface,
%End
};
virtual ~QSurface();
QSurface::SurfaceClass surfaceClass() const;
virtual QSurfaceFormat format() const = 0;
virtual QSurface::SurfaceType surfaceType() const = 0;
virtual QSize size() const = 0;
bool supportsOpenGL() const;
protected:
explicit QSurface(QSurface::SurfaceClass type);
};

View File

@@ -0,0 +1,112 @@
// qsurfaceformat.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QSurfaceFormat
{
%TypeHeaderCode
#include <qsurfaceformat.h>
%End
public:
enum FormatOption /BaseType=Flag/
{
StereoBuffers,
DebugContext,
DeprecatedFunctions,
ResetNotification,
%If (Qt_6_2_0 -)
ProtectedContent,
%End
};
typedef QFlags<QSurfaceFormat::FormatOption> FormatOptions;
enum SwapBehavior
{
DefaultSwapBehavior,
SingleBuffer,
DoubleBuffer,
TripleBuffer,
};
enum RenderableType
{
DefaultRenderableType,
OpenGL,
OpenGLES,
OpenVG,
};
enum OpenGLContextProfile
{
NoProfile,
CoreProfile,
CompatibilityProfile,
};
QSurfaceFormat();
QSurfaceFormat(QSurfaceFormat::FormatOptions options);
QSurfaceFormat(const QSurfaceFormat &other);
~QSurfaceFormat();
void setDepthBufferSize(int size);
int depthBufferSize() const;
void setStencilBufferSize(int size);
int stencilBufferSize() const;
void setRedBufferSize(int size);
int redBufferSize() const;
void setGreenBufferSize(int size);
int greenBufferSize() const;
void setBlueBufferSize(int size);
int blueBufferSize() const;
void setAlphaBufferSize(int size);
int alphaBufferSize() const;
void setSamples(int numSamples);
int samples() const;
void setSwapBehavior(QSurfaceFormat::SwapBehavior behavior);
QSurfaceFormat::SwapBehavior swapBehavior() const;
bool hasAlpha() const;
void setProfile(QSurfaceFormat::OpenGLContextProfile profile);
QSurfaceFormat::OpenGLContextProfile profile() const;
void setRenderableType(QSurfaceFormat::RenderableType type);
QSurfaceFormat::RenderableType renderableType() const;
void setMajorVersion(int majorVersion);
int majorVersion() const;
void setMinorVersion(int minorVersion);
int minorVersion() const;
void setStereo(bool enable);
bool stereo() const;
std::pair<int, int> version() const;
void setVersion(int major, int minor);
void setOptions(QSurfaceFormat::FormatOptions options);
void setOption(QSurfaceFormat::FormatOption option, bool on = true);
bool testOption(QSurfaceFormat::FormatOption option) const;
QSurfaceFormat::FormatOptions options() const;
int swapInterval() const;
void setSwapInterval(int interval);
static void setDefaultFormat(const QSurfaceFormat &format);
static QSurfaceFormat defaultFormat();
const QColorSpace &colorSpace() const;
void setColorSpace(const QColorSpace &colorSpace);
};
bool operator==(const QSurfaceFormat &, const QSurfaceFormat &);
bool operator!=(const QSurfaceFormat &, const QSurfaceFormat &);

View File

@@ -0,0 +1,89 @@
// qsyntaxhighlighter.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QSyntaxHighlighter : public QObject
{
%TypeHeaderCode
#include <qsyntaxhighlighter.h>
%End
public:
explicit QSyntaxHighlighter(QTextDocument *parent /TransferThis/);
explicit QSyntaxHighlighter(QObject *parent /TransferThis/);
virtual ~QSyntaxHighlighter();
void setDocument(QTextDocument *doc /KeepReference/);
QTextDocument *document() const;
public slots:
void rehighlight();
void rehighlightBlock(const QTextBlock &block);
protected:
virtual void highlightBlock(const QString &text) = 0;
void setFormat(int start, int count, const QTextCharFormat &format);
void setFormat(int start, int count, const QColor &color);
void setFormat(int start, int count, const QFont &font);
QTextCharFormat format(int pos) const;
int previousBlockState() const;
int currentBlockState() const;
void setCurrentBlockState(int newState);
void setCurrentBlockUserData(QTextBlockUserData *data /GetWrapper/);
%MethodCode
// Ownership of the user data is with the document not the syntax highlighter.
typedef PyObject *(*helper_func)(QObject *, const sipTypeDef *);
static helper_func helper = 0;
if (!helper)
{
helper = (helper_func)sipImportSymbol("qtgui_wrap_ancestors");
Q_ASSERT(helper);
}
QTextDocument *td = sipCpp->document();
if (td)
{
PyObject *py_td = helper(td, sipType_QTextDocument);
if (!py_td)
{
sipIsErr = 1;
}
else
{
sipTransferTo(a0Wrapper, py_td);
Py_DECREF(py_td);
}
}
#if defined(SIP_PROTECTED_IS_PUBLIC)
sipCpp->setCurrentBlockUserData(a0);
#else
sipCpp->sipProtect_setCurrentBlockUserData(a0);
#endif
%End
QTextBlockUserData *currentBlockUserData() const;
QTextBlock currentBlock() const;
};

View File

@@ -0,0 +1,158 @@
// qtextcursor.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextCursor
{
%TypeHeaderCode
#include <qtextcursor.h>
%End
public:
QTextCursor();
explicit QTextCursor(QTextDocument *document);
explicit QTextCursor(QTextFrame *frame);
explicit QTextCursor(const QTextBlock &block);
QTextCursor(const QTextCursor &cursor);
~QTextCursor();
bool isNull() const;
enum MoveMode
{
MoveAnchor,
KeepAnchor,
};
void setPosition(int pos, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
int position() const;
int anchor() const;
void insertText(const QString &text);
void insertText(const QString &text, const QTextCharFormat &format);
enum MoveOperation
{
NoMove,
Start,
Up,
StartOfLine,
StartOfBlock,
StartOfWord,
PreviousBlock,
PreviousCharacter,
PreviousWord,
Left,
WordLeft,
End,
Down,
EndOfLine,
EndOfWord,
EndOfBlock,
NextBlock,
NextCharacter,
NextWord,
Right,
WordRight,
NextCell,
PreviousCell,
NextRow,
PreviousRow,
};
bool movePosition(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor, int n = 1);
void deleteChar();
void deletePreviousChar();
enum SelectionType
{
WordUnderCursor,
LineUnderCursor,
BlockUnderCursor,
Document,
};
void select(QTextCursor::SelectionType selection);
bool hasSelection() const;
bool hasComplexSelection() const;
void removeSelectedText();
void clearSelection();
int selectionStart() const;
int selectionEnd() const;
QString selectedText() const;
QTextDocumentFragment selection() const;
void selectedTableCells(int *firstRow, int *numRows, int *firstColumn, int *numColumns) const;
QTextBlock block() const;
QTextCharFormat charFormat() const;
void setCharFormat(const QTextCharFormat &format);
void mergeCharFormat(const QTextCharFormat &modifier);
QTextBlockFormat blockFormat() const;
void setBlockFormat(const QTextBlockFormat &format);
void mergeBlockFormat(const QTextBlockFormat &modifier);
QTextCharFormat blockCharFormat() const;
void setBlockCharFormat(const QTextCharFormat &format);
void mergeBlockCharFormat(const QTextCharFormat &modifier);
bool atBlockStart() const;
bool atBlockEnd() const;
bool atStart() const;
bool atEnd() const;
void insertBlock();
void insertBlock(const QTextBlockFormat &format);
void insertBlock(const QTextBlockFormat &format, const QTextCharFormat &charFormat);
QTextList *insertList(const QTextListFormat &format);
QTextList *insertList(QTextListFormat::Style style);
QTextList *createList(const QTextListFormat &format);
QTextList *createList(QTextListFormat::Style style);
QTextList *currentList() const;
QTextTable *insertTable(int rows, int cols, const QTextTableFormat &format);
QTextTable *insertTable(int rows, int cols);
QTextTable *currentTable() const;
QTextFrame *insertFrame(const QTextFrameFormat &format);
QTextFrame *currentFrame() const;
void insertFragment(const QTextDocumentFragment &fragment);
void insertHtml(const QString &html);
void insertImage(const QTextImageFormat &format);
void insertImage(const QTextImageFormat &format, QTextFrameFormat::Position alignment);
void insertImage(const QString &name);
void insertImage(const QImage &image, const QString &name = QString());
void beginEditBlock();
void joinPreviousEditBlock();
void endEditBlock();
int blockNumber() const;
int columnNumber() const;
bool operator!=(const QTextCursor &rhs) const;
bool operator<(const QTextCursor &rhs) const;
bool operator<=(const QTextCursor &rhs) const;
bool operator==(const QTextCursor &rhs) const;
bool operator>=(const QTextCursor &rhs) const;
bool operator>(const QTextCursor &rhs) const;
bool isCopyOf(const QTextCursor &other) const;
bool visualNavigation() const;
void setVisualNavigation(bool b);
QTextDocument *document() const;
int positionInBlock() const;
void setVerticalMovementX(int x);
int verticalMovementX() const;
void setKeepPositionOnInsert(bool b);
bool keepPositionOnInsert() const;
void swap(QTextCursor &other /Constrained/);
%If (Qt_6_4_0 -)
void insertMarkdown(const QString &markdown, QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub);
%End
};

View File

@@ -0,0 +1,388 @@
// qtextdocument.sip generated by MetaSIP
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
namespace Qt
{
%TypeHeaderCode
#include <qtextdocument.h>
%End
%If (Qt_6_7_0 -)
bool mightBeRichText(QAnyStringView);
%End
%If (- Qt_6_7_0)
bool mightBeRichText(const QString &);
%End
QString convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = Qt::WhiteSpacePre);
};
class QTextDocument : public QObject
{
%TypeHeaderCode
#include <qtextdocument.h>
%End
public:
explicit QTextDocument(QObject *parent /TransferThis/ = 0);
QTextDocument(const QString &text, QObject *parent /TransferThis/ = 0);
virtual ~QTextDocument();
QTextDocument *clone(QObject *parent /TransferThis/ = 0) const /Factory/;
bool isEmpty() const;
virtual void clear();
void setUndoRedoEnabled(bool enable);
bool isUndoRedoEnabled() const;
bool isUndoAvailable() const;
bool isRedoAvailable() const;
void setDocumentLayout(QAbstractTextDocumentLayout *layout /Transfer/);
QAbstractTextDocumentLayout *documentLayout() const;
enum MetaInformation
{
DocumentTitle,
DocumentUrl,
%If (Qt_6_3_0 -)
CssMedia,
%End
%If (Qt_6_8_0 -)
FrontMatter,
%End
};
void setMetaInformation(QTextDocument::MetaInformation info, const QString &);
QString metaInformation(QTextDocument::MetaInformation info) const;
QString toHtml() const;
void setHtml(const QString &html);
QString toPlainText() const;
void setPlainText(const QString &text);
enum FindFlag /BaseType=Flag/
{
FindBackward,
FindCaseSensitively,
FindWholeWords,
};
typedef QFlags<QTextDocument::FindFlag> FindFlags;
QTextCursor find(const QRegularExpression &expr, const QTextCursor &cursor, QTextDocument::FindFlags options = QTextDocument::FindFlags()) const;
QTextCursor find(const QRegularExpression &expr, int position = 0, QTextDocument::FindFlags options = QTextDocument::FindFlags()) const;
QTextCursor find(const QString &subString, const QTextCursor &cursor, QTextDocument::FindFlags options = QTextDocument::FindFlags()) const;
QTextCursor find(const QString &subString, int position = 0, QTextDocument::FindFlags options = QTextDocument::FindFlags()) const;
QTextFrame *rootFrame() const;
QTextObject *object(int objectIndex) const;
QTextObject *objectForFormat(const QTextFormat &) const;
QTextBlock findBlock(int pos) const;
QTextBlock begin() const;
QTextBlock end() const;
void setPageSize(const QSizeF &size);
QSizeF pageSize() const;
void setDefaultFont(const QFont &font);
QFont defaultFont() const;
int pageCount() const;
bool isModified() const;
%If (PyQt_Printer)
void print(QPagedPaintDevice *printer) const;
%End
enum ResourceType /BaseType=IntEnum/
{
UnknownResource,
HtmlResource,
ImageResource,
StyleSheetResource,
MarkdownResource,
UserResource,
};
QVariant resource(int type, const QUrl &name) const;
void addResource(int type, const QUrl &name, const QVariant &resource);
QList<QTextFormat> allFormats() const;
void markContentsDirty(int from, int length);
void setUseDesignMetrics(bool b);
bool useDesignMetrics() const;
signals:
void blockCountChanged(int newBlockCount);
void contentsChange(int from, int charsRemoves, int charsAdded);
void contentsChanged();
void cursorPositionChanged(const QTextCursor &cursor);
void modificationChanged(bool m);
void redoAvailable(bool);
void undoAvailable(bool);
public slots:
void undo();
void redo();
void setModified(bool on = true);
protected:
virtual QTextObject *createObject(const QTextFormat &f) /Factory/;
virtual QVariant loadResource(int type, const QUrl &name);
public:
void drawContents(QPainter *p, const QRectF &rect = QRectF());
void setTextWidth(qreal width);
qreal textWidth() const;
qreal idealWidth() const;
void adjustSize();
QSizeF size() const;
int blockCount() const;
void setDefaultStyleSheet(const QString &sheet);
QString defaultStyleSheet() const;
void undo(QTextCursor *cursor);
void redo(QTextCursor *cursor);
int maximumBlockCount() const;
void setMaximumBlockCount(int maximum);
QTextOption defaultTextOption() const;
void setDefaultTextOption(const QTextOption &option);
int revision() const;
QTextBlock findBlockByNumber(int blockNumber) const;
QTextBlock findBlockByLineNumber(int blockNumber) const;
QTextBlock firstBlock() const;
QTextBlock lastBlock() const;
qreal indentWidth() const;
void setIndentWidth(qreal width);
signals:
void undoCommandAdded();
void documentLayoutChanged();
public:
QChar characterAt(int pos) const;
qreal documentMargin() const;
void setDocumentMargin(qreal margin);
int lineCount() const;
int characterCount() const;
int availableUndoSteps() const;
int availableRedoSteps() const;
enum Stacks
{
UndoStack,
RedoStack,
UndoAndRedoStacks,
};
void clearUndoRedoStacks(QTextDocument::Stacks stacks = QTextDocument::UndoAndRedoStacks);
Qt::CursorMoveStyle defaultCursorMoveStyle() const;
void setDefaultCursorMoveStyle(Qt::CursorMoveStyle style);
QUrl baseUrl() const;
void setBaseUrl(const QUrl &url);
signals:
void baseUrlChanged(const QUrl &url);
public:
QString toRawText() const;
enum MarkdownFeature /BaseType=Flag/
{
MarkdownNoHTML,
MarkdownDialectCommonMark,
MarkdownDialectGitHub,
};
typedef QFlags<QTextDocument::MarkdownFeature> MarkdownFeatures;
QString toMarkdown(QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub) const;
void setMarkdown(const QString &markdown, QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub);
void setSuperScriptBaseline(qreal baseline);
qreal superScriptBaseline() const;
void setSubScriptBaseline(qreal baseline);
qreal subScriptBaseline() const;
void setBaselineOffset(qreal baseline);
qreal baselineOffset() const;
%If (Qt_6_1_0 -)
SIP_PYCALLABLE resourceProvider() const /TypeHint="Callable[[QUrl], QVariant]"/;
%MethodCode
if (sipCpp->resourceProvider())
sipRes = sipGetUserObject((sipSimpleWrapper *)sipSelf);
else
sipRes = SIP_NULLPTR;
if (!sipRes)
sipRes = Py_None;
Py_INCREF(sipRes);
%End
%End
%If (Qt_6_1_0 -)
void setResourceProvider(SIP_PYCALLABLE provider /TypeHint="Callable[[QUrl], QVariant]"/);
%MethodCode
// Remove any existing callable.
Py_XDECREF(sipGetUserObject((sipSimpleWrapper *)sipSelf));
if (a0 == Py_None)
{
sipSetUserObject((sipSimpleWrapper *)sipSelf, SIP_NULLPTR);
sipCpp->setResourceProvider(SIP_NULLPTR);
}
else
{
// Save the callable so that resourceProvider() can return it.
Py_INCREF(a0);
sipSetUserObject((sipSimpleWrapper *)sipSelf, a0);
Py_BEGIN_ALLOW_THREADS
sipCpp->setResourceProvider([a0] (const QUrl &arg) {
QUrl *arg_heap = new QUrl(arg);
QVariant qv;
int is_err = 1;
SIP_BLOCK_THREADS
PyObject *arg_obj = sipConvertFromNewType(arg_heap, sipType_QUrl, NULL);
if (arg_obj)
{
PyObject *res_obj = PyObject_CallFunctionObjArgs(a0, arg_obj, NULL);
Py_DECREF(arg_obj);
if (res_obj)
{
is_err = 0;
QVariant *res = reinterpret_cast<QVariant *>(
sipConvertToType(res_obj, sipType_QVariant, NULL, 0,
NULL, &is_err));
if (!is_err)
{
qv = *res;
delete res;
}
}
}
else
{
delete arg_heap;
}
if (is_err)
{
pyqt6_qtgui_err_print();
}
SIP_UNBLOCK_THREADS
return qv;
});
Py_END_ALLOW_THREADS
}
%End
%End
%If (Qt_6_1_0 -)
static SIP_PYCALLABLE defaultResourceProvider() /TypeHint="Callable[[QUrl], QVariant]"/;
%MethodCode
if (QTextDocument::defaultResourceProvider())
sipRes = (PyObject *)sipGetTypeUserData((sipWrapperType *)sipTypeAsPyTypeObject(sipType_QTextDocument));
else
sipRes = SIP_NULLPTR;
if (!sipRes)
sipRes = Py_None;
Py_INCREF(sipRes);
%End
%End
%If (Qt_6_1_0 -)
static void setDefaultResourceProvider(SIP_PYCALLABLE provider /TypeHint="Callable[[QUrl], QVariant]"/);
%MethodCode
sipWrapperType *wt = (sipWrapperType *)sipTypeAsPyTypeObject(sipType_QTextDocument);
// Remove any existing callable.
Py_XDECREF((PyObject *)sipGetTypeUserData(wt));
if (a0 == Py_None)
{
sipSetTypeUserData(wt, SIP_NULLPTR);
QTextDocument::setDefaultResourceProvider(SIP_NULLPTR);
}
else
{
// Save the callable so that defaultResourceProvider() can return it.
Py_INCREF(a0);
sipSetTypeUserData(wt, a0);
Py_BEGIN_ALLOW_THREADS
QTextDocument::setDefaultResourceProvider([a0] (const QUrl &arg) {
QUrl *arg_heap = new QUrl(arg);
QVariant qv;
int is_err = 1;
SIP_BLOCK_THREADS
PyObject *arg_obj = sipConvertFromNewType(arg_heap, sipType_QUrl, NULL);
if (arg_obj)
{
PyObject *res_obj = PyObject_CallFunctionObjArgs(a0, arg_obj, NULL);
Py_DECREF(arg_obj);
if (res_obj)
{
is_err = 0;
QVariant *res = reinterpret_cast<QVariant *>(
sipConvertToType(res_obj, sipType_QVariant, NULL, 0,
NULL, &is_err));
if (!is_err)
{
qv = *res;
delete res;
}
}
}
else
{
delete arg_heap;
}
if (is_err)
{
pyqt6_qtgui_err_print();
}
SIP_UNBLOCK_THREADS
return qv;
});
Py_END_ALLOW_THREADS
}
%End
%End
%If (Qt_6_4_0 -)
void setLayoutEnabled(bool b);
%End
%If (Qt_6_4_0 -)
bool isLayoutEnabled() const;
%End
};

View File

@@ -0,0 +1,49 @@
// qtextdocumentfragment.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextDocumentFragment
{
%TypeHeaderCode
#include <qtextdocumentfragment.h>
%End
public:
QTextDocumentFragment();
explicit QTextDocumentFragment(const QTextDocument *document);
explicit QTextDocumentFragment(const QTextCursor &range);
QTextDocumentFragment(const QTextDocumentFragment &rhs);
~QTextDocumentFragment();
bool isEmpty() const;
QString toPlainText() const;
QString toHtml() const;
static QTextDocumentFragment fromPlainText(const QString &plainText);
static QTextDocumentFragment fromHtml(const QString &html, const QTextDocument *resourceProvider = 0);
%If (Qt_6_4_0 -)
QString toRawText() const;
%End
%If (Qt_6_4_0 -)
QString toMarkdown(QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub) const;
%End
%If (Qt_6_4_0 -)
static QTextDocumentFragment fromMarkdown(const QString &markdown, QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub);
%End
};

View File

@@ -0,0 +1,46 @@
// qtextdocumentwriter.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextDocumentWriter
{
%TypeHeaderCode
#include <qtextdocumentwriter.h>
%End
public:
QTextDocumentWriter();
QTextDocumentWriter(QIODevice *device, const QByteArray &format);
QTextDocumentWriter(const QString &fileName, const QByteArray &format = QByteArray());
~QTextDocumentWriter();
void setFormat(const QByteArray &format);
QByteArray format() const;
void setDevice(QIODevice *device);
QIODevice *device() const;
void setFileName(const QString &fileName);
QString fileName() const;
bool write(const QTextDocument *document);
bool write(const QTextDocumentFragment &fragment);
static QList<QByteArray> supportedDocumentFormats();
private:
QTextDocumentWriter(const QTextDocumentWriter &);
};

View File

@@ -0,0 +1,672 @@
// qtextformat.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextLength
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
enum Type
{
VariableLength,
FixedLength,
PercentageLength,
};
QTextLength();
QTextLength::Type type() const;
QTextLength(QTextLength::Type atype, qreal avalue);
qreal value(qreal maximumLength) const;
qreal rawValue() const;
bool operator==(const QTextLength &other) const;
bool operator!=(const QTextLength &other) const;
QTextLength(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QTextLength>())
sipCpp = new QTextLength(a0->value<QTextLength>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
};
%If (Qt_6_3_0 -)
QDataStream &operator<<(QDataStream &, const QTextTableCellFormat &) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator<<(QDataStream &, const QTextFrameFormat &) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator<<(QDataStream &, const QTextListFormat &) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator<<(QDataStream &, const QTextBlockFormat &) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator<<(QDataStream &, const QTextCharFormat &) /ReleaseGIL/;
%End
QDataStream &operator<<(QDataStream &, const QTextLength &) /ReleaseGIL/;
%If (Qt_6_3_0 -)
QDataStream &operator>>(QDataStream &, QTextTableCellFormat & /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator>>(QDataStream &, QTextFrameFormat & /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator>>(QDataStream &, QTextListFormat & /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator>>(QDataStream &, QTextBlockFormat & /Constrained/) /ReleaseGIL/;
%End
%If (Qt_6_3_0 -)
QDataStream &operator>>(QDataStream &, QTextCharFormat & /Constrained/) /ReleaseGIL/;
%End
QDataStream &operator>>(QDataStream &, QTextLength & /Constrained/) /ReleaseGIL/;
class QTextFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
enum FormatType /BaseType=IntEnum/
{
InvalidFormat,
BlockFormat,
CharFormat,
ListFormat,
FrameFormat,
UserFormat,
};
enum ObjectTypes /BaseType=IntEnum/
{
NoObject,
ImageObject,
TableObject,
TableCellObject,
UserObject,
};
enum PageBreakFlag /BaseType=Flag/
{
PageBreak_Auto,
PageBreak_AlwaysBefore,
PageBreak_AlwaysAfter,
};
typedef QFlags<QTextFormat::PageBreakFlag> PageBreakFlags;
enum Property /BaseType=IntEnum/
{
ObjectIndex,
CssFloat,
LayoutDirection,
OutlinePen,
BackgroundBrush,
ForegroundBrush,
BlockAlignment,
BlockTopMargin,
BlockBottomMargin,
BlockLeftMargin,
BlockRightMargin,
TextIndent,
BlockIndent,
BlockNonBreakableLines,
BlockTrailingHorizontalRulerWidth,
FontPointSize,
FontSizeAdjustment,
FontSizeIncrement,
FontWeight,
FontItalic,
FontUnderline,
FontOverline,
FontStrikeOut,
FontFixedPitch,
FontPixelSize,
TextUnderlineColor,
TextVerticalAlignment,
TextOutline,
IsAnchor,
AnchorHref,
AnchorName,
ObjectType,
ListStyle,
ListIndent,
FrameBorder,
FrameMargin,
FramePadding,
FrameWidth,
FrameHeight,
TableColumns,
TableColumnWidthConstraints,
TableCellSpacing,
TableCellPadding,
TableCellRowSpan,
TableCellColumnSpan,
ImageName,
ImageWidth,
ImageHeight,
TextUnderlineStyle,
TableHeaderRowCount,
FullWidthSelection,
PageBreakPolicy,
TextToolTip,
FrameTopMargin,
FrameBottomMargin,
FrameLeftMargin,
FrameRightMargin,
FrameBorderBrush,
FrameBorderStyle,
BackgroundImageUrl,
TabPositions,
FirstFontProperty,
FontCapitalization,
FontLetterSpacing,
FontWordSpacing,
LastFontProperty,
TableCellTopPadding,
TableCellBottomPadding,
TableCellLeftPadding,
TableCellRightPadding,
FontStyleHint,
FontStyleStrategy,
FontKerning,
LineHeight,
LineHeightType,
FontHintingPreference,
ListNumberPrefix,
ListNumberSuffix,
FontStretch,
FontLetterSpacingType,
HeadingLevel,
ImageQuality,
FontFamilies,
FontStyleName,
BlockQuoteLevel,
BlockCodeLanguage,
BlockCodeFence,
BlockMarker,
TableBorderCollapse,
TableCellTopBorder,
TableCellBottomBorder,
TableCellLeftBorder,
TableCellRightBorder,
TableCellTopBorderStyle,
TableCellBottomBorderStyle,
TableCellLeftBorderStyle,
TableCellRightBorderStyle,
TableCellTopBorderBrush,
TableCellBottomBorderBrush,
TableCellLeftBorderBrush,
TableCellRightBorderBrush,
ImageTitle,
ImageAltText,
TextSuperScriptBaseline,
TextSubScriptBaseline,
TextBaselineOffset,
OldFontLetterSpacingType,
OldFontStretch,
OldTextUnderlineColor,
%If (Qt_6_4_0 -)
OldFontFamily,
%End
%If (Qt_6_6_0 -)
ListStart,
%End
%If (Qt_6_8_0 -)
ImageMaxWidth,
%End
UserProperty,
};
QTextFormat();
explicit QTextFormat(int type);
QTextFormat(const QTextFormat &rhs);
QTextFormat(const QVariant &variant /GetWrapper/) /NoDerived/;
%MethodCode
if (a0->canConvert<QTextFormat>())
sipCpp = new QTextFormat(a0->value<QTextFormat>());
else
sipError = sipBadCallableArg(0, a0Wrapper);
%End
~QTextFormat();
void merge(const QTextFormat &other);
bool isValid() const;
int type() const;
int objectIndex() const;
void setObjectIndex(int object);
QVariant property(int propertyId) const;
void setProperty(int propertyId, const QList<QTextLength> &lengths);
void setProperty(int propertyId, const QVariant &value);
void clearProperty(int propertyId);
bool hasProperty(int propertyId) const;
bool boolProperty(int propertyId) const;
int intProperty(int propertyId) const;
qreal doubleProperty(int propertyId) const;
QString stringProperty(int propertyId) const;
QColor colorProperty(int propertyId) const;
QPen penProperty(int propertyId) const;
QBrush brushProperty(int propertyId) const;
QTextLength lengthProperty(int propertyId) const;
QList<QTextLength> lengthVectorProperty(int propertyId) const;
QMap<int, QVariant> properties() const;
int objectType() const;
bool isCharFormat() const;
bool isBlockFormat() const;
bool isListFormat() const;
bool isFrameFormat() const;
bool isImageFormat() const;
bool isTableFormat() const;
QTextBlockFormat toBlockFormat() const;
QTextCharFormat toCharFormat() const;
QTextListFormat toListFormat() const;
QTextTableFormat toTableFormat() const;
QTextFrameFormat toFrameFormat() const;
QTextImageFormat toImageFormat() const;
bool operator==(const QTextFormat &rhs) const;
bool operator!=(const QTextFormat &rhs) const;
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;
void setBackground(const QBrush &brush);
QBrush background() const;
void clearBackground();
void setForeground(const QBrush &brush);
QBrush foreground() const;
void clearForeground();
void setObjectType(int atype);
int propertyCount() const;
bool isTableCellFormat() const;
QTextTableCellFormat toTableCellFormat() const;
void swap(QTextFormat &other /Constrained/);
bool isEmpty() const;
};
QDataStream &operator<<(QDataStream &, const QTextFormat &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QTextFormat & /Constrained/) /ReleaseGIL/;
class QTextCharFormat : public QTextFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
enum VerticalAlignment
{
AlignNormal,
AlignSuperScript,
AlignSubScript,
AlignMiddle,
AlignTop,
AlignBottom,
AlignBaseline,
};
QTextCharFormat();
bool isValid() const;
void setFont(const QFont &font, QTextCharFormat::FontPropertiesInheritanceBehavior behavior = QTextCharFormat::FontPropertiesAll);
QFont font() const;
void setFontFamily(const QString &family);
QString fontFamily() const;
void setFontPointSize(qreal size);
qreal fontPointSize() const;
void setFontWeight(int weight);
int fontWeight() const;
void setFontItalic(bool italic);
bool fontItalic() const;
void setFontUnderline(bool underline);
bool fontUnderline() const;
void setFontOverline(bool overline);
bool fontOverline() const;
void setFontStrikeOut(bool strikeOut);
bool fontStrikeOut() const;
void setUnderlineColor(const QColor &color);
QColor underlineColor() const;
void setFontFixedPitch(bool fixedPitch);
bool fontFixedPitch() const;
void setVerticalAlignment(QTextCharFormat::VerticalAlignment alignment);
QTextCharFormat::VerticalAlignment verticalAlignment() const;
void setAnchor(bool anchor);
bool isAnchor() const;
void setAnchorHref(const QString &value);
QString anchorHref() const;
int tableCellRowSpan() const;
int tableCellColumnSpan() const;
void setTableCellRowSpan(int atableCellRowSpan);
void setTableCellColumnSpan(int atableCellColumnSpan);
void setTextOutline(const QPen &pen);
QPen textOutline() const;
enum UnderlineStyle
{
NoUnderline,
SingleUnderline,
DashUnderline,
DotLine,
DashDotLine,
DashDotDotLine,
WaveUnderline,
SpellCheckUnderline,
};
void setUnderlineStyle(QTextCharFormat::UnderlineStyle style);
QTextCharFormat::UnderlineStyle underlineStyle() const;
void setToolTip(const QString &tip);
QString toolTip() const;
void setAnchorNames(const QStringList &names);
QStringList anchorNames() const;
void setFontCapitalization(QFont::Capitalization capitalization);
QFont::Capitalization fontCapitalization() const;
void setFontLetterSpacing(qreal spacing);
qreal fontLetterSpacing() const;
void setFontWordSpacing(qreal spacing);
qreal fontWordSpacing() const;
void setFontStyleHint(QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault);
void setFontStyleStrategy(QFont::StyleStrategy strategy);
QFont::StyleHint fontStyleHint() const;
QFont::StyleStrategy fontStyleStrategy() const;
void setFontKerning(bool enable);
bool fontKerning() const;
void setFontHintingPreference(QFont::HintingPreference hintingPreference);
QFont::HintingPreference fontHintingPreference() const;
int fontStretch() const;
void setFontStretch(int factor);
void setFontLetterSpacingType(QFont::SpacingType letterSpacingType);
QFont::SpacingType fontLetterSpacingType() const;
enum FontPropertiesInheritanceBehavior
{
FontPropertiesSpecifiedOnly,
FontPropertiesAll,
};
void setFontFamilies(const QStringList &families);
QVariant fontFamilies() const;
void setFontStyleName(const QString &styleName);
QVariant fontStyleName() const;
void setSuperScriptBaseline(qreal baseline);
qreal superScriptBaseline() const;
void setSubScriptBaseline(qreal baseline);
qreal subScriptBaseline() const;
void setBaselineOffset(qreal baseline);
qreal baselineOffset() const;
};
class QTextBlockFormat : public QTextFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextBlockFormat();
bool isValid() const;
Qt::Alignment alignment() const;
void setTopMargin(qreal margin);
qreal topMargin() const;
void setBottomMargin(qreal margin);
qreal bottomMargin() const;
void setLeftMargin(qreal margin);
qreal leftMargin() const;
void setRightMargin(qreal margin);
qreal rightMargin() const;
void setTextIndent(qreal margin);
qreal textIndent() const;
int indent() const;
void setNonBreakableLines(bool b);
bool nonBreakableLines() const;
void setAlignment(Qt::Alignment aalignment);
void setIndent(int aindent);
void setPageBreakPolicy(QTextFormat::PageBreakFlags flags);
QTextFormat::PageBreakFlags pageBreakPolicy() const;
void setTabPositions(const QList<QTextOption::Tab> &tabs);
QList<QTextOption::Tab> tabPositions() const;
enum LineHeightTypes
{
SingleHeight,
ProportionalHeight,
FixedHeight,
MinimumHeight,
LineDistanceHeight,
};
void setLineHeight(qreal height, int heightType);
qreal lineHeight() const;
qreal lineHeight(qreal scriptLineHeight, qreal scaling = 1.) const;
int lineHeightType() const;
void setHeadingLevel(int alevel);
int headingLevel() const;
enum class MarkerType
{
NoMarker,
Unchecked,
Checked,
};
void setMarker(QTextBlockFormat::MarkerType marker);
QTextBlockFormat::MarkerType marker() const;
};
class QTextListFormat : public QTextFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextListFormat();
bool isValid() const;
enum Style
{
ListDisc,
ListCircle,
ListSquare,
ListDecimal,
ListLowerAlpha,
ListUpperAlpha,
ListLowerRoman,
ListUpperRoman,
};
QTextListFormat::Style style() const;
int indent() const;
void setStyle(QTextListFormat::Style astyle);
void setIndent(int aindent);
QString numberPrefix() const;
QString numberSuffix() const;
void setNumberPrefix(const QString &np);
void setNumberSuffix(const QString &ns);
%If (Qt_6_6_0 -)
void setStart(int indent);
%End
%If (Qt_6_6_0 -)
int start() const;
%End
};
class QTextImageFormat : public QTextCharFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextImageFormat();
bool isValid() const;
QString name() const;
qreal width() const;
qreal height() const;
int quality() const;
void setName(const QString &aname);
void setWidth(qreal awidth);
void setHeight(qreal aheight);
void setQuality(int quality = 100);
%If (Qt_6_8_0 -)
void setMaximumWidth(QTextLength maxWidth);
%End
%If (Qt_6_8_0 -)
QTextLength maximumWidth() const;
%End
};
class QTextFrameFormat : public QTextFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextFrameFormat();
bool isValid() const;
enum Position
{
InFlow,
FloatLeft,
FloatRight,
};
void setPosition(QTextFrameFormat::Position f);
QTextFrameFormat::Position position() const;
qreal border() const;
qreal margin() const;
qreal padding() const;
void setWidth(const QTextLength &length);
QTextLength width() const;
QTextLength height() const;
void setBorder(qreal aborder);
void setMargin(qreal amargin);
void setPadding(qreal apadding);
void setWidth(qreal awidth);
void setHeight(qreal aheight);
void setHeight(const QTextLength &aheight);
void setPageBreakPolicy(QTextFormat::PageBreakFlags flags);
QTextFormat::PageBreakFlags pageBreakPolicy() const;
enum BorderStyle
{
BorderStyle_None,
BorderStyle_Dotted,
BorderStyle_Dashed,
BorderStyle_Solid,
BorderStyle_Double,
BorderStyle_DotDash,
BorderStyle_DotDotDash,
BorderStyle_Groove,
BorderStyle_Ridge,
BorderStyle_Inset,
BorderStyle_Outset,
};
void setBorderBrush(const QBrush &brush);
QBrush borderBrush() const;
void setBorderStyle(QTextFrameFormat::BorderStyle style);
QTextFrameFormat::BorderStyle borderStyle() const;
qreal topMargin() const;
qreal bottomMargin() const;
qreal leftMargin() const;
qreal rightMargin() const;
void setTopMargin(qreal amargin);
void setBottomMargin(qreal amargin);
void setLeftMargin(qreal amargin);
void setRightMargin(qreal amargin);
};
class QTextTableFormat : public QTextFrameFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextTableFormat();
bool isValid() const;
int columns() const;
void setColumnWidthConstraints(const QList<QTextLength> &constraints);
QList<QTextLength> columnWidthConstraints() const;
void clearColumnWidthConstraints();
qreal cellSpacing() const;
void setCellSpacing(qreal spacing);
qreal cellPadding() const;
Qt::Alignment alignment() const;
void setColumns(int acolumns);
void setCellPadding(qreal apadding);
void setAlignment(Qt::Alignment aalignment);
void setHeaderRowCount(int count);
int headerRowCount() const;
void setBorderCollapse(bool borderCollapse);
bool borderCollapse() const;
};
class QTextTableCellFormat : public QTextCharFormat
{
%TypeHeaderCode
#include <qtextformat.h>
%End
public:
QTextTableCellFormat();
bool isValid() const;
void setTopPadding(qreal padding);
qreal topPadding() const;
void setBottomPadding(qreal padding);
qreal bottomPadding() const;
void setLeftPadding(qreal padding);
qreal leftPadding() const;
void setRightPadding(qreal padding);
qreal rightPadding() const;
void setPadding(qreal padding);
void setTopBorder(qreal width);
qreal topBorder() const;
void setBottomBorder(qreal width);
qreal bottomBorder() const;
void setLeftBorder(qreal width);
qreal leftBorder() const;
void setRightBorder(qreal width);
qreal rightBorder() const;
void setBorder(qreal width);
void setTopBorderStyle(QTextFrameFormat::BorderStyle style);
QTextFrameFormat::BorderStyle topBorderStyle() const;
void setBottomBorderStyle(QTextFrameFormat::BorderStyle style);
QTextFrameFormat::BorderStyle bottomBorderStyle() const;
void setLeftBorderStyle(QTextFrameFormat::BorderStyle style);
QTextFrameFormat::BorderStyle leftBorderStyle() const;
void setRightBorderStyle(QTextFrameFormat::BorderStyle style);
QTextFrameFormat::BorderStyle rightBorderStyle() const;
void setBorderStyle(QTextFrameFormat::BorderStyle style);
void setTopBorderBrush(const QBrush &brush);
QBrush topBorderBrush() const;
void setBottomBorderBrush(const QBrush &brush);
QBrush bottomBorderBrush() const;
void setLeftBorderBrush(const QBrush &brush);
QBrush leftBorderBrush() const;
void setRightBorderBrush(const QBrush &brush);
QBrush rightBorderBrush() const;
void setBorderBrush(const QBrush &brush);
};

View File

@@ -0,0 +1,195 @@
// qtextlayout.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextInlineObject
{
%TypeHeaderCode
#include <qtextlayout.h>
%End
public:
bool isValid() const;
QRectF rect() const;
qreal width() const;
qreal ascent() const;
qreal descent() const;
qreal height() const;
Qt::LayoutDirection textDirection() const;
void setWidth(qreal w);
void setAscent(qreal a);
void setDescent(qreal d);
int textPosition() const;
int formatIndex() const;
QTextFormat format() const;
};
class QTextLayout
{
%TypeHeaderCode
#include <qtextlayout.h>
%End
public:
QTextLayout();
QTextLayout(const QString &text);
QTextLayout(const QString &text, const QFont &font, const QPaintDevice *paintdevice = 0);
QTextLayout(const QTextBlock &b);
~QTextLayout();
void setFont(const QFont &f);
QFont font() const;
void setText(const QString &string);
QString text() const;
void setTextOption(const QTextOption &option);
const QTextOption &textOption() const;
void setPreeditArea(int position, const QString &text);
int preeditAreaPosition() const;
QString preeditAreaText() const;
struct FormatRange
{
%TypeHeaderCode
#include <qtextlayout.h>
%End
int start;
int length;
QTextCharFormat format;
};
void setCacheEnabled(bool enable);
bool cacheEnabled() const;
void beginLayout();
void endLayout();
QTextLine createLine();
int lineCount() const;
QTextLine lineAt(int i) const;
QTextLine lineForTextPosition(int pos) const;
enum CursorMode
{
SkipCharacters,
SkipWords,
};
bool isValidCursorPosition(int pos) const;
int nextCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const;
int previousCursorPosition(int oldPos, QTextLayout::CursorMode mode = QTextLayout::SkipCharacters) const;
void draw(QPainter *p, const QPointF &pos, const QList<QTextLayout::FormatRange> &selections = QList<QTextLayout::FormatRange>(), const QRectF &clip = QRectF()) const;
void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition) const;
void drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width) const;
QPointF position() const;
void setPosition(const QPointF &p);
QRectF boundingRect() const;
qreal minimumWidth() const;
qreal maximumWidth() const;
void clearLayout();
void setCursorMoveStyle(Qt::CursorMoveStyle style);
Qt::CursorMoveStyle cursorMoveStyle() const;
int leftCursorPosition(int oldPos) const;
int rightCursorPosition(int oldPos) const;
%If (PyQt_RawFont)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
%End
%If (Qt_6_5_0 -)
QList<QGlyphRun> glyphRuns(int from, int length, QTextLayout::GlyphRunRetrievalFlags flags) const;
%End
void setFormats(const QList<QTextLayout::FormatRange> &overrides);
QList<QTextLayout::FormatRange> formats() const;
void clearFormats();
private:
QTextLayout(const QTextLayout &);
public:
%If (Qt_6_5_0 -)
enum GlyphRunRetrievalFlag
{
RetrieveGlyphIndexes,
RetrieveGlyphPositions,
RetrieveStringIndexes,
RetrieveString,
RetrieveAll,
};
%End
%If (Qt_6_5_0 -)
typedef QFlags<QTextLayout::GlyphRunRetrievalFlag> GlyphRunRetrievalFlags;
%End
};
class QTextLine
{
%TypeHeaderCode
#include <qtextlayout.h>
%End
public:
QTextLine();
bool isValid() const;
QRectF rect() const;
qreal x() const;
qreal y() const;
qreal width() const;
qreal ascent() const;
qreal descent() const;
qreal height() const;
qreal naturalTextWidth() const;
QRectF naturalTextRect() const;
enum Edge
{
Leading,
Trailing,
};
enum CursorPosition
{
CursorBetweenCharacters,
CursorOnCharacter,
};
qreal cursorToX(int *cursorPos /In,Out/, QTextLine::Edge edge = QTextLine::Leading) const;
int xToCursor(qreal x, QTextLine::CursorPosition edge = QTextLine::CursorBetweenCharacters) const;
void setLineWidth(qreal width);
void setNumColumns(int columns);
void setNumColumns(int columns, qreal alignmentWidth);
void setPosition(const QPointF &pos);
int textStart() const;
int textLength() const;
int lineNumber() const;
void draw(QPainter *painter, const QPointF &position) const;
QPointF position() const;
qreal leading() const;
void setLeadingIncluded(bool included);
bool leadingIncluded() const;
qreal horizontalAdvance() const;
%If (PyQt_RawFont)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
%End
%If (Qt_6_5_0 -)
QList<QGlyphRun> glyphRuns(int from, int length, QTextLayout::GlyphRunRetrievalFlags flags) const;
%End
};
bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs);
bool operator!=(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs);

View File

@@ -0,0 +1,41 @@
// qtextlist.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextList : public QTextBlockGroup
{
%TypeHeaderCode
#include <qtextlist.h>
%End
public:
explicit QTextList(QTextDocument *doc);
virtual ~QTextList();
int count() const /__len__/;
QTextBlock item(int i) const;
int itemNumber(const QTextBlock &) const;
QString itemText(const QTextBlock &) const;
void removeItem(int i);
void remove(const QTextBlock &);
void add(const QTextBlock &block);
QTextListFormat format() const;
void setFormat(const QTextListFormat &aformat);
};

View File

@@ -0,0 +1,292 @@
// qtextobject.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextObject : public QObject
{
%TypeHeaderCode
#include <qtextobject.h>
%End
protected:
explicit QTextObject(QTextDocument *doc);
virtual ~QTextObject();
void setFormat(const QTextFormat &format);
public:
QTextFormat format() const;
int formatIndex() const;
QTextDocument *document() const;
int objectIndex() const;
};
class QTextBlockGroup : public QTextObject
{
%TypeHeaderCode
#include <qtextobject.h>
%End
protected:
explicit QTextBlockGroup(QTextDocument *doc);
virtual ~QTextBlockGroup();
virtual void blockInserted(const QTextBlock &block);
virtual void blockRemoved(const QTextBlock &block);
virtual void blockFormatChanged(const QTextBlock &block);
QList<QTextBlock> blockList() const;
};
class QTextFrame : public QTextObject
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
explicit QTextFrame(QTextDocument *doc);
virtual ~QTextFrame();
QTextFrameFormat frameFormat() const;
QTextCursor firstCursorPosition() const;
QTextCursor lastCursorPosition() const;
int firstPosition() const;
int lastPosition() const;
QList<QTextFrame *> childFrames() const;
QTextFrame *parentFrame() const;
class iterator
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
iterator();
QTextFrame *parentFrame() const;
QTextFrame *currentFrame() const;
QTextBlock currentBlock() const;
bool atEnd() const;
bool operator==(const QTextFrame::iterator &o) const;
bool operator!=(const QTextFrame::iterator &o) const;
QTextFrame::iterator &operator+=(int);
%MethodCode
if (a0 > 0)
while (a0--)
(*sipCpp)++;
else if (a0 < 0)
while (a0++)
(*sipCpp)--;
%End
QTextFrame::iterator &operator-=(int);
%MethodCode
if (a0 > 0)
while (a0--)
(*sipCpp)--;
else if (a0 < 0)
while (a0++)
(*sipCpp)++;
%End
};
typedef QTextFrame::iterator Iterator;
QTextFrame::iterator begin() const;
QTextFrame::iterator end() const;
void setFrameFormat(const QTextFrameFormat &aformat);
};
class QTextBlock /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
QTextBlock();
QTextBlock(const QTextBlock &o);
bool isValid() const;
bool operator==(const QTextBlock &o) const;
bool operator!=(const QTextBlock &o) const;
bool operator<(const QTextBlock &o) const;
int position() const;
int length() const;
bool contains(int position) const;
QTextLayout *layout() const;
QTextBlockFormat blockFormat() const;
int blockFormatIndex() const;
QTextCharFormat charFormat() const;
int charFormatIndex() const;
QString text() const;
const QTextDocument *document() const;
QTextList *textList() const;
class iterator
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
iterator();
QTextFragment fragment() const;
bool atEnd() const;
bool operator==(const QTextBlock::iterator &o) const;
bool operator!=(const QTextBlock::iterator &o) const;
QTextBlock::iterator &operator+=(int);
%MethodCode
if (a0 > 0)
while (a0--)
(*sipCpp)++;
else if (a0 < 0)
while (a0++)
(*sipCpp)--;
%End
QTextBlock::iterator &operator-=(int);
%MethodCode
if (a0 > 0)
while (a0--)
(*sipCpp)--;
else if (a0 < 0)
while (a0++)
(*sipCpp)++;
%End
};
typedef QTextBlock::iterator Iterator;
QTextBlock::iterator begin() const;
QTextBlock::iterator end() const;
QTextBlock next() const;
QTextBlock previous() const;
QTextBlockUserData *userData() const;
void setUserData(QTextBlockUserData *data /GetWrapper/);
%MethodCode
// Ownership of the user data is with the document not the text block.
const QTextDocument *td = sipCpp->document();
if (td)
{
PyObject *py_td = qtgui_wrap_ancestors(const_cast<QTextDocument *>(td),
sipType_QTextDocument);
if (!py_td)
{
sipIsErr = 1;
}
else
{
sipTransferTo(a0Wrapper, py_td);
Py_DECREF(py_td);
}
}
sipCpp->setUserData(a0);
%End
int userState() const;
void setUserState(int state);
void clearLayout();
int revision() const;
void setRevision(int rev);
bool isVisible() const;
void setVisible(bool visible);
int blockNumber() const;
int firstLineNumber() const;
void setLineCount(int count);
int lineCount() const;
Qt::LayoutDirection textDirection() const;
QList<QTextLayout::FormatRange> textFormats() const;
};
class QTextFragment
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
QTextFragment();
QTextFragment(const QTextFragment &o);
bool isValid() const;
bool operator==(const QTextFragment &o) const;
bool operator!=(const QTextFragment &o) const;
bool operator<(const QTextFragment &o) const;
int position() const;
int length() const;
bool contains(int position) const;
QTextCharFormat charFormat() const;
int charFormatIndex() const;
QString text() const;
%If (PyQt_RawFont)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
%End
};
class QTextBlockUserData /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qtextobject.h>
%End
public:
virtual ~QTextBlockUserData();
};
%ModuleHeaderCode
PyObject *qtgui_wrap_ancestors(QObject *obj, const sipTypeDef *td);
%End
%ModuleCode
// Wrap a QObject and ensure that it's ancestors are all wrapped with the
// correct ownerships.
static PyObject *qtgui_wrap_ancestors_worker(QObject *obj)
{
if (!obj)
{
Py_INCREF(Py_None);
return Py_None;
}
PyObject *py_parent = qtgui_wrap_ancestors_worker(obj->parent());
if (!py_parent)
return 0;
PyObject *py_obj = sipConvertFromType(obj, sipType_QObject,
(py_parent != Py_None ? py_parent : 0));
Py_DECREF(py_parent);
return py_obj;
}
PyObject *qtgui_wrap_ancestors(QObject *obj, const sipTypeDef *td)
{
PyObject *py_parent = qtgui_wrap_ancestors_worker(obj->parent());
if (!py_parent)
return 0;
PyObject *py_obj = sipConvertFromType(obj, td,
(py_parent != Py_None ? py_parent : 0));
Py_DECREF(py_parent);
return py_obj;
}
%End

View File

@@ -0,0 +1,102 @@
// qtextoption.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextOption
{
%TypeHeaderCode
#include <qtextoption.h>
%End
public:
QTextOption();
QTextOption(Qt::Alignment alignment);
~QTextOption();
QTextOption(const QTextOption &o);
Qt::Alignment alignment() const;
void setTextDirection(Qt::LayoutDirection aDirection);
Qt::LayoutDirection textDirection() const;
enum WrapMode
{
NoWrap,
WordWrap,
ManualWrap,
WrapAnywhere,
WrapAtWordBoundaryOrAnywhere,
};
void setWrapMode(QTextOption::WrapMode wrap);
QTextOption::WrapMode wrapMode() const;
enum Flag /BaseType=Flag/
{
IncludeTrailingSpaces,
ShowTabsAndSpaces,
ShowLineAndParagraphSeparators,
AddSpaceForLineAndParagraphSeparators,
SuppressColors,
ShowDocumentTerminator,
%If (Qt_6_9_0 -)
ShowDefaultIgnorables,
%End
%If (Qt_6_9_0 -)
DisableEmojiParsing,
%End
};
typedef QFlags<QTextOption::Flag> Flags;
QTextOption::Flags flags() const;
void setTabArray(const QList<qreal> &tabStops);
QList<qreal> tabArray() const;
void setUseDesignMetrics(bool b);
bool useDesignMetrics() const;
void setAlignment(Qt::Alignment aalignment);
void setFlags(QTextOption::Flags flags);
enum TabType
{
LeftTab,
RightTab,
CenterTab,
DelimiterTab,
};
struct Tab
{
%TypeHeaderCode
#include <qtextoption.h>
%End
Tab();
Tab(qreal pos, QTextOption::TabType tabType, QChar delim = QChar());
bool operator==(const QTextOption::Tab &other) const;
bool operator!=(const QTextOption::Tab &other) const;
qreal position;
QTextOption::TabType type;
QChar delimiter;
};
void setTabs(const QList<QTextOption::Tab> &tabStops);
QList<QTextOption::Tab> tabs() const;
void setTabStopDistance(qreal tabStopDistance);
qreal tabStopDistance() const;
};

View File

@@ -0,0 +1,75 @@
// qtexttable.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QTextTableCell
{
%TypeHeaderCode
#include <qtexttable.h>
%End
public:
QTextTableCell();
~QTextTableCell();
QTextTableCell(const QTextTableCell &o);
QTextCharFormat format() const;
void setFormat(const QTextCharFormat &format);
int row() const;
int column() const;
int rowSpan() const;
int columnSpan() const;
bool isValid() const;
QTextCursor firstCursorPosition() const;
QTextCursor lastCursorPosition() const;
int tableCellFormatIndex() const;
bool operator==(const QTextTableCell &other) const;
bool operator!=(const QTextTableCell &other) const;
};
class QTextTable : public QTextFrame
{
%TypeHeaderCode
#include <qtexttable.h>
%End
public:
explicit QTextTable(QTextDocument *doc);
virtual ~QTextTable();
void resize(int rows, int cols);
void insertRows(int pos, int num);
void insertColumns(int pos, int num);
void removeRows(int pos, int num);
void removeColumns(int pos, int num);
void mergeCells(int row, int col, int numRows, int numCols);
void mergeCells(const QTextCursor &cursor);
void splitCell(int row, int col, int numRows, int numCols);
int rows() const;
int columns() const;
QTextTableCell cellAt(int row, int col) const;
QTextTableCell cellAt(int position) const;
QTextTableCell cellAt(const QTextCursor &c) const;
QTextCursor rowStart(const QTextCursor &c) const;
QTextCursor rowEnd(const QTextCursor &c) const;
QTextTableFormat format() const;
void setFormat(const QTextTableFormat &aformat);
void appendRows(int count);
void appendColumns(int count);
};

View File

@@ -0,0 +1,132 @@
// qtransform.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qtransform.h>
%End
class QTransform
{
%TypeHeaderCode
#include <qtransform.h>
%End
%PickleCode
sipRes = Py_BuildValue("ddddddddd", sipCpp->m11(), sipCpp->m12(), sipCpp->m13(), sipCpp->m21(), sipCpp->m22(), sipCpp->m23(), sipCpp->m31(), sipCpp->m32(), sipCpp->m33());
%End
public:
enum TransformationType
{
TxNone,
TxTranslate,
TxScale,
TxRotate,
TxShear,
TxProject,
};
QTransform();
QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, qreal h31, qreal h32, qreal h33);
QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23);
QTransform(const QTransform &other);
QTransform::TransformationType type() const;
void setMatrix(qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33);
QTransform inverted(bool *invertible = 0) const;
QTransform adjoint() const;
QTransform transposed() const;
QTransform &translate(qreal dx, qreal dy);
QTransform &scale(qreal sx, qreal sy);
QTransform &shear(qreal sh, qreal sv);
QTransform &rotate(qreal angle, Qt::Axis axis = Qt::ZAxis);
%If (Qt_6_5_0 -)
QTransform &rotate(qreal a, Qt::Axis axis, qreal distanceToPlane);
%End
QTransform &rotateRadians(qreal angle, Qt::Axis axis = Qt::ZAxis);
%If (Qt_6_5_0 -)
QTransform &rotateRadians(qreal a, Qt::Axis axis, qreal distanceToPlane);
%End
static bool squareToQuad(const QPolygonF &square, QTransform &result);
static bool quadToSquare(const QPolygonF &quad, QTransform &result);
static bool quadToQuad(const QPolygonF &one, const QPolygonF &two, QTransform &result);
bool operator==(const QTransform &) const;
bool operator!=(const QTransform &) const;
QTransform &operator*=(const QTransform &) /__imatmul__/;
QTransform operator*(const QTransform &o) const /__matmul__/;
void reset();
void map(int x /Constrained/, int y /Constrained/, int *tx, int *ty) const;
void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
QPoint map(const QPoint &p) const;
QPointF map(const QPointF &p) const;
QLine map(const QLine &l) const;
QLineF map(const QLineF &l) const;
QPolygonF map(const QPolygonF &a) const;
QPolygon map(const QPolygon &a) const;
QRegion map(const QRegion &r) const;
QPainterPath map(const QPainterPath &p) const;
QPolygon mapToPolygon(const QRect &r) const;
QRect mapRect(const QRect &) const;
QRectF mapRect(const QRectF &) const;
bool isAffine() const;
bool isIdentity() const;
bool isInvertible() const;
bool isScaling() const;
bool isRotating() const;
bool isTranslating() const;
qreal determinant() const;
qreal m11() const;
qreal m12() const;
qreal m13() const;
qreal m21() const;
qreal m22() const;
qreal m23() const;
qreal m31() const;
qreal m32() const;
qreal m33() const;
qreal dx() const;
qreal dy() const;
static QTransform fromTranslate(qreal dx, qreal dy);
static QTransform fromScale(qreal dx, qreal dy);
QTransform &operator*=(qreal num);
QTransform &operator/=(qreal div);
QTransform &operator+=(qreal num);
QTransform &operator-=(qreal num);
Py_hash_t __hash__() const;
%MethodCode
sipRes = qHash(*sipCpp);
%End
};
QDataStream &operator<<(QDataStream &, const QTransform &) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QTransform & /Constrained/) /ReleaseGIL/;
QPoint operator*(const QPoint &p, const QTransform &m);
QPointF operator*(const QPointF &p, const QTransform &m);
QLineF operator*(const QLineF &l, const QTransform &m);
QLine operator*(const QLine &l, const QTransform &m);
QPolygon operator*(const QPolygon &a, const QTransform &m);
QPolygonF operator*(const QPolygonF &a, const QTransform &m);
QRegion operator*(const QRegion &r, const QTransform &m);
QTransform operator*(const QTransform &a, qreal n);
QTransform operator/(const QTransform &a, qreal n);
QTransform operator+(const QTransform &a, qreal n);
QTransform operator-(const QTransform &a, qreal n);
bool qFuzzyCompare(const QTransform &t1, const QTransform &t2);

View File

@@ -0,0 +1,57 @@
// qundogroup.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QUndoGroup : public QObject
{
%TypeHeaderCode
#include <qundogroup.h>
%End
public:
explicit QUndoGroup(QObject *parent /TransferThis/ = 0);
virtual ~QUndoGroup();
void addStack(QUndoStack *stack);
void removeStack(QUndoStack *stack);
QList<QUndoStack *> stacks() const;
QUndoStack *activeStack() const;
QAction *createRedoAction(QObject *parent /TransferThis/, const QString &prefix = QString()) const /Factory/;
QAction *createUndoAction(QObject *parent /TransferThis/, const QString &prefix = QString()) const /Factory/;
bool canUndo() const;
bool canRedo() const;
QString undoText() const;
QString redoText() const;
bool isClean() const;
public slots:
void redo();
void setActiveStack(QUndoStack *stack);
void undo();
signals:
void activeStackChanged(QUndoStack *stack);
void canRedoChanged(bool canRedo);
void canUndoChanged(bool canUndo);
void cleanChanged(bool clean);
void indexChanged(int idx);
void redoTextChanged(const QString &redoText);
void undoTextChanged(const QString &undoText);
};

View File

@@ -0,0 +1,95 @@
// qundostack.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QUndoCommand /Supertype=PyQt6.sip.wrapper/
{
%TypeHeaderCode
#include <qundostack.h>
%End
public:
explicit QUndoCommand(QUndoCommand *parent /TransferThis/ = 0);
QUndoCommand(const QString &text, QUndoCommand *parent /TransferThis/ = 0);
virtual ~QUndoCommand();
virtual int id() const;
virtual bool mergeWith(const QUndoCommand *other);
virtual void redo();
void setText(const QString &text);
QString text() const;
virtual void undo();
int childCount() const;
const QUndoCommand *child(int index) const;
QString actionText() const;
bool isObsolete() const;
void setObsolete(bool obsolete);
private:
QUndoCommand(const QUndoCommand &);
};
class QUndoStack : public QObject
{
%TypeHeaderCode
#include <qundostack.h>
%End
public:
explicit QUndoStack(QObject *parent /TransferThis/ = 0);
virtual ~QUndoStack();
void clear();
void push(QUndoCommand *cmd /Transfer/);
bool canUndo() const;
bool canRedo() const;
QString undoText() const;
QString redoText() const;
int count() const /__len__/;
int index() const;
QString text(int idx) const;
QAction *createUndoAction(QObject *parent /TransferThis/, const QString &prefix = QString()) const /Factory/;
QAction *createRedoAction(QObject *parent /TransferThis/, const QString &prefix = QString()) const /Factory/;
bool isActive() const;
bool isClean() const;
int cleanIndex() const;
void beginMacro(const QString &text);
void endMacro();
public slots:
void redo();
void setActive(bool active = true);
void setClean();
void setIndex(int idx);
void undo();
void resetClean();
signals:
void canRedoChanged(bool canRedo);
void canUndoChanged(bool canUndo);
void cleanChanged(bool clean);
void indexChanged(int idx);
void redoTextChanged(const QString &redoText);
void undoTextChanged(const QString &undoText);
public:
void setUndoLimit(int limit);
int undoLimit() const;
const QUndoCommand *command(int index) const;
};

View File

@@ -0,0 +1,47 @@
// qutimimeconverter.sip generated by MetaSIP
//
// This file is part of the QtGui 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_5_0 -)
%If (macOS)
class QUtiMimeConverter
{
%TypeHeaderCode
#include <qutimimeconverter.h>
%End
public:
QUtiMimeConverter();
virtual ~QUtiMimeConverter();
bool canConvert(const QString &mime, const QString &uti) const;
virtual QList<QByteArray> convertFromMime(const QString &mime, const QVariant &data, const QString &uti) const = 0;
virtual QString utiForMime(const QString &mime) const = 0;
virtual QString mimeForUti(const QString &uti) const = 0;
virtual QVariant convertToMime(const QString &mime, const QList<QByteArray> &data, const QString &uti) const = 0;
virtual int count(const QMimeData *mimeData) const;
private:
QUtiMimeConverter(const QUtiMimeConverter &);
};
%End
%End

View File

@@ -0,0 +1,113 @@
// qvalidator.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QValidator : public QObject
{
%TypeHeaderCode
#include <qvalidator.h>
%End
public:
explicit QValidator(QObject *parent /TransferThis/ = 0);
virtual ~QValidator();
enum State
{
Invalid,
Intermediate,
Acceptable,
};
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const = 0;
virtual void fixup(QString & /In,Out/) const;
void setLocale(const QLocale &locale);
QLocale locale() const;
signals:
void changed();
};
class QIntValidator : public QValidator
{
%TypeHeaderCode
#include <qvalidator.h>
%End
public:
explicit QIntValidator(QObject *parent /TransferThis/ = 0);
QIntValidator(int bottom, int top, QObject *parent /TransferThis/ = 0);
virtual ~QIntValidator();
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
virtual void fixup(QString &input /In,Out/) const;
void setBottom(int);
void setTop(int);
void setRange(int bottom, int top);
int bottom() const;
int top() const;
};
class QDoubleValidator : public QValidator
{
%TypeHeaderCode
#include <qvalidator.h>
%End
public:
explicit QDoubleValidator(QObject *parent /TransferThis/ = 0);
QDoubleValidator(double bottom, double top, int decimals, QObject *parent /TransferThis/ = 0);
virtual ~QDoubleValidator();
virtual QValidator::State validate(QString & /In,Out/, int & /In,Out/) const;
void setRange(double bottom, double top, int decimals = 0);
void setBottom(double);
void setTop(double);
void setDecimals(int);
double bottom() const;
double top() const;
int decimals() const;
enum Notation
{
StandardNotation,
ScientificNotation,
};
void setNotation(QDoubleValidator::Notation);
QDoubleValidator::Notation notation() const;
%If (Qt_6_3_0 -)
virtual void fixup(QString &input) const;
%End
};
class QRegularExpressionValidator : public QValidator
{
%TypeHeaderCode
#include <qvalidator.h>
%End
public:
explicit QRegularExpressionValidator(QObject *parent /TransferThis/ = 0);
QRegularExpressionValidator(const QRegularExpression &re, QObject *parent /TransferThis/ = 0);
virtual ~QRegularExpressionValidator();
virtual QValidator::State validate(QString &input /In,Out/, int &pos /In,Out/) const;
QRegularExpression regularExpression() const;
void setRegularExpression(const QRegularExpression &re);
};

View File

@@ -0,0 +1,259 @@
// qvectornd.sip generated by MetaSIP
//
// This file is part of the QtGui 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 <qvectornd.h>
%End
class QVector2D
{
%TypeHeaderCode
#include <qvectornd.h>
%End
public:
QVector2D();
QVector2D(float xpos, float ypos);
explicit QVector2D(QPoint point);
explicit QVector2D(QPointF point);
explicit QVector2D(QVector3D vector);
explicit QVector2D(QVector4D vector);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
PyObject *x = PyFloat_FromDouble(sipCpp->x());
PyObject *y = PyFloat_FromDouble(sipCpp->y());
if (x && y)
sipRes = PyUnicode_FromFormat("PyQt6.QtGui.QVector2D(%R, %R)",
x, y);
Py_XDECREF(x);
Py_XDECREF(y);
%End
bool isNull() const;
float x() const;
float y() const;
void setX(float x);
void setY(float y);
float operator[](int i) const;
float length() const;
float lengthSquared() const;
QVector2D normalized() const;
void normalize();
float distanceToPoint(QVector2D point) const;
float distanceToLine(QVector2D point, QVector2D direction) const;
QVector2D &operator+=(QVector2D vector);
QVector2D &operator-=(QVector2D vector);
QVector2D &operator*=(float factor);
QVector2D &operator*=(QVector2D vector);
QVector2D &operator/=(float divisor);
QVector2D &operator/=(QVector2D vector);
static float dotProduct(QVector2D v1, QVector2D v2);
QVector3D toVector3D() const;
QVector4D toVector4D() const;
QPoint toPoint() const;
QPointF toPointF() const;
};
class QVector3D
{
%TypeHeaderCode
#include <qvectornd.h>
%End
public:
QVector3D();
QVector3D(float xpos, float ypos, float zpos);
explicit QVector3D(QPoint point);
explicit QVector3D(QPointF point);
QVector3D(QVector2D vector, float zpos);
%If (Qt_6_1_0 -)
explicit QVector3D(QVector2D vector);
%End
%If (- Qt_6_1_0)
QVector3D(QVector2D vector);
%End
explicit QVector3D(QVector4D vector);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
PyObject *x = PyFloat_FromDouble(sipCpp->x());
PyObject *y = PyFloat_FromDouble(sipCpp->y());
PyObject *z = PyFloat_FromDouble(sipCpp->z());
if (x && y && z)
sipRes = PyUnicode_FromFormat(
"PyQt6.QtGui.QVector3D(%R, %R, %R)", x, y, z);
Py_XDECREF(x);
Py_XDECREF(y);
Py_XDECREF(z);
%End
bool isNull() const;
float x() const;
float y() const;
float z() const;
void setX(float x);
void setY(float y);
void setZ(float z);
float operator[](int i) const;
float length() const;
float lengthSquared() const;
QVector3D normalized() const;
void normalize();
QVector3D &operator+=(QVector3D vector);
QVector3D &operator-=(QVector3D vector);
QVector3D &operator*=(float factor);
QVector3D &operator*=(QVector3D vector);
QVector3D &operator/=(float divisor);
QVector3D &operator/=(QVector3D vector);
static float dotProduct(QVector3D v1, QVector3D v2);
static QVector3D crossProduct(QVector3D v1, QVector3D v2);
static QVector3D normal(QVector3D v1, QVector3D v2);
static QVector3D normal(QVector3D v1, QVector3D v2, QVector3D v3);
QVector3D project(const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const;
QVector3D unproject(const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const;
float distanceToPoint(QVector3D point) const;
float distanceToPlane(QVector3D plane, QVector3D normal) const;
float distanceToPlane(QVector3D plane1, QVector3D plane2, QVector3D plane3) const;
float distanceToLine(QVector3D point, QVector3D direction) const;
QVector2D toVector2D() const;
QVector4D toVector4D() const;
QPoint toPoint() const;
QPointF toPointF() const;
};
class QVector4D
{
%TypeHeaderCode
#include <qvectornd.h>
%End
public:
QVector4D();
QVector4D(float xpos, float ypos, float zpos, float wpos);
explicit QVector4D(QPoint point);
explicit QVector4D(QPointF point);
%If (Qt_6_1_0 -)
explicit QVector4D(QVector2D vector);
%End
%If (- Qt_6_1_0)
QVector4D(QVector2D vector);
%End
QVector4D(QVector2D vector, float zpos, float wpos);
%If (Qt_6_1_0 -)
explicit QVector4D(QVector3D vector);
%End
%If (- Qt_6_1_0)
QVector4D(QVector3D vector);
%End
QVector4D(QVector3D vector, float wpos);
SIP_PYOBJECT __repr__() const /TypeHint="str"/;
%MethodCode
PyObject *x = PyFloat_FromDouble(sipCpp->x());
PyObject *y = PyFloat_FromDouble(sipCpp->y());
PyObject *z = PyFloat_FromDouble(sipCpp->z());
PyObject *w = PyFloat_FromDouble(sipCpp->w());
if (x && y && z && w)
sipRes = PyUnicode_FromFormat(
"PyQt6.QtGui.QVector4D(%R, %R, %R, %R)", x, y, z, w);
Py_XDECREF(x);
Py_XDECREF(y);
Py_XDECREF(z);
Py_XDECREF(w);
%End
bool isNull() const;
float x() const;
float y() const;
float z() const;
float w() const;
void setX(float x);
void setY(float y);
void setZ(float z);
void setW(float w);
float operator[](int i) const;
float length() const;
float lengthSquared() const;
QVector4D normalized() const;
void normalize();
QVector4D &operator+=(QVector4D vector);
QVector4D &operator-=(QVector4D vector);
QVector4D &operator*=(float factor);
QVector4D &operator*=(QVector4D vector);
QVector4D &operator/=(float divisor);
QVector4D &operator/=(QVector4D vector);
static float dotProduct(QVector4D v1, QVector4D v2);
QVector2D toVector2D() const;
QVector2D toVector2DAffine() const;
QVector3D toVector3D() const;
QVector3D toVector3DAffine() const;
QPoint toPoint() const;
QPointF toPointF() const;
};
bool operator==(QVector4D v1, QVector4D v2);
bool operator==(QVector3D v1, QVector3D v2);
bool operator==(QVector2D v1, QVector2D v2);
bool operator!=(QVector4D v1, QVector4D v2);
bool operator!=(QVector3D v1, QVector3D v2);
bool operator!=(QVector2D v1, QVector2D v2);
QVector4D operator+(QVector4D v1, QVector4D v2);
QVector3D operator+(QVector3D v1, QVector3D v2);
QVector2D operator+(QVector2D v1, QVector2D v2);
QVector4D operator-(QVector4D vector);
QVector4D operator-(QVector4D v1, QVector4D v2);
QVector3D operator-(QVector3D vector);
QVector3D operator-(QVector3D v1, QVector3D v2);
QVector2D operator-(QVector2D vector);
QVector2D operator-(QVector2D v1, QVector2D v2);
QVector4D operator*(const QMatrix4x4 &matrix, const QVector4D &vector);
QVector4D operator*(const QVector4D &vector, const QMatrix4x4 &matrix);
QVector4D operator*(QVector4D v1, QVector4D v2);
QVector4D operator*(QVector4D vector, float factor);
QVector4D operator*(float factor, QVector4D vector);
QVector3D operator*(const QMatrix4x4 &matrix, const QVector3D &vector);
QVector3D operator*(const QVector3D &vector, const QMatrix4x4 &matrix);
QVector3D operator*(QVector3D v1, QVector3D v2);
QVector3D operator*(QVector3D vector, float factor);
QVector3D operator*(float factor, QVector3D vector);
QVector2D operator*(QVector2D v1, QVector2D v2);
QVector2D operator*(QVector2D vector, float factor);
QVector2D operator*(float factor, QVector2D vector);
QVector4D operator/(QVector4D vector, QVector4D divisor);
QVector4D operator/(QVector4D vector, float divisor);
QVector3D operator/(QVector3D vector, QVector3D divisor);
QVector3D operator/(QVector3D vector, float divisor);
QVector2D operator/(QVector2D vector, QVector2D divisor);
QVector2D operator/(QVector2D vector, float divisor);
bool qFuzzyCompare(QVector4D v1, QVector4D v2);
bool qFuzzyCompare(QVector3D v1, QVector3D v2);
bool qFuzzyCompare(QVector2D v1, QVector2D v2);
QDataStream &operator<<(QDataStream &, QVector4D) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &, QVector3D) /ReleaseGIL/;
QDataStream &operator<<(QDataStream &, QVector2D) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QVector4D & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QVector3D & /Constrained/) /ReleaseGIL/;
QDataStream &operator>>(QDataStream &, QVector2D & /Constrained/) /ReleaseGIL/;

View File

@@ -0,0 +1,235 @@
// qwindow.sip generated by MetaSIP
//
// This file is part of the QtGui 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 QWindow : public QObject, public QSurface
{
%TypeHeaderCode
#include <qwindow.h>
%End
public:
explicit QWindow(QScreen *screen = 0);
explicit QWindow(QWindow *parent /TransferThis/);
virtual ~QWindow();
void setSurfaceType(QSurface::SurfaceType surfaceType);
virtual QSurface::SurfaceType surfaceType() const;
bool isVisible() const;
void create();
WId winId() const;
QWindow *parent(QWindow::AncestorMode mode = QWindow::ExcludeTransients) const;
void setParent(QWindow *parent /Transfer/);
bool isTopLevel() const;
bool isModal() const;
Qt::WindowModality modality() const;
void setModality(Qt::WindowModality modality);
void setFormat(const QSurfaceFormat &format);
virtual QSurfaceFormat format() const;
QSurfaceFormat requestedFormat() const;
void setFlags(Qt::WindowFlags flags);
Qt::WindowFlags flags() const;
Qt::WindowType type() const;
QString title() const;
void setOpacity(qreal level);
public slots:
void requestActivate();
public:
bool isActive() const;
void reportContentOrientationChange(Qt::ScreenOrientation orientation);
Qt::ScreenOrientation contentOrientation() const;
qreal devicePixelRatio() const;
Qt::WindowState windowState() const;
void setWindowState(Qt::WindowState state);
void setTransientParent(QWindow *parent);
QWindow *transientParent() const;
enum AncestorMode
{
ExcludeTransients,
IncludeTransients,
};
bool isAncestorOf(const QWindow *child, QWindow::AncestorMode mode = QWindow::IncludeTransients) const;
bool isExposed() const;
int minimumWidth() const;
int minimumHeight() const;
int maximumWidth() const;
int maximumHeight() const;
QSize minimumSize() const;
QSize maximumSize() const;
QSize baseSize() const;
QSize sizeIncrement() const;
void setMinimumSize(const QSize &size);
void setMaximumSize(const QSize &size);
void setBaseSize(const QSize &size);
void setSizeIncrement(const QSize &size);
void setGeometry(int posx, int posy, int w, int h);
void setGeometry(const QRect &rect);
QRect geometry() const;
QMargins frameMargins() const;
QRect frameGeometry() const;
QPoint framePosition() const;
void setFramePosition(const QPoint &point);
int width() const;
int height() const;
int x() const;
int y() const;
virtual QSize size() const;
QPoint position() const;
void setPosition(const QPoint &pt);
void setPosition(int posx, int posy);
void resize(const QSize &newSize);
void resize(int w, int h);
void setFilePath(const QString &filePath);
QString filePath() const;
void setIcon(const QIcon &icon);
QIcon icon() const;
void destroy();
bool setKeyboardGrabEnabled(bool grab);
bool setMouseGrabEnabled(bool grab);
QScreen *screen() const;
void setScreen(QScreen *screen);
virtual QObject *focusObject() const;
QPoint mapToGlobal(const QPoint &pos) const;
QPointF mapToGlobal(const QPointF &pos) const;
QPoint mapFromGlobal(const QPoint &pos) const;
QPointF mapFromGlobal(const QPointF &pos) const;
QCursor cursor() const;
void setCursor(const QCursor &);
void unsetCursor();
public slots:
void setVisible(bool visible);
void show() /ReleaseGIL/;
void hide();
void showMinimized() /ReleaseGIL/;
void showMaximized() /ReleaseGIL/;
void showFullScreen() /ReleaseGIL/;
void showNormal() /ReleaseGIL/;
bool close();
void raise();
void lower();
void setTitle(const QString &);
void setX(int arg);
void setY(int arg);
void setWidth(int arg);
void setHeight(int arg);
void setMinimumWidth(int w);
void setMinimumHeight(int h);
void setMaximumWidth(int w);
void setMaximumHeight(int h);
void alert(int msec);
void requestUpdate();
signals:
void screenChanged(QScreen *screen);
void modalityChanged(Qt::WindowModality modality);
void windowStateChanged(Qt::WindowState windowState);
void xChanged(int arg);
void yChanged(int arg);
void widthChanged(int arg);
void heightChanged(int arg);
void minimumWidthChanged(int arg);
void minimumHeightChanged(int arg);
void maximumWidthChanged(int arg);
void maximumHeightChanged(int arg);
void visibleChanged(bool arg);
void contentOrientationChanged(Qt::ScreenOrientation orientation);
void focusObjectChanged(QObject *object);
void windowTitleChanged(const QString &title);
protected:
virtual void exposeEvent(QExposeEvent *);
virtual void resizeEvent(QResizeEvent *);
virtual void moveEvent(QMoveEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void focusOutEvent(QFocusEvent *);
virtual void showEvent(QShowEvent *);
virtual void hideEvent(QHideEvent *);
virtual bool event(QEvent *);
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseMoveEvent(QMouseEvent *);
virtual void wheelEvent(QWheelEvent *);
virtual void touchEvent(QTouchEvent *);
virtual void tabletEvent(QTabletEvent *);
public:
enum Visibility
{
Hidden,
AutomaticVisibility,
Windowed,
Minimized,
Maximized,
FullScreen,
};
QWindow::Visibility visibility() const;
void setVisibility(QWindow::Visibility v);
qreal opacity() const;
void setMask(const QRegion &region);
QRegion mask() const;
static QWindow *fromWinId(WId id);
signals:
void visibilityChanged(QWindow::Visibility visibility);
void activeChanged();
void opacityChanged(qreal opacity);
public:
void setFlag(Qt::WindowType, bool on = true);
Qt::WindowStates windowStates() const;
void setWindowStates(Qt::WindowStates states);
public slots:
bool startSystemResize(Qt::Edges edges);
bool startSystemMove();
protected:
virtual void paintEvent(QPaintEvent *);
virtual void closeEvent(QCloseEvent *);
virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result /Out/);
public:
%If (PyQt_Vulkan)
void setVulkanInstance(QVulkanInstance *instance);
%End
%If (PyQt_Vulkan)
QVulkanInstance *vulkanInstance() const;
%End
%If (Qt_6_9_0 -)
QMargins safeAreaMargins() const;
%End
signals:
%If (Qt_6_9_0 -)
void safeAreaMarginsChanged(QMargins arg);
%End
%If (Qt_6_10_0 -)
void flagsChanged(Qt::WindowFlags flags);
%End
};

View File

@@ -0,0 +1,24 @@
// qwindowdefs.sip generated by MetaSIP
//
// This file is part of the QtGui 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<QWindow *> QWindowList;
typedef quintptr WId;