/****************************************************************************
**
** 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 "qtextline_wrapper.h"

// inner classes

// Extra includes
#include <QList>
#include <QTextLayout>
#include <QtGui/qglyphrun.h>
#include <QtGui/qpainter.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_QTextLine_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< ::QTextLine >()))
        return -1;

    ::QTextLine *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.__init__";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // QTextLine()
            cptr = new ::QTextLine();
        }
    }

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QTextLine >(), cptr)) {
        delete cptr;
        return -1;
    }
    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;
}

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

    // Call function/method
    {

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

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

static PyObject *Sbk_QTextLineFunc_cursorToX(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.cursorToX";
    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_QTextLineFunc_cursorToX_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLineFunc_cursorToX_TypeError;
    }

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


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

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

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

        if (!PyErr_Occurred()) {
            // cursorToX(int,QTextLine::Edge)const
            // Begin code injection
            // ========================================================================
            // START of custom code block [file: ../glue/qtgui.cpp (qtextline-cursortox)]
            qreal cppResult = cppSelf->::QTextLine::cursorToX(&cppArg0, cppArg1);
            pyResult = PyTuple_New(2);
            PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), &cppResult));
            PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppArg0));
            // END of custom code block [file: ../glue/qtgui.cpp (qtextline-cursortox)]
            // ========================================================================
            // End of code injection

        }
    }

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

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

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

    // Call function/method
    {

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

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

static PyObject *Sbk_QTextLineFunc_draw(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.draw";
    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, "draw", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLine::draw(QPainter*,QPointF)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])))) {
        overloadId = 0; // draw(QPainter*,QPointF)const
    }

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

    // Call function/method
    {
        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);


        if (!PyErr_Occurred()) {
            // draw(QPainter*,QPointF)const
            const_cast<const ::QTextLine *>(cppSelf)->draw(cppArg0, *cppArg1);
        }
    }

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

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

static PyObject *Sbk_QTextLineFunc_glyphRuns(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.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_QTextLineFunc_glyphRuns_TypeError;
    }

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


    // Overloaded function decisor
    // 0: QTextLine::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_QTextLineFunc_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_QTextLineFunc_glyphRuns_TypeError;
                }
                if (value) {
                    pyArgs[0] = value;
                    if (!(pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0]))))
                        goto Sbk_QTextLineFunc_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_QTextLineFunc_glyphRuns_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1]))))
                        goto Sbk_QTextLineFunc_glyphRuns_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_length);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLineFunc_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 ::QTextLine *>(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_QTextLineFunc_glyphRuns_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // position()const
            QPointF cppResult = const_cast<const ::QTextLine *>(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_QTextLineFunc_rect(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.rect";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

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

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

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

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

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

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

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

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

    // Overloaded function decisor
    // 0: QTextLine::setLineWidth(qreal)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 0; // setLineWidth(qreal)
    }

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

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

        if (!PyErr_Occurred()) {
            // setLineWidth(qreal)
            cppSelf->setLineWidth(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QTextLineFunc_setNumColumns(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.setNumColumns";
    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, "setNumColumns", 1, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QTextLine::setNumColumns(int)
    // 1: QTextLine::setNumColumns(int,qreal)
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // setNumColumns(int)
        } else if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArgs[1])))) {
            overloadId = 1; // setNumColumns(int,qreal)
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // setNumColumns(int columns)
        {
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!PyErr_Occurred()) {
                // setNumColumns(int)
                cppSelf->setNumColumns(cppArg0);
            }
            break;
        }
        case 1: // setNumColumns(int columns, qreal alignmentWidth)
        {
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            qreal cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // setNumColumns(int,qreal)
                cppSelf->setNumColumns(cppArg0, cppArg1);
            }
            break;
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QTextLine::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_QTextLineFunc_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_QTextLineFunc_setPosition_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

static PyObject *Sbk_QTextLineFunc_xToCursor(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QTextLine.xToCursor";
    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_QTextLineFunc_xToCursor_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QTextLineFunc_xToCursor_TypeError;
    }

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


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

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_edge = Shiboken::String::createStaticString("edge");
            if (PyDict_Contains(kwds, key_edge)) {
                value = PyDict_GetItem(kwds, key_edge);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_edge);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QTextLineFunc_xToCursor_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX]))->converter, (pyArgs[1]))))
                        goto Sbk_QTextLineFunc_xToCursor_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_edge);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QTextLineFunc_xToCursor_TypeError;
            }
        }
        qreal cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QTextLine::CursorPosition cppArg1(QTextLine::CursorPosition::CursorBetweenCharacters);
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

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

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

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

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

    // Call function/method
    {

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

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

static PyObject *Sbk_QTextLine___copy__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], &cppSelf);
    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


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

static PyMethodDef Sbk_QTextLine_methods[] = {
    {"ascent", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_ascent), METH_NOARGS},
    {"cursorToX", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_cursorToX), METH_VARARGS|METH_KEYWORDS},
    {"descent", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_descent), METH_NOARGS},
    {"draw", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_draw), METH_VARARGS},
    {"glyphRuns", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_glyphRuns), METH_VARARGS|METH_KEYWORDS},
    {"height", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_height), METH_NOARGS},
    {"horizontalAdvance", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_horizontalAdvance), METH_NOARGS},
    {"isValid", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_isValid), METH_NOARGS},
    {"leading", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_leading), METH_NOARGS},
    {"leadingIncluded", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_leadingIncluded), METH_NOARGS},
    {"lineNumber", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_lineNumber), METH_NOARGS},
    {"naturalTextRect", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_naturalTextRect), METH_NOARGS},
    {"naturalTextWidth", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_naturalTextWidth), METH_NOARGS},
    {"position", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_position), METH_NOARGS},
    {"rect", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_rect), METH_NOARGS},
    {"setLeadingIncluded", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_setLeadingIncluded), METH_O},
    {"setLineWidth", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_setLineWidth), METH_O},
    {"setNumColumns", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_setNumColumns), METH_VARARGS},
    {"setPosition", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_setPosition), METH_O},
    {"textLength", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_textLength), METH_NOARGS},
    {"textStart", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_textStart), METH_NOARGS},
    {"width", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_width), METH_NOARGS},
    {"x", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_x), METH_NOARGS},
    {"xToCursor", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_xToCursor), METH_VARARGS|METH_KEYWORDS},
    {"y", reinterpret_cast<PyCFunction>(Sbk_QTextLineFunc_y), METH_NOARGS},

    {"__copy__", reinterpret_cast<PyCFunction>(Sbk_QTextLine___copy__), METH_NOARGS},
    {nullptr, nullptr} // Sentinel
};

} // extern "C"

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

static PyType_Slot Sbk_QTextLine_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_QTextLine_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QTextLine_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QTextLine_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QTextLine_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QTextLine_spec = {
    "2:PySide6.QtGui.QTextLine",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QTextLine_slots
};

} //extern "C"


// Type conversion functions.

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

}
static PythonToCppFunc is_QTextLine_Edge_PythonToCpp_QTextLine_Edge_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX]))
        return QTextLine_Edge_PythonToCpp_QTextLine_Edge;
    return {};
}
static PyObject *QTextLine_Edge_CppToPython_QTextLine_Edge(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QTextLine::Edge *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX], castCppIn);

}

static void QTextLine_CursorPosition_PythonToCpp_QTextLine_CursorPosition(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QTextLine::CursorPosition *>(cppOut) =
        static_cast<::QTextLine::CursorPosition>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QTextLine_CursorPosition_PythonToCpp_QTextLine_CursorPosition_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX]))
        return QTextLine_CursorPosition_PythonToCpp_QTextLine_CursorPosition;
    return {};
}
static PyObject *QTextLine_CursorPosition_CppToPython_QTextLine_CursorPosition(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QTextLine::CursorPosition *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX], castCppIn);

}

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QTextLine_PTR_CppToPython_QTextLine(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 ::QTextLine *>(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_QTextLine_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// C++ to Python copy conversion.
static PyObject *QTextLine_COPY_CppToPython_QTextLine(const void *cppIn)
{
    return Shiboken::Object::newObject(Sbk_QTextLine_TypeF(), new ::QTextLine(*reinterpret_cast<const ::QTextLine *>(cppIn)), true, true);
}

// Python to C++ copy conversion.
static void QTextLine_PythonToCpp_QTextLine_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QTextLine *>(cppOut) = *reinterpret_cast< ::QTextLine *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QTextLine_PythonToCpp_QTextLine_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QTextLine_TypeF())))
        return QTextLine_PythonToCpp_QTextLine_COPY;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QTextLine_SignatureStrings[] = {
    "PySide6.QtGui.QTextLine(self)",
    "PySide6.QtGui.QTextLine.ascent(self)->qreal",
    "PySide6.QtGui.QTextLine.cursorToX(self,cursorPos:int,edge:PySide6.QtGui.QTextLine.Edge=QTextLine.Edge.Leading)->PyObject",
    "PySide6.QtGui.QTextLine.descent(self)->qreal",
    "PySide6.QtGui.QTextLine.draw(self,painter:PySide6.QtGui.QPainter,position:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element])",
    "PySide6.QtGui.QTextLine.glyphRuns(self,from:int=-1,length:int=-1)->QList[PySide6.QtGui.QGlyphRun]",
    "PySide6.QtGui.QTextLine.height(self)->qreal",
    "PySide6.QtGui.QTextLine.horizontalAdvance(self)->qreal",
    "PySide6.QtGui.QTextLine.isValid(self)->bool",
    "PySide6.QtGui.QTextLine.leading(self)->qreal",
    "PySide6.QtGui.QTextLine.leadingIncluded(self)->bool",
    "PySide6.QtGui.QTextLine.lineNumber(self)->int",
    "PySide6.QtGui.QTextLine.naturalTextRect(self)->PySide6.QtCore.QRectF",
    "PySide6.QtGui.QTextLine.naturalTextWidth(self)->qreal",
    "PySide6.QtGui.QTextLine.position(self)->PySide6.QtCore.QPointF",
    "PySide6.QtGui.QTextLine.rect(self)->PySide6.QtCore.QRectF",
    "PySide6.QtGui.QTextLine.setLeadingIncluded(self,included:bool)",
    "PySide6.QtGui.QTextLine.setLineWidth(self,width:qreal)",
    "1:PySide6.QtGui.QTextLine.setNumColumns(self,columns:int)",
    "0:PySide6.QtGui.QTextLine.setNumColumns(self,columns:int,alignmentWidth:qreal)",
    "PySide6.QtGui.QTextLine.setPosition(self,pos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element])",
    "PySide6.QtGui.QTextLine.textLength(self)->int",
    "PySide6.QtGui.QTextLine.textStart(self)->int",
    "PySide6.QtGui.QTextLine.width(self)->qreal",
    "PySide6.QtGui.QTextLine.x(self)->qreal",
    "PySide6.QtGui.QTextLine.xToCursor(self,x:qreal,edge:PySide6.QtGui.QTextLine.CursorPosition=QTextLine.CursorPosition.CursorBetweenCharacters)->int",
    "PySide6.QtGui.QTextLine.y(self)->qreal",
    "PySide6.QtGui.QTextLine.__copy__()",
    nullptr}; // Sentinel

void init_QTextLine(PyObject *module)
{
    _Sbk_QTextLine_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QTextLine",
        "QTextLine",
        &Sbk_QTextLine_spec,
        &Shiboken::callCppDestructor< ::QTextLine >,
        0,
        0,
        0);
    auto *pyType = Sbk_QTextLine_TypeF(); // references _Sbk_QTextLine_Type
    InitSignatureStrings(pyType, QTextLine_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QTextLine_Type), Sbk_QTextLine_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_IDX]
        = Sbk_QTextLine_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QTextLine_TypeF(),
        QTextLine_PythonToCpp_QTextLine_PTR,
        is_QTextLine_PythonToCpp_QTextLine_PTR_Convertible,
        QTextLine_PTR_CppToPython_QTextLine,
        QTextLine_COPY_CppToPython_QTextLine);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QTextLine_PythonToCpp_QTextLine_COPY,
        is_QTextLine_PythonToCpp_QTextLine_COPY_Convertible);

    // Initialization of enums.

    // Initialization of enum 'Edge'.
    SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QTextLine_TypeF(),
        "Edge",
        "2:PySide6.QtGui.QTextLine.Edge",
        "QTextLine::Edge");
    if (!SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX],
        Sbk_QTextLine_TypeF(), "Leading", (long) QTextLine::Edge::Leading))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX],
        Sbk_QTextLine_TypeF(), "Trailing", (long) QTextLine::Edge::Trailing))
        return;
    // Register converter for enum 'QTextLine::Edge'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX],
            QTextLine_Edge_CppToPython_QTextLine_Edge);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QTextLine_Edge_PythonToCpp_QTextLine_Edge,
            is_QTextLine_Edge_PythonToCpp_QTextLine_Edge_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_EDGE_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QTextLine::Edge");
        Shiboken::Conversions::registerConverterName(converter, "Edge");
    }
    // End of 'Edge' enum.

    // Initialization of enum 'CursorPosition'.
    SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QTextLine_TypeF(),
        "CursorPosition",
        "2:PySide6.QtGui.QTextLine.CursorPosition",
        "QTextLine::CursorPosition");
    if (!SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX],
        Sbk_QTextLine_TypeF(), "CursorBetweenCharacters", (long) QTextLine::CursorPosition::CursorBetweenCharacters))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX],
        Sbk_QTextLine_TypeF(), "CursorOnCharacter", (long) QTextLine::CursorPosition::CursorOnCharacter))
        return;
    // Register converter for enum 'QTextLine::CursorPosition'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX],
            QTextLine_CursorPosition_CppToPython_QTextLine_CursorPosition);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QTextLine_CursorPosition_PythonToCpp_QTextLine_CursorPosition,
            is_QTextLine_CursorPosition_PythonToCpp_QTextLine_CursorPosition_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtGuiTypes[SBK_QTEXTLINE_CURSORPOSITION_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QTextLine::CursorPosition");
        Shiboken::Conversions::registerConverterName(converter, "CursorPosition");
    }
    // End of 'CursorPosition' enum.

    qRegisterMetaType< ::QTextLine >("QTextLine");
    qRegisterMetaType< ::QTextLine::Edge >("QTextLine::Edge");
    qRegisterMetaType< ::QTextLine::CursorPosition >("QTextLine::CursorPosition");
}
