/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

//workaround to access protected functions
#define protected public

// default includes
#include <shiboken.h>
#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QDebug>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <pyside.h>
#include <pysideqenum.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtgui_python.h"

// main header
#include "qtextlayout_wrapper.h"

// inner classes
#include "qtextlayout_formatrange_wrapper.h"

// Extra includes
#include <QList>
#include <QTextLayout>
#include <QTextOption>
#include <QtGui/qfont.h>
#include <QtGui/qglyphrun.h>
#include <QtGui/qpaintdevice.h>
#include <QtGui/qpainter.h>
#include <QtGui/qrawfont.h>
#include <QtGui/qtextlayout.h>
#include <QtGui/qtextobject.h>
#include <QtGui/qtextoption.h>
#include <qpoint.h>
#include <qrect.h>


#include <cctype>
#include <cstring>



template <class T>
static const char *typeNameOf(const T &t)
{
    const char *typeName =  typeid(t).name();
    auto size = std::strlen(typeName);
#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64"
    if (auto lastStar = strchr(typeName, '*')) {
        // MSVC: "class QPaintDevice * __ptr64"
        while (*--lastStar == ' ') {
        }
        size = lastStar - typeName + 1;
    }
#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice"
    if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) {
        ++typeName;
        --size;
    }
#endif
    char *result = new char[size + 1];
    result[size] = '\0';
    memcpy(result, typeName, size);
    return result;
}


// Target ---------------------------------------------------------

extern "C" {
static int
Sbk_QTextLayout_Init(PyObject *self, PyObject *args, PyObject *kwds)
{
    SbkObject *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::QTextLayout >()))
        return -1;

    ::QTextLayout *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.__init__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[3];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0, 0};

    // invalid argument lengths
    if (numArgs > 3) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayout_Init_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OOO:QTextLayout", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2])))
        return -1;


    // Overloaded function decisor
    // 0: QTextLayout::QTextLayout()
    // 1: QTextLayout::QTextLayout(QString)
    // 2: QTextLayout::QTextLayout(QString,QFont,const QPaintDevice*)
    // 3: QTextLayout::QTextLayout(QTextBlock)
    if (numArgs == 0) {
        overloadId = 0; // QTextLayout()
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QTEXTBLOCK_IDX], (pyArgs[0])))) {
        overloadId = 3; // QTextLayout(QTextBlock)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 1; // QTextLayout(QString)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QFONT_IDX], (pyArgs[1])))) {
            if (numArgs == 2) {
                overloadId = 2; // QTextLayout(QString,QFont,const QPaintDevice*)
            } else if (numArgs >= 3
                && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_IDX], (pyArgs[2])))) {
                overloadId = 2; // QTextLayout(QString,QFont,const QPaintDevice*)
            }
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayout_Init_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // QTextLayout()
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QTextLayout_Init_TypeError;
            }

            if (!PyErr_Occurred()) {
                // QTextLayout()
                cptr = new ::QTextLayout();
            }
            break;
        }
        case 1: // QTextLayout(const QString & text)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QTextLayout_Init_TypeError;
            }
            ::QString cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!PyErr_Occurred()) {
                // QTextLayout(QString)
                cptr = new ::QTextLayout(cppArg0);
            }
            break;
        }
        case 2: // QTextLayout(const QString & text, const QFont & font, const QPaintDevice * paintdevice)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_paintdevice = Shiboken::String::createStaticString("paintdevice");
                if (PyDict_Contains(kwds, key_paintdevice)) {
                    value = PyDict_GetItem(kwds, key_paintdevice);
                    if (value && pyArgs[2]) {
                        errInfo.reset(key_paintdevice);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QTextLayout_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[2] = value;
                        if (!(pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_IDX], (pyArgs[2]))))
                            goto Sbk_QTextLayout_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_paintdevice);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QTextLayout_Init_TypeError;
                }
            }
            ::QString cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QFont cppArg1_local;
            ::QFont *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!Shiboken::Object::isValid(pyArgs[2]))
                return -1;
            ::QPaintDevice *cppArg2 = nullptr;
            if (pythonToCpp[2])
                pythonToCpp[2](pyArgs[2], &cppArg2);

            if (!PyErr_Occurred()) {
                // QTextLayout(QString,QFont,const QPaintDevice*)
                cptr = new ::QTextLayout(cppArg0, *cppArg1, cppArg2);
            }
            break;
        }
        case 3: // QTextLayout(const QTextBlock & b)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QTextLayout_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QTextBlock cppArg0_local;
            ::QTextBlock *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QTextLayout(QTextBlock)
                cptr = new ::QTextLayout(*cppArg0);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QTextLayout >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (!cptr) goto Sbk_QTextLayout_Init_TypeError;

    Shiboken::Object::setValidCpp(sbkSelf, true);
    if (Shiboken::BindingManager::instance().hasWrapper(cptr)) {
        Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr));
    }
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;

    Sbk_QTextLayout_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

static PyObject *Sbk_QTextLayoutFunc_beginLayout(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.beginLayout";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // beginLayout()
            cppSelf->beginLayout();
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;
}

static PyObject *Sbk_QTextLayoutFunc_boundingRect(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.boundingRect";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // boundingRect()const
            QRectF cppResult = const_cast<const ::QTextLayout *>(cppSelf)->boundingRect();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QRECTF_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_cacheEnabled(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.cacheEnabled";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // cacheEnabled()const
            bool cppResult = const_cast<const ::QTextLayout *>(cppSelf)->cacheEnabled();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_clearFormats(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.clearFormats";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // clearFormats()
            cppSelf->clearFormats();
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;
}

static PyObject *Sbk_QTextLayoutFunc_clearLayout(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.clearLayout";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // clearLayout()
            cppSelf->clearLayout();
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;
}

static PyObject *Sbk_QTextLayoutFunc_createLine(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.createLine";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // createLine()
            QTextLine cppResult = cppSelf->createLine();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_cursorMoveStyle(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.cursorMoveStyle";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // cursorMoveStyle()const
            Qt::CursorMoveStyle cppResult = const_cast<const ::QTextLayout *>(cppSelf)->cursorMoveStyle();
            pyResult = Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_CURSORMOVESTYLE_IDX]))->converter, &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_draw(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.draw";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[4];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0, 0, 0};

    // invalid argument lengths
    if (numArgs > 4) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_draw_TypeError;
    } else if (numArgs < 2) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_draw_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OOOO:draw", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::draw(QPainter*,QPointF,QList<QTextLayout::FormatRange>,QRectF)const
    if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArgs[1])))) {
        if (numArgs == 2) {
            overloadId = 0; // draw(QPainter*,QPointF,QList<QTextLayout::FormatRange>,QRectF)const
        } else if (numArgs >= 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtGuiTypeConverters[SBK_QTGUI_QLIST_QTEXTLAYOUT_FORMATRANGE_IDX], (pyArgs[2])))) {
            if (numArgs == 3) {
                overloadId = 0; // draw(QPainter*,QPointF,QList<QTextLayout::FormatRange>,QRectF)const
            } else if (numArgs >= 4
                && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECTF_IDX], (pyArgs[3])))) {
                overloadId = 0; // draw(QPainter*,QPointF,QList<QTextLayout::FormatRange>,QRectF)const
            }
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_draw_TypeError;

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_selections = Shiboken::String::createStaticString("selections");
            if (PyDict_Contains(kwds, key_selections)) {
                value = PyDict_GetItem(kwds, key_selections);
                if (value && pyArgs[2]) {
                    errInfo.reset(key_selections);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_draw_TypeError;
                }
                if (value) {
                    pyArgs[2] = value;
                    if (!(pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtGuiTypeConverters[SBK_QTGUI_QLIST_QTEXTLAYOUT_FORMATRANGE_IDX], (pyArgs[2]))))
                        goto Sbk_QTextLayoutFunc_draw_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_selections);
            }
            static PyObject *const key_clip = Shiboken::String::createStaticString("clip");
            if (PyDict_Contains(kwds, key_clip)) {
                value = PyDict_GetItem(kwds, key_clip);
                if (value && pyArgs[3]) {
                    errInfo.reset(key_clip);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_draw_TypeError;
                }
                if (value) {
                    pyArgs[3] = value;
                    if (!(pythonToCpp[3] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECTF_IDX], (pyArgs[3]))))
                        goto Sbk_QTextLayoutFunc_draw_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_clip);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLayoutFunc_draw_TypeError;
            }
        }
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QPainter *cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QPointF cppArg1_local;
        ::QPointF *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1].isValue())
            pythonToCpp[1](pyArgs[1], &cppArg1_local);
        else
            pythonToCpp[1](pyArgs[1], &cppArg1);

        ::QList<QTextLayout::FormatRange > cppArg2;
        if (pythonToCpp[2])
            pythonToCpp[2](pyArgs[2], &cppArg2);
        if (!Shiboken::Object::isValid(pyArgs[3]))
            return {};
        ::QRectF cppArg3_local = QRectF();
        ::QRectF *cppArg3 = &cppArg3_local;
        if (pythonToCpp[3]) {
            if (pythonToCpp[3].isValue())
                pythonToCpp[3](pyArgs[3], &cppArg3_local);
            else
                pythonToCpp[3](pyArgs[3], &cppArg3);
            }

        if (!PyErr_Occurred()) {
            // draw(QPainter*,QPointF,QList<QTextLayout::FormatRange>,QRectF)const
            const_cast<const ::QTextLayout *>(cppSelf)->draw(cppArg0, *cppArg1, cppArg2, *cppArg3);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_draw_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_drawCursor(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.drawCursor";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[4];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0, 0, 0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "drawCursor", 3, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::drawCursor(QPainter*,QPointF,int)const
    // 1: QTextLayout::drawCursor(QPainter*,QPointF,int,int)const
    if (numArgs >= 3
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArgs[1])))
        && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[2])))) {
        if (numArgs == 3) {
            overloadId = 0; // drawCursor(QPainter*,QPointF,int)const
        } else if (numArgs == 4
            && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[3])))) {
            overloadId = 1; // drawCursor(QPainter*,QPointF,int,int)const
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_drawCursor_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // drawCursor(QPainter * p, const QPointF & pos, int cursorPosition) const
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QPainter *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return {};
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            int cppArg2;
            pythonToCpp[2](pyArgs[2], &cppArg2);

            if (!PyErr_Occurred()) {
                // drawCursor(QPainter*,QPointF,int)const
                const_cast<const ::QTextLayout *>(cppSelf)->drawCursor(cppArg0, *cppArg1, cppArg2);
            }
            break;
        }
        case 1: // drawCursor(QPainter * p, const QPointF & pos, int cursorPosition, int width) const
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QPainter *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return {};
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            int cppArg2;
            pythonToCpp[2](pyArgs[2], &cppArg2);
            int cppArg3;
            pythonToCpp[3](pyArgs[3], &cppArg3);

            if (!PyErr_Occurred()) {
                // drawCursor(QPainter*,QPointF,int,int)const
                const_cast<const ::QTextLayout *>(cppSelf)->drawCursor(cppArg0, *cppArg1, cppArg2, cppArg3);
            }
            break;
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_drawCursor_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_endLayout(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.endLayout";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // endLayout()
            cppSelf->endLayout();
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;
}

static PyObject *Sbk_QTextLayoutFunc_font(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.font";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // font()const
            QFont cppResult = const_cast<const ::QTextLayout *>(cppSelf)->font();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QFONT_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_formats(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.formats";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // formats()const
            QList<QTextLayout::FormatRange > cppResult = const_cast<const ::QTextLayout *>(cppSelf)->formats();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypeConverters[SBK_QTGUI_QLIST_QTEXTLAYOUT_FORMATRANGE_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_glyphRuns(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.glyphRuns";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths
    if (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:glyphRuns", &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::glyphRuns(int,int)const->QList< QGlyphRun >
    if (numArgs == 0) {
        overloadId = 0; // glyphRuns(int,int)const
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // glyphRuns(int,int)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))) {
            overloadId = 0; // glyphRuns(int,int)const
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_from = Shiboken::String::createStaticString("from");
            if (PyDict_Contains(kwds, key_from)) {
                value = PyDict_GetItem(kwds, key_from);
                if (value && pyArgs[0]) {
                    errInfo.reset(key_from);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
                }
                if (value) {
                    pyArgs[0] = value;
                    if (!(pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0]))))
                        goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_from);
            }
            static PyObject *const key_length = Shiboken::String::createStaticString("length");
            if (PyDict_Contains(kwds, key_length)) {
                value = PyDict_GetItem(kwds, key_length);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_length);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1]))))
                        goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_length);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLayoutFunc_glyphRuns_TypeError;
            }
        }
        int cppArg0 = -1;
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);
        int cppArg1 = -1;
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // glyphRuns(int,int)const
            QList<QGlyphRun > cppResult = const_cast<const ::QTextLayout *>(cppSelf)->glyphRuns(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypeConverters[SBK_QTGUI_QLIST_QGLYPHRUN_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_glyphRuns_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_isValidCursorPosition(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.isValidCursorPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::isValidCursorPosition(int)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // isValidCursorPosition(int)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_isValidCursorPosition_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // isValidCursorPosition(int)const
            bool cppResult = const_cast<const ::QTextLayout *>(cppSelf)->isValidCursorPosition(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_isValidCursorPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_leftCursorPosition(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.leftCursorPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::leftCursorPosition(int)const->int
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // leftCursorPosition(int)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_leftCursorPosition_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // leftCursorPosition(int)const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->leftCursorPosition(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_leftCursorPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_lineAt(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.lineAt";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::lineAt(int)const->QTextLine
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // lineAt(int)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_lineAt_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // lineAt(int)const
            QTextLine cppResult = const_cast<const ::QTextLayout *>(cppSelf)->lineAt(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_lineAt_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_lineCount(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.lineCount";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // lineCount()const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->lineCount();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_lineForTextPosition(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.lineForTextPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::lineForTextPosition(int)const->QTextLine
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // lineForTextPosition(int)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_lineForTextPosition_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // lineForTextPosition(int)const
            QTextLine cppResult = const_cast<const ::QTextLayout *>(cppSelf)->lineForTextPosition(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_lineForTextPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_maximumWidth(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.maximumWidth";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // maximumWidth()const
            qreal cppResult = const_cast<const ::QTextLayout *>(cppSelf)->maximumWidth();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_minimumWidth(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.minimumWidth";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // minimumWidth()const
            qreal cppResult = const_cast<const ::QTextLayout *>(cppSelf)->minimumWidth();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_nextCursorPosition(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.nextCursorPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths
    if (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:nextCursorPosition", &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::nextCursorPosition(int,QTextLayout::CursorMode)const->int
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // nextCursorPosition(int,QTextLayout::CursorMode)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 0; // nextCursorPosition(int,QTextLayout::CursorMode)const
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_mode = Shiboken::String::createStaticString("mode");
            if (PyDict_Contains(kwds, key_mode)) {
                value = PyDict_GetItem(kwds, key_mode);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_mode);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX]))->converter, (pyArgs[1]))))
                        goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_mode);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLayoutFunc_nextCursorPosition_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QTextLayout::CursorMode cppArg1(QTextLayout::CursorMode::SkipCharacters);
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // nextCursorPosition(int,QTextLayout::CursorMode)const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->nextCursorPosition(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_nextCursorPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_position(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.position";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // position()const
            QPointF cppResult = const_cast<const ::QTextLayout *>(cppSelf)->position();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_preeditAreaPosition(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.preeditAreaPosition";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // preeditAreaPosition()const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->preeditAreaPosition();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_preeditAreaText(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.preeditAreaText";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // preeditAreaText()const
            QString cppResult = const_cast<const ::QTextLayout *>(cppSelf)->preeditAreaText();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_previousCursorPosition(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.previousCursorPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths
    if (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:previousCursorPosition", &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::previousCursorPosition(int,QTextLayout::CursorMode)const->int
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // previousCursorPosition(int,QTextLayout::CursorMode)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 0; // previousCursorPosition(int,QTextLayout::CursorMode)const
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_mode = Shiboken::String::createStaticString("mode");
            if (PyDict_Contains(kwds, key_mode)) {
                value = PyDict_GetItem(kwds, key_mode);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_mode);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX]))->converter, (pyArgs[1]))))
                        goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_mode);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLayoutFunc_previousCursorPosition_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QTextLayout::CursorMode cppArg1(QTextLayout::CursorMode::SkipCharacters);
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // previousCursorPosition(int,QTextLayout::CursorMode)const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->previousCursorPosition(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_previousCursorPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_rightCursorPosition(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.rightCursorPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::rightCursorPosition(int)const->int
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // rightCursorPosition(int)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_rightCursorPosition_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // rightCursorPosition(int)const
            int cppResult = const_cast<const ::QTextLayout *>(cppSelf)->rightCursorPosition(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QTextLayoutFunc_rightCursorPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setCacheEnabled(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setCacheEnabled";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setCacheEnabled(bool)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArg)))) {
        overloadId = 0; // setCacheEnabled(bool)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setCacheEnabled_TypeError;

    // Call function/method
    {
        bool cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setCacheEnabled(bool)
            cppSelf->setCacheEnabled(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setCacheEnabled_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setCursorMoveStyle(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setCursorMoveStyle";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setCursorMoveStyle(Qt::CursorMoveStyle)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_CURSORMOVESTYLE_IDX]))->converter, (pyArg)))) {
        overloadId = 0; // setCursorMoveStyle(Qt::CursorMoveStyle)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setCursorMoveStyle_TypeError;

    // Call function/method
    {
        ::Qt::CursorMoveStyle cppArg0{Qt::LogicalMoveStyle};
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setCursorMoveStyle(Qt::CursorMoveStyle)
            cppSelf->setCursorMoveStyle(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setCursorMoveStyle_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setFlags(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setFlags";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setFlags(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // setFlags(int)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setFlags_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setFlags(int)
            cppSelf->setFlags(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setFlags_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setFont(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setFont";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setFont(QFont)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QFONT_IDX], (pyArg)))) {
        overloadId = 0; // setFont(QFont)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setFont_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QFont cppArg0_local;
        ::QFont *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setFont(QFont)
            cppSelf->setFont(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setFont_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setFormats(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setFormats";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setFormats(QList<QTextLayout::FormatRange>)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtGuiTypeConverters[SBK_QTGUI_QLIST_QTEXTLAYOUT_FORMATRANGE_IDX], (pyArg)))) {
        overloadId = 0; // setFormats(QList<QTextLayout::FormatRange>)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setFormats_TypeError;

    // Call function/method
    {
        ::QList<QTextLayout::FormatRange > cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setFormats(QList<QTextLayout::FormatRange>)
            cppSelf->setFormats(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setFormats_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setPosition(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setPosition";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setPosition(QPointF)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArg)))) {
        overloadId = 0; // setPosition(QPointF)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setPosition_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QPointF cppArg0_local;
        ::QPointF *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setPosition(QPointF)
            cppSelf->setPosition(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setPreeditArea(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setPreeditArea";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "setPreeditArea", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLayout::setPreeditArea(int,QString)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) {
        overloadId = 0; // setPreeditArea(int,QString)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setPreeditArea_TypeError;

    // Call function/method
    {
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QString cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // setPreeditArea(int,QString)
            cppSelf->setPreeditArea(cppArg0, cppArg1);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setPreeditArea_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setRawFont(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setRawFont";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setRawFont(QRawFont)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QRAWFONT_IDX], (pyArg)))) {
        overloadId = 0; // setRawFont(QRawFont)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setRawFont_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRawFont cppArg0_local;
        ::QRawFont *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setRawFont(QRawFont)
            cppSelf->setRawFont(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setRawFont_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setText(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setText";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setText(QString)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) {
        overloadId = 0; // setText(QString)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setText_TypeError;

    // Call function/method
    {
        ::QString cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setText(QString)
            cppSelf->setText(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setText_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_setTextOption(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.setTextOption";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QTextLayout::setTextOption(QTextOption)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QTEXTOPTION_IDX], (pyArg)))) {
        overloadId = 0; // setTextOption(QTextOption)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QTextLayoutFunc_setTextOption_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QTextOption cppArg0_local;
        ::QTextOption *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setTextOption(QTextOption)
            cppSelf->setTextOption(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QTextLayoutFunc_setTextOption_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QTextLayoutFunc_text(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.text";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // text()const
            QString cppResult = const_cast<const ::QTextLayout *>(cppSelf)->text();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QTextLayoutFunc_textOption(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLayout *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLayout.textOption";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // textOption()const
            const QTextOption & cppResult = const_cast<const ::QTextLayout *>(cppSelf)->textOption();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QTEXTOPTION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


static const char *Sbk_QTextLayout_PropertyStrings[] = {
    nullptr // Sentinel
};

static PyMethodDef Sbk_QTextLayout_methods[] = {
    {"beginLayout", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_beginLayout), METH_NOARGS},
    {"boundingRect", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_boundingRect), METH_NOARGS},
    {"cacheEnabled", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_cacheEnabled), METH_NOARGS},
    {"clearFormats", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_clearFormats), METH_NOARGS},
    {"clearLayout", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_clearLayout), METH_NOARGS},
    {"createLine", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_createLine), METH_NOARGS},
    {"cursorMoveStyle", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_cursorMoveStyle), METH_NOARGS},
    {"draw", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_draw), METH_VARARGS|METH_KEYWORDS},
    {"drawCursor", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_drawCursor), METH_VARARGS},
    {"endLayout", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_endLayout), METH_NOARGS},
    {"font", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_font), METH_NOARGS},
    {"formats", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_formats), METH_NOARGS},
    {"glyphRuns", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_glyphRuns), METH_VARARGS|METH_KEYWORDS},
    {"isValidCursorPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_isValidCursorPosition), METH_O},
    {"leftCursorPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_leftCursorPosition), METH_O},
    {"lineAt", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_lineAt), METH_O},
    {"lineCount", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_lineCount), METH_NOARGS},
    {"lineForTextPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_lineForTextPosition), METH_O},
    {"maximumWidth", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_maximumWidth), METH_NOARGS},
    {"minimumWidth", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_minimumWidth), METH_NOARGS},
    {"nextCursorPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_nextCursorPosition), METH_VARARGS|METH_KEYWORDS},
    {"position", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_position), METH_NOARGS},
    {"preeditAreaPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_preeditAreaPosition), METH_NOARGS},
    {"preeditAreaText", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_preeditAreaText), METH_NOARGS},
    {"previousCursorPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_previousCursorPosition), METH_VARARGS|METH_KEYWORDS},
    {"rightCursorPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_rightCursorPosition), METH_O},
    {"setCacheEnabled", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setCacheEnabled), METH_O},
    {"setCursorMoveStyle", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setCursorMoveStyle), METH_O},
    {"setFlags", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setFlags), METH_O},
    {"setFont", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setFont), METH_O},
    {"setFormats", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setFormats), METH_O},
    {"setPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setPosition), METH_O},
    {"setPreeditArea", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setPreeditArea), METH_VARARGS},
    {"setRawFont", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setRawFont), METH_O},
    {"setText", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setText), METH_O},
    {"setTextOption", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_setTextOption), METH_O},
    {"text", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_text), METH_NOARGS},
    {"textOption", reinterpret_cast<PyCFunction>(Sbk_QTextLayoutFunc_textOption), METH_NOARGS},

    {nullptr, nullptr} // Sentinel
};

} // extern "C"

static int Sbk_QTextLayout_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QTextLayout_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static PyTypeObject *_Sbk_QTextLayout_Type = nullptr;
static PyTypeObject *Sbk_QTextLayout_TypeF(void)
{
    return _Sbk_QTextLayout_Type;
}

static PyType_Slot Sbk_QTextLayout_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        nullptr},
    {Py_tp_hash,        nullptr},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    nullptr},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QTextLayout_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QTextLayout_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QTextLayout_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QTextLayout_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QTextLayout_spec = {
    "2:PySide6.QtGui.QTextLayout",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QTextLayout_slots
};

} //extern "C"


// Type conversion functions.

// Python to C++ enum conversion.
static void QTextLayout_CursorMode_PythonToCpp_QTextLayout_CursorMode(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QTextLayout::CursorMode *>(cppOut) =
        static_cast<::QTextLayout::CursorMode>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QTextLayout_CursorMode_PythonToCpp_QTextLayout_CursorMode_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX]))
        return QTextLayout_CursorMode_PythonToCpp_QTextLayout_CursorMode;
    return {};
}
static PyObject *QTextLayout_CursorMode_CppToPython_QTextLayout_CursorMode(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QTextLayout::CursorMode *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX], castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QTextLayout_PythonToCpp_QTextLayout_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QTextLayout_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QTextLayout_PythonToCpp_QTextLayout_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QTextLayout_TypeF())))
        return QTextLayout_PythonToCpp_QTextLayout_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QTextLayout_PTR_CppToPython_QTextLayout(const void *cppIn)
{
    auto pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    bool changedTypeName = false;
    auto tCppIn = reinterpret_cast<const ::QTextLayout *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName);
    if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) {
        typeName = typeNameOf(tCppIn);
        changedTypeName = true;
    }
    PyObject *result = Shiboken::Object::newObject(Sbk_QTextLayout_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QTextLayout_SignatureStrings[] = {
    "3:PySide6.QtGui.QTextLayout(self)",
    "2:PySide6.QtGui.QTextLayout(self,text:QString)",
    "1:PySide6.QtGui.QTextLayout(self,text:QString,font:typing.Union[PySide6.QtGui.QFont, QString, QStringList],paintdevice:PySide6.QtGui.QPaintDevice=nullptr)",
    "0:PySide6.QtGui.QTextLayout(self,b:PySide6.QtGui.QTextBlock)",
    "PySide6.QtGui.QTextLayout.beginLayout(self)",
    "PySide6.QtGui.QTextLayout.boundingRect(self)->PySide6.QtCore.QRectF",
    "PySide6.QtGui.QTextLayout.cacheEnabled(self)->bool",
    "PySide6.QtGui.QTextLayout.clearFormats(self)",
    "PySide6.QtGui.QTextLayout.clearLayout(self)",
    "PySide6.QtGui.QTextLayout.createLine(self)->PySide6.QtGui.QTextLine",
    "PySide6.QtGui.QTextLayout.cursorMoveStyle(self)->PySide6.QtCore.Qt.CursorMoveStyle",
    "PySide6.QtGui.QTextLayout.draw(self,p:PySide6.QtGui.QPainter,pos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],selections:QList[PySide6.QtGui.QTextLayout.FormatRange]=QList<QTextLayout.FormatRange>(),clip:typing.Union[PySide6.QtCore.QRectF, PySide6.QtCore.QRect]=QRectF())",
    "1:PySide6.QtGui.QTextLayout.drawCursor(self,p:PySide6.QtGui.QPainter,pos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],cursorPosition:int)",
    "0:PySide6.QtGui.QTextLayout.drawCursor(self,p:PySide6.QtGui.QPainter,pos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],cursorPosition:int,width:int)",
    "PySide6.QtGui.QTextLayout.endLayout(self)",
    "PySide6.QtGui.QTextLayout.font(self)->PySide6.QtGui.QFont",
    "PySide6.QtGui.QTextLayout.formats(self)->QList[PySide6.QtGui.QTextLayout.FormatRange]",
    "PySide6.QtGui.QTextLayout.glyphRuns(self,from:int=-1,length:int=-1)->QList[PySide6.QtGui.QGlyphRun]",
    "PySide6.QtGui.QTextLayout.isValidCursorPosition(self,pos:int)->bool",
    "PySide6.QtGui.QTextLayout.leftCursorPosition(self,oldPos:int)->int",
    "PySide6.QtGui.QTextLayout.lineAt(self,i:int)->PySide6.QtGui.QTextLine",
    "PySide6.QtGui.QTextLayout.lineCount(self)->int",
    "PySide6.QtGui.QTextLayout.lineForTextPosition(self,pos:int)->PySide6.QtGui.QTextLine",
    "PySide6.QtGui.QTextLayout.maximumWidth(self)->qreal",
    "PySide6.QtGui.QTextLayout.minimumWidth(self)->qreal",
    "PySide6.QtGui.QTextLayout.nextCursorPosition(self,oldPos:int,mode:PySide6.QtGui.QTextLayout.CursorMode=QTextLayout.CursorMode.SkipCharacters)->int",
    "PySide6.QtGui.QTextLayout.position(self)->PySide6.QtCore.QPointF",
    "PySide6.QtGui.QTextLayout.preeditAreaPosition(self)->int",
    "PySide6.QtGui.QTextLayout.preeditAreaText(self)->QString",
    "PySide6.QtGui.QTextLayout.previousCursorPosition(self,oldPos:int,mode:PySide6.QtGui.QTextLayout.CursorMode=QTextLayout.CursorMode.SkipCharacters)->int",
    "PySide6.QtGui.QTextLayout.rightCursorPosition(self,oldPos:int)->int",
    "PySide6.QtGui.QTextLayout.setCacheEnabled(self,enable:bool)",
    "PySide6.QtGui.QTextLayout.setCursorMoveStyle(self,style:PySide6.QtCore.Qt.CursorMoveStyle)",
    "PySide6.QtGui.QTextLayout.setFlags(self,flags:int)",
    "PySide6.QtGui.QTextLayout.setFont(self,f:typing.Union[PySide6.QtGui.QFont, QString, QStringList])",
    "PySide6.QtGui.QTextLayout.setFormats(self,overrides:QList[PySide6.QtGui.QTextLayout.FormatRange])",
    "PySide6.QtGui.QTextLayout.setPosition(self,p:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element])",
    "PySide6.QtGui.QTextLayout.setPreeditArea(self,position:int,text:QString)",
    "PySide6.QtGui.QTextLayout.setRawFont(self,rawFont:PySide6.QtGui.QRawFont)",
    "PySide6.QtGui.QTextLayout.setText(self,string:QString)",
    "PySide6.QtGui.QTextLayout.setTextOption(self,option:typing.Union[PySide6.QtGui.QTextOption, PySide6.QtCore.Qt.Alignment])",
    "PySide6.QtGui.QTextLayout.text(self)->QString",
    "PySide6.QtGui.QTextLayout.textOption(self)->PySide6.QtGui.QTextOption",
    nullptr}; // Sentinel

void init_QTextLayout(PyObject *module)
{
    _Sbk_QTextLayout_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QTextLayout",
        "QTextLayout*",
        &Sbk_QTextLayout_spec,
        &Shiboken::callCppDestructor< ::QTextLayout >,
        0,
        0,
        0);
    auto *pyType = Sbk_QTextLayout_TypeF(); // references _Sbk_QTextLayout_Type
    InitSignatureStrings(pyType, QTextLayout_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QTextLayout_Type), Sbk_QTextLayout_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_IDX]
        = Sbk_QTextLayout_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QTextLayout_TypeF(),
        QTextLayout_PythonToCpp_QTextLayout_PTR,
        is_QTextLayout_PythonToCpp_QTextLayout_PTR_Convertible,
        QTextLayout_PTR_CppToPython_QTextLayout);

    Shiboken::Conversions::registerConverterName(converter, "QTextLayout");
    Shiboken::Conversions::registerConverterName(converter, "QTextLayout*");
    Shiboken::Conversions::registerConverterName(converter, "QTextLayout&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::QTextLayout).name());


    // Initialization of enums.

    // Initialization of enum 'CursorMode'.
    SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QTextLayout_TypeF(),
        "CursorMode",
        "2:PySide6.QtGui.QTextLayout.CursorMode",
        "QTextLayout::CursorMode");
    if (!SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX],
        Sbk_QTextLayout_TypeF(), "SkipCharacters", (long) QTextLayout::CursorMode::SkipCharacters))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX],
        Sbk_QTextLayout_TypeF(), "SkipWords", (long) QTextLayout::CursorMode::SkipWords))
        return;
    // Register converter for enum 'QTextLayout::CursorMode'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX],
            QTextLayout_CursorMode_CppToPython_QTextLayout_CursorMode);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QTextLayout_CursorMode_PythonToCpp_QTextLayout_CursorMode,
            is_QTextLayout_CursorMode_PythonToCpp_QTextLayout_CursorMode_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLAYOUT_CURSORMODE_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QTextLayout::CursorMode");
        Shiboken::Conversions::registerConverterName(converter, "CursorMode");
    }
    // End of 'CursorMode' enum.

    qRegisterMetaType< ::QTextLayout::CursorMode >("QTextLayout::CursorMode");
}
