Python bindings via Shiboken

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-05-12 18:19:43 +00:00
parent b06e9227c5
commit ca260217f9
48 changed files with 29570 additions and 3270 deletions

4
.gitignore vendored
View file

@ -12,9 +12,11 @@
# Vim temporary files
*.swp
# Shiboken log files
bindings/*.log
# Directories to ignore
# ---------------------
apidocs
build
minsize

View file

@ -456,11 +456,11 @@ set_package_properties(MySQL PROPERTIES
)
if(KATIE_BINDINGS)
find_package(SWIG)
set_package_properties(SWIG PROPERTIES
find_package(Shiboken)
set_package_properties(Shiboken PROPERTIES
PURPOSE "Python bindings"
DESCRIPTION "Simplified Wrapper and Interface Generator"
URL "http://www.swig.org/"
DESCRIPTION "Generates bindings for C++ libraries using CPython source code"
URL "https://wiki.qt.io/PySide"
TYPE REQUIRED
)

View file

@ -1,4 +1,3 @@
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings")
@ -33,26 +32,45 @@ include_directories(
${CMAKE_BINARY_DIR}/privateinclude/QtTest
${CMAKE_BINARY_DIR}/include/QtUiTools
${CMAKE_BINARY_DIR}/privateinclude/QtUiTools
${SHIBOKEN_INCLUDES}
${PYTHON_INCLUDE_DIRS}
)
set_property(SOURCE KtCore.i PROPERTY CPLUSPLUS ON)
swig_add_module(KtCore python KtCore.i)
swig_link_libraries(KtCore KtCore)
set_property(SOURCE KtGui.i PROPERTY CPLUSPLUS ON)
swig_add_module(KtGui python KtGui.i)
swig_link_libraries(KtGui KtGui)
install(
FILES
${CMAKE_BINARY_DIR}/bindings/KtCore.py
${CMAKE_BINARY_DIR}/bindings/KtGui.py
DESTINATION ${KATIE_PYTHON_RELATIVE}
remove_definitions(
-DQT_ASCII_CAST_WARNINGS
)
set(PyKtCore_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qbytearray_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qbytearray_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qchar_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qchar_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qcoreapplication_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qcoreapplication_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qobject_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qobject_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qstring_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qstring_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qlatin1char_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qlatin1char_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qlatin1string_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/katie_qlatin1string_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/ktcore_module_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/KtCore/ktcore_python.h
)
katana_generate_bindings(KtCore ${PyKtCore_SOURCES})
add_library(PyKtCore MODULE ${PyKtCore_SOURCES})
target_link_libraries(PyKtCore
KtCore
${SHIBOKEN_LIBRARIES}
${PYTHON_LIBRARY}
)
set_target_properties(PyKtCore PROPERTIES PREFIX "")
set_target_properties(PyKtCore PROPERTIES OUTPUT_NAME KtCore)
install(
TARGETS _KtCore _KtGui
TARGETS PyKtCore
DESTINATION ${KATIE_PYTHON_RELATIVE}
)

View file

@ -1,163 +0,0 @@
%module KtCore
%include "tricks.i"
%include "core/qbytearray.i"
%include "core/qchar.i"
%include "core/qcoreapplication.i"
%include "core/qeasingcurve.i"
%include "core/qjsonarray.i"
%include "core/qjsondocument.i"
%include "core/qjsonobject.i"
%include "core/qjsonvalue.i"
%include "core/qlist.i"
%include "core/qobject.i"
%include "core/qregexp.i"
%include "core/qset.i"
%include "core/qstring.i"
%include "core/qstringlist.i"
%include "core/qvariant.i"
%include "core/qvector.i"
// maybe rename? (e.g. QCharList)
%template(QListInt) QList<int>;
%template(QListQByteArray) QList<QByteArray>;
%template(QListQChar) QList<QChar>;
%template(QListQString) QList<QString>;
%template(QSetInt) QSet<int>;
%template(QSetQByteArray) QSet<QByteArray>;
%template(QSetQChar) QSet<QChar>;
%template(QSetQString) QSet<QString>;
%template(QVectorInt) QVector<int>;
%template(QVectorQByteArray) QVector<QByteArray>;
%template(QVectorQChar) QVector<QChar>;
%template(QVectorQString) QVector<QString>;
// %template(QVariantList) QList<QVariant>;
// %template(QVariantMap) QMap<QVariant>;
// %template(QVariantHash) QHash<QVariant>;
%{
#include "QtCore/QFile"
#include "QtCore/QBitArray"
#include "QtCore/QDataStream"
#include "QtCore/QDate"
#include "QtCore/QDateTime"
#include "QtCore/QLine"
#include "QtCore/QLineF"
#include "QtCore/QLocale"
#include "QtCore/QTime"
#include "QtCore/QPoint"
#include "QtCore/QPointF"
#include "QtCore/QSize"
#include "QtCore/QSizeF"
#include "QtCore/QRect"
#include "QtCore/QRectF"
#include "QtCore/QUrl"
QT_USE_NAMESPACE
%}
// temporary implementations for testing purposes
class QFile {
public:
QFile(QString filename);
~QFile();
bool exists() const;
};
// stub implementations for QVariant testing
class QBitArray {
public:
QBitArray();
~QBitArray();
};
class QDataStream {
public:
QDataStream();
~QDataStream();
};
class QDate {
public:
QDate();
~QDate();
};
class QDateTime {
public:
QDateTime();
~QDateTime();
};
class QLine {
public:
QLine();
~QLine();
};
class QLineF {
public:
QLineF();
~QLineF();
};
class QLocale {
public:
QLocale();
~QLocale();
};
class QTime {
public:
QTime();
~QTime();
};
class QPoint {
public:
QPoint();
~QPoint();
};
class QPointF {
public:
QPointF();
~QPointF();
};
class QSize {
public:
QSize();
~QSize();
};
class QSizeF {
public:
QSizeF();
~QSizeF();
};
class QRect {
public:
QRect();
~QRect();
};
class QRectF {
public:
QRectF();
~QRectF();
};
class QUrl {
public:
QUrl();
~QUrl();
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KATIE_QBYTEARRAY_H
#define SBK_KATIE_QBYTEARRAY_H
#include <qbytearray.h>
#endif // SBK_KATIE_QBYTEARRAY_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KATIE_QCHAR_H
#define SBK_KATIE_QCHAR_H
#include <qchar.h>
#endif // SBK_KATIE_QCHAR_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,85 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_QCOREAPPLICATIONWRAPPER_H
#define SBK_QCOREAPPLICATIONWRAPPER_H
#include <qcoreapplication.h>
class QCoreApplicationWrapper : public Katie::QCoreApplication
{
public:
QCoreApplicationWrapper(int & argc, char ** argv);
inline void aboutToQuit_protected() { Katie::QCoreApplication::aboutToQuit(); }
inline void connectNotify_protected(const char * signal) { Katie::QCoreApplication::connectNotify(signal); }
void connectNotify(const char * signal) override;
inline void destroyed_protected(Katie::QObject * arg__1 = Q_NULLPTR) { Katie::QCoreApplication::destroyed(arg__1); }
inline void disconnectNotify_protected(const char * signal) { Katie::QCoreApplication::disconnectNotify(signal); }
void disconnectNotify(const char * signal) override;
inline int receivers_protected(const char * signal) const { return Katie::QCoreApplication::receivers(signal); }
inline Katie::QObject * sender_protected() const { return Katie::QCoreApplication::sender(); }
inline int senderSignalIndex_protected() const { return Katie::QCoreApplication::senderSignalIndex(); }
inline void unixSignal_protected(int arg__1) { Katie::QCoreApplication::unixSignal(arg__1); }
~QCoreApplicationWrapper();
};
# ifndef SBK_QOBJECTWRAPPER_H
# define SBK_QOBJECTWRAPPER_H
// Inherited base class:
class QObjectWrapper : public Katie::QObject
{
public:
QObjectWrapper(Katie::QObject * parent = Q_NULLPTR);
inline void connectNotify_protected(const char * signal) { Katie::QObject::connectNotify(signal); }
void connectNotify(const char * signal) override;
inline void destroyed_protected(Katie::QObject * arg__1 = Q_NULLPTR) { Katie::QObject::destroyed(arg__1); }
inline void disconnectNotify_protected(const char * signal) { Katie::QObject::disconnectNotify(signal); }
void disconnectNotify(const char * signal) override;
inline int receivers_protected(const char * signal) const { return Katie::QObject::receivers(signal); }
inline Katie::QObject * sender_protected() const { return Katie::QObject::sender(); }
inline int senderSignalIndex_protected() const { return Katie::QObject::senderSignalIndex(); }
~QObjectWrapper();
};
# endif // SBK_QOBJECTWRAPPER_H
#endif // SBK_QCOREAPPLICATIONWRAPPER_H

View file

@ -0,0 +1,339 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
// default includes
#include <shiboken.h>
#include <typeinfo>
// module include
#include "ktcore_python.h"
// main header
#include "katie_qlatin1char_wrapper.h"
// inner classes
// Extra includes
#include <cctype>
#include <cstring>
using namespace Katie;
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_Katie_QLatin1Char_Init(PyObject* self, PyObject* args, PyObject* kwds)
{
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Katie::QLatin1Char >()))
return -1;
::Katie::QLatin1Char* cptr{};
int overloadId = -1;
PythonToCppFunc pythonToCpp[] = { nullptr };
SBK_UNUSED(pythonToCpp)
int numArgs = PyTuple_GET_SIZE(args);
SBK_UNUSED(numArgs)
PyObject* pyArgs[] = {0};
// invalid argument lengths
if (!PyArg_UnpackTuple(args, "QLatin1Char", 1, 1, &(pyArgs[0])))
return -1;
// Overloaded function decisor
// 0: QLatin1Char::QLatin1Char(char)
if (numArgs == 1
&& SbkChar_Check(pyArgs[0]) && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<char>(), (pyArgs[0])))) {
overloadId = 0; // QLatin1Char(char)
}
// Function signature not found.
if (overloadId == -1) goto Sbk_Katie_QLatin1Char_Init_TypeError;
// Call function/method
{
char cppArg0;
pythonToCpp[0](pyArgs[0], &cppArg0);
if (!PyErr_Occurred()) {
// QLatin1Char(char)
PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS
cptr = new ::Katie::QLatin1Char(cppArg0);
PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS
}
}
if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Katie::QLatin1Char >(), cptr)) {
delete cptr;
return -1;
}
if (!cptr) goto Sbk_Katie_QLatin1Char_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_Katie_QLatin1Char_Init_TypeError:
Shiboken::setErrorAboutWrongArguments(args, "KtCore.Katie.QLatin1Char");
return -1;
}
static PyObject* Sbk_Katie_QLatin1CharFunc_toLatin1(PyObject* self)
{
::Katie::QLatin1Char* cppSelf = nullptr;
SBK_UNUSED(cppSelf)
if (!Shiboken::Object::isValid(self))
return {};
cppSelf = reinterpret_cast< ::Katie::QLatin1Char *>(Shiboken::Conversions::cppPointer(SbkKtCoreTypes[SBK_KATIE_QLATIN1CHAR_IDX], reinterpret_cast<SbkObject *>(self)));
PyObject* pyResult{};
// Call function/method
{
if (!PyErr_Occurred()) {
// toLatin1()const
char cppResult = const_cast<const ::Katie::QLatin1Char*>(cppSelf)->toLatin1();
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<char>(), &cppResult);
}
}
if (PyErr_Occurred() || !pyResult) {
Py_XDECREF(pyResult);
return {};
}
return pyResult;
}
static PyObject* Sbk_Katie_QLatin1CharFunc_unicode(PyObject* self)
{
::Katie::QLatin1Char* cppSelf = nullptr;
SBK_UNUSED(cppSelf)
if (!Shiboken::Object::isValid(self))
return {};
cppSelf = reinterpret_cast< ::Katie::QLatin1Char *>(Shiboken::Conversions::cppPointer(SbkKtCoreTypes[SBK_KATIE_QLATIN1CHAR_IDX], reinterpret_cast<SbkObject *>(self)));
PyObject* pyResult{};
// Call function/method
{
if (!PyErr_Occurred()) {
// unicode()const
ushort cppResult = const_cast<const ::Katie::QLatin1Char*>(cppSelf)->unicode();
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<ushort>(), &cppResult);
}
}
if (PyErr_Occurred() || !pyResult) {
Py_XDECREF(pyResult);
return {};
}
return pyResult;
}
static PyMethodDef Sbk_Katie_QLatin1Char_methods[] = {
{"toLatin1", reinterpret_cast<PyCFunction>(Sbk_Katie_QLatin1CharFunc_toLatin1), METH_NOARGS},
{"unicode", reinterpret_cast<PyCFunction>(Sbk_Katie_QLatin1CharFunc_unicode), METH_NOARGS},
{nullptr, nullptr} // Sentinel
};
} // extern "C"
static int Sbk_Katie_QLatin1Char_traverse(PyObject* self, visitproc visit, void* arg)
{
return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_traverse(self, visit, arg);
}
static int Sbk_Katie_QLatin1Char_clear(PyObject* self)
{
return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static SbkObjectType *_Sbk_Katie_QLatin1Char_Type = nullptr;
static SbkObjectType *Sbk_Katie_QLatin1Char_TypeF(void)
{
return _Sbk_Katie_QLatin1Char_Type;
}
static PyType_Slot Sbk_Katie_QLatin1Char_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_Katie_QLatin1Char_traverse)},
{Py_tp_clear, reinterpret_cast<void*>(Sbk_Katie_QLatin1Char_clear)},
{Py_tp_richcompare, nullptr},
{Py_tp_iter, nullptr},
{Py_tp_iternext, nullptr},
{Py_tp_methods, reinterpret_cast<void*>(Sbk_Katie_QLatin1Char_methods)},
{Py_tp_getset, nullptr},
{Py_tp_init, reinterpret_cast<void*>(Sbk_Katie_QLatin1Char_Init)},
{Py_tp_new, reinterpret_cast<void*>(SbkObjectTpNew)},
{0, nullptr}
};
static PyType_Spec Sbk_Katie_QLatin1Char_spec = {
"KtCore.Katie.QLatin1Char",
sizeof(SbkObject),
0,
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC,
Sbk_Katie_QLatin1Char_slots
};
} //extern "C"
// Type conversion functions.
// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QLatin1Char_PythonToCpp_QLatin1Char_PTR(PyObject* pyIn, void* cppOut) {
Shiboken::Conversions::pythonToCppPointer(Sbk_Katie_QLatin1Char_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QLatin1Char_PythonToCpp_QLatin1Char_PTR_Convertible(PyObject* pyIn) {
if (pyIn == Py_None)
return Shiboken::Conversions::nonePythonToCppNullPtr;
if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject*>(Sbk_Katie_QLatin1Char_TypeF())))
return QLatin1Char_PythonToCpp_QLatin1Char_PTR;
return {};
}
// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject* QLatin1Char_PTR_CppToPython_QLatin1Char(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 ::Katie::QLatin1Char *>(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_Katie_QLatin1Char_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 *Katie_QLatin1Char_SignatureStrings[] = {
"KtCore.Katie.QLatin1Char(c:char)",
"KtCore.Katie.QLatin1Char.toLatin1()->char",
"KtCore.Katie.QLatin1Char.unicode()->ushort",
nullptr}; // Sentinel
void init_Katie_QLatin1Char(PyObject* module)
{
_Sbk_Katie_QLatin1Char_Type = Shiboken::ObjectType::introduceWrapperType(
module,
"QLatin1Char",
"Katie::QLatin1Char*",
&Sbk_Katie_QLatin1Char_spec,
Katie_QLatin1Char_SignatureStrings,
&Shiboken::callCppDestructor< ::Katie::QLatin1Char >,
0,
0,
0 );
SbkKtCoreTypes[SBK_KATIE_QLATIN1CHAR_IDX]
= reinterpret_cast<PyTypeObject*>(Sbk_Katie_QLatin1Char_TypeF());
// Register Converter
SbkConverter* converter = Shiboken::Conversions::createConverter(Sbk_Katie_QLatin1Char_TypeF(),
QLatin1Char_PythonToCpp_QLatin1Char_PTR,
is_QLatin1Char_PythonToCpp_QLatin1Char_PTR_Convertible,
QLatin1Char_PTR_CppToPython_QLatin1Char);
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1Char");
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1Char*");
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1Char&");
Shiboken::Conversions::registerConverterName(converter, "QLatin1Char");
Shiboken::Conversions::registerConverterName(converter, "QLatin1Char*");
Shiboken::Conversions::registerConverterName(converter, "QLatin1Char&");
Shiboken::Conversions::registerConverterName(converter, typeid(::Katie::QLatin1Char).name());
}

View file

@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KATIE_QLATIN1CHAR_H
#define SBK_KATIE_QLATIN1CHAR_H
#include <qchar.h>
#endif // SBK_KATIE_QLATIN1CHAR_H

View file

@ -0,0 +1,458 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
// default includes
#include <shiboken.h>
#include <typeinfo>
// module include
#include "ktcore_python.h"
// main header
#include "katie_qlatin1string_wrapper.h"
// inner classes
// Extra includes
#include <qstring.h>
#include <cctype>
#include <cstring>
using namespace Katie;
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_Katie_QLatin1String_Init(PyObject* self, PyObject* args, PyObject* kwds)
{
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Katie::QLatin1String >()))
return -1;
::Katie::QLatin1String* cptr{};
int overloadId = -1;
PythonToCppFunc pythonToCpp[] = { nullptr };
SBK_UNUSED(pythonToCpp)
int numArgs = PyTuple_GET_SIZE(args);
SBK_UNUSED(numArgs)
PyObject* pyArgs[] = {0};
// invalid argument lengths
if (!PyArg_UnpackTuple(args, "QLatin1String", 1, 1, &(pyArgs[0])))
return -1;
// Overloaded function decisor
// 0: QLatin1String::QLatin1String(const char*)
if (numArgs == 1
&& Shiboken::String::check(pyArgs[0]) && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArgs[0])))) {
overloadId = 0; // QLatin1String(const char*)
}
// Function signature not found.
if (overloadId == -1) goto Sbk_Katie_QLatin1String_Init_TypeError;
// Call function/method
{
const char* cppArg0;
pythonToCpp[0](pyArgs[0], &cppArg0);
if (!PyErr_Occurred()) {
// QLatin1String(const char*)
PyThreadState* _save = PyEval_SaveThread(); // Py_BEGIN_ALLOW_THREADS
cptr = new ::Katie::QLatin1String(cppArg0);
PyEval_RestoreThread(_save); // Py_END_ALLOW_THREADS
}
}
if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Katie::QLatin1String >(), cptr)) {
delete cptr;
return -1;
}
if (!cptr) goto Sbk_Katie_QLatin1String_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_Katie_QLatin1String_Init_TypeError:
Shiboken::setErrorAboutWrongArguments(args, "KtCore.Katie.QLatin1String");
return -1;
}
static PyObject* Sbk_Katie_QLatin1StringFunc_latin1(PyObject* self)
{
::Katie::QLatin1String* cppSelf = nullptr;
SBK_UNUSED(cppSelf)
if (!Shiboken::Object::isValid(self))
return {};
cppSelf = reinterpret_cast< ::Katie::QLatin1String *>(Shiboken::Conversions::cppPointer(SbkKtCoreTypes[SBK_KATIE_QLATIN1STRING_IDX], reinterpret_cast<SbkObject *>(self)));
PyObject* pyResult{};
// Call function/method
{
if (!PyErr_Occurred()) {
// latin1()const
const char * cppResult = const_cast<const ::Katie::QLatin1String*>(cppSelf)->latin1();
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), cppResult);
}
}
if (PyErr_Occurred() || !pyResult) {
Py_XDECREF(pyResult);
return {};
}
return pyResult;
}
static PyMethodDef Sbk_Katie_QLatin1String_methods[] = {
{"latin1", reinterpret_cast<PyCFunction>(Sbk_Katie_QLatin1StringFunc_latin1), METH_NOARGS},
{nullptr, nullptr} // Sentinel
};
// Rich comparison
static PyObject* Sbk_Katie_QLatin1String_richcompare(PyObject* self, PyObject* pyArg, int op)
{
if (!Shiboken::Object::isValid(self))
return {};
::Katie::QLatin1String& cppSelf = *reinterpret_cast< ::Katie::QLatin1String *>(Shiboken::Conversions::cppPointer(SbkKtCoreTypes[SBK_KATIE_QLATIN1STRING_IDX], reinterpret_cast<SbkObject *>(self)));
SBK_UNUSED(cppSelf)
PyObject* pyResult{};
PythonToCppFunc pythonToCpp;
SBK_UNUSED(pythonToCpp)
switch (op) {
case Py_NE:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator!=(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf !=(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator!=(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf !=(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
pyResult = Py_True;
Py_INCREF(pyResult);
}
break;
case Py_LT:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator<(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf <(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator<(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf <(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
goto Sbk_Katie_QLatin1String_RichComparison_TypeError;
}
break;
case Py_LE:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator<=(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf <=(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator<=(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf <=(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
goto Sbk_Katie_QLatin1String_RichComparison_TypeError;
}
break;
case Py_EQ:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator==(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf ==(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator==(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf ==(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
pyResult = Py_False;
Py_INCREF(pyResult);
}
break;
case Py_GT:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator>(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf >(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator>(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf >(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
goto Sbk_Katie_QLatin1String_RichComparison_TypeError;
}
break;
case Py_GE:
if (Shiboken::String::check(pyArg) && (pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<const char*>(), (pyArg)))) {
// operator>=(const char * s) const
const char* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf >=(cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast<SbkObjectType *>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]), (pyArg)))) {
// operator>=(const Katie::QString & s) const
if (!Shiboken::Object::isValid(pyArg))
return {};
::Katie::QString* cppArg0;
pythonToCpp(pyArg, &cppArg0);
bool cppResult = cppSelf >=(*cppArg0);
pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
} else {
goto Sbk_Katie_QLatin1String_RichComparison_TypeError;
}
break;
default:
goto Sbk_Katie_QLatin1String_RichComparison_TypeError;
}
if (pyResult && !PyErr_Occurred())
return pyResult;
Sbk_Katie_QLatin1String_RichComparison_TypeError:
PyErr_SetString(PyExc_NotImplementedError, "operator not implemented.");
return {};
}
} // extern "C"
static int Sbk_Katie_QLatin1String_traverse(PyObject* self, visitproc visit, void* arg)
{
return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_traverse(self, visit, arg);
}
static int Sbk_Katie_QLatin1String_clear(PyObject* self)
{
return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static SbkObjectType *_Sbk_Katie_QLatin1String_Type = nullptr;
static SbkObjectType *Sbk_Katie_QLatin1String_TypeF(void)
{
return _Sbk_Katie_QLatin1String_Type;
}
static PyType_Slot Sbk_Katie_QLatin1String_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_Katie_QLatin1String_traverse)},
{Py_tp_clear, reinterpret_cast<void*>(Sbk_Katie_QLatin1String_clear)},
{Py_tp_richcompare, reinterpret_cast<void*>(Sbk_Katie_QLatin1String_richcompare)},
{Py_tp_iter, nullptr},
{Py_tp_iternext, nullptr},
{Py_tp_methods, reinterpret_cast<void*>(Sbk_Katie_QLatin1String_methods)},
{Py_tp_getset, nullptr},
{Py_tp_init, reinterpret_cast<void*>(Sbk_Katie_QLatin1String_Init)},
{Py_tp_new, reinterpret_cast<void*>(SbkObjectTpNew)},
{0, nullptr}
};
static PyType_Spec Sbk_Katie_QLatin1String_spec = {
"KtCore.Katie.QLatin1String",
sizeof(SbkObject),
0,
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC,
Sbk_Katie_QLatin1String_slots
};
} //extern "C"
// Type conversion functions.
// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QLatin1String_PythonToCpp_QLatin1String_PTR(PyObject* pyIn, void* cppOut) {
Shiboken::Conversions::pythonToCppPointer(Sbk_Katie_QLatin1String_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QLatin1String_PythonToCpp_QLatin1String_PTR_Convertible(PyObject* pyIn) {
if (pyIn == Py_None)
return Shiboken::Conversions::nonePythonToCppNullPtr;
if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject*>(Sbk_Katie_QLatin1String_TypeF())))
return QLatin1String_PythonToCpp_QLatin1String_PTR;
return {};
}
// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject* QLatin1String_PTR_CppToPython_QLatin1String(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 ::Katie::QLatin1String *>(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_Katie_QLatin1String_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 *Katie_QLatin1String_SignatureStrings[] = {
"KtCore.Katie.QLatin1String(s:str)",
"KtCore.Katie.QLatin1String.latin1()->str",
nullptr}; // Sentinel
void init_Katie_QLatin1String(PyObject* module)
{
_Sbk_Katie_QLatin1String_Type = Shiboken::ObjectType::introduceWrapperType(
module,
"QLatin1String",
"Katie::QLatin1String*",
&Sbk_Katie_QLatin1String_spec,
Katie_QLatin1String_SignatureStrings,
&Shiboken::callCppDestructor< ::Katie::QLatin1String >,
0,
0,
0 );
SbkKtCoreTypes[SBK_KATIE_QLATIN1STRING_IDX]
= reinterpret_cast<PyTypeObject*>(Sbk_Katie_QLatin1String_TypeF());
// Register Converter
SbkConverter* converter = Shiboken::Conversions::createConverter(Sbk_Katie_QLatin1String_TypeF(),
QLatin1String_PythonToCpp_QLatin1String_PTR,
is_QLatin1String_PythonToCpp_QLatin1String_PTR_Convertible,
QLatin1String_PTR_CppToPython_QLatin1String);
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1String");
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1String*");
Shiboken::Conversions::registerConverterName(converter, "Katie::QLatin1String&");
Shiboken::Conversions::registerConverterName(converter, "QLatin1String");
Shiboken::Conversions::registerConverterName(converter, "QLatin1String*");
Shiboken::Conversions::registerConverterName(converter, "QLatin1String&");
Shiboken::Conversions::registerConverterName(converter, typeid(::Katie::QLatin1String).name());
}

View file

@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KATIE_QLATIN1STRING_H
#define SBK_KATIE_QLATIN1STRING_H
#include <qstring.h>
#endif // SBK_KATIE_QLATIN1STRING_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,62 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_QOBJECTWRAPPER_H
#define SBK_QOBJECTWRAPPER_H
#include <qobject.h>
class QObjectWrapper : public Katie::QObject
{
public:
QObjectWrapper(Katie::QObject * parent = Q_NULLPTR);
inline void connectNotify_protected(const char * signal) { Katie::QObject::connectNotify(signal); }
void connectNotify(const char * signal) override;
inline void destroyed_protected(Katie::QObject * arg__1 = Q_NULLPTR) { Katie::QObject::destroyed(arg__1); }
inline void disconnectNotify_protected(const char * signal) { Katie::QObject::disconnectNotify(signal); }
void disconnectNotify(const char * signal) override;
inline int receivers_protected(const char * signal) const { return Katie::QObject::receivers(signal); }
inline Katie::QObject * sender_protected() const { return Katie::QObject::sender(); }
inline int senderSignalIndex_protected() const { return Katie::QObject::senderSignalIndex(); }
~QObjectWrapper();
};
#endif // SBK_QOBJECTWRAPPER_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KATIE_QSTRING_H
#define SBK_KATIE_QSTRING_H
#include <qstring.h>
#endif // SBK_KATIE_QSTRING_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,267 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SBK_KTCORE_PYTHON_H
#define SBK_KTCORE_PYTHON_H
#include <sbkpython.h>
#include <sbkconverter.h>
// Binded library includes
#include <qchar.h>
#include <qcoreapplication.h>
#include <qstring.h>
#include <qbytearray.h>
#include <qobject.h>
#include <qglobal.h>
#include <qnamespace.h>
// Conversion Includes - Primitive Types
// Conversion Includes - Container Types
#include <list>
#include <map>
#include <utility>
#include <vector>
// Type indices
enum : int {
SBK_KATIE_QBYTEARRAY_IDX = 0,
SBK_KATIE_QCHAR_IDX = 1,
SBK_KATIE_QCHAR_SPECIALCHARACTER_IDX = 7,
SBK_KATIE_QCHAR_CATEGORY_IDX = 2,
SBK_KATIE_QCHAR_DIRECTION_IDX = 5,
SBK_KATIE_QCHAR_DECOMPOSITION_IDX = 4,
SBK_KATIE_QCHAR_JOINING_IDX = 6,
SBK_KATIE_QCHAR_COMBININGCLASS_IDX = 3,
SBK_KATIE_QCHAR_UNICODEVERSION_IDX = 8,
SBK_KATIE_QCOREAPPLICATION_IDX = 9,
SBK_KATIE_QLATIN1CHAR_IDX = 10,
SBK_KATIE_QLATIN1STRING_IDX = 11,
SBK_KATIE_QOBJECT_IDX = 12,
SBK_KATIE_QSTRING_IDX = 13,
SBK_KATIE_QSTRING_SECTIONFLAG_IDX = 15,
SBK_KATIE_QSTRING_SPLITBEHAVIOR_IDX = 16,
SBK_KATIE_QSTRING_NORMALIZATIONFORM_IDX = 14,
SBK_KATIE_QTMSGTYPE_IDX = 87,
SBK_KATIE_QT_GLOBALCOLOR_IDX = 47,
SBK_KATIE_QT_KEYBOARDMODIFIER_IDX = 54,
SBK_KATIE_QT_MODIFIER_IDX = 58,
SBK_KATIE_QT_MOUSEBUTTON_IDX = 59,
SBK_KATIE_QT_ORIENTATION_IDX = 61,
SBK_KATIE_QT_FOCUSPOLICY_IDX = 42,
SBK_KATIE_QT_SORTORDER_IDX = 69,
SBK_KATIE_QT_TILERULE_IDX = 74,
SBK_KATIE_QT_ALIGNMENTFLAG_IDX = 17,
SBK_KATIE_QT_TEXTFLAG_IDX = 71,
SBK_KATIE_QT_TEXTELIDEMODE_IDX = 70,
SBK_KATIE_QT_WINDOWTYPE_IDX = 86,
SBK_KATIE_QT_WINDOWSTATE_IDX = 85,
SBK_KATIE_QT_WIDGETATTRIBUTE_IDX = 82,
SBK_KATIE_QT_APPLICATIONATTRIBUTE_IDX = 20,
SBK_KATIE_QT_IMAGECONVERSIONFLAG_IDX = 48,
SBK_KATIE_QT_BGMODE_IDX = 24,
SBK_KATIE_QT_KEY_IDX = 53,
SBK_KATIE_QT_ARROWTYPE_IDX = 21,
SBK_KATIE_QT_PENSTYLE_IDX = 64,
SBK_KATIE_QT_PENCAPSTYLE_IDX = 62,
SBK_KATIE_QT_PENJOINSTYLE_IDX = 63,
SBK_KATIE_QT_BRUSHSTYLE_IDX = 25,
SBK_KATIE_QT_SIZEMODE_IDX = 68,
SBK_KATIE_QT_UIEFFECT_IDX = 81,
SBK_KATIE_QT_CURSORSHAPE_IDX = 34,
SBK_KATIE_QT_TEXTFORMAT_IDX = 72,
SBK_KATIE_QT_ASPECTRATIOMODE_IDX = 22,
SBK_KATIE_QT_ANCHORATTRIBUTE_IDX = 18,
SBK_KATIE_QT_DOCKWIDGETAREA_IDX = 37,
SBK_KATIE_QT_DOCKWIDGETAREASIZES_IDX = 38,
SBK_KATIE_QT_TOOLBARAREA_IDX = 76,
SBK_KATIE_QT_TOOLBARAREASIZES_IDX = 77,
SBK_KATIE_QT_DATEFORMAT_IDX = 35,
SBK_KATIE_QT_TIMESPEC_IDX = 75,
SBK_KATIE_QT_DAYOFWEEK_IDX = 36,
SBK_KATIE_QT_SCROLLBARPOLICY_IDX = 65,
SBK_KATIE_QT_CASESENSITIVITY_IDX = 26,
SBK_KATIE_QT_CORNER_IDX = 32,
SBK_KATIE_QT_CONNECTIONTYPE_IDX = 29,
SBK_KATIE_QT_SHORTCUTCONTEXT_IDX = 66,
SBK_KATIE_QT_FILLRULE_IDX = 41,
SBK_KATIE_QT_MASKMODE_IDX = 56,
SBK_KATIE_QT_CLIPOPERATION_IDX = 28,
SBK_KATIE_QT_ITEMSELECTIONMODE_IDX = 52,
SBK_KATIE_QT_TRANSFORMATIONMODE_IDX = 80,
SBK_KATIE_QT_AXIS_IDX = 23,
SBK_KATIE_QT_FOCUSREASON_IDX = 43,
SBK_KATIE_QT_CONTEXTMENUPOLICY_IDX = 30,
SBK_KATIE_QT_TOOLBUTTONSTYLE_IDX = 78,
SBK_KATIE_QT_LAYOUTDIRECTION_IDX = 55,
SBK_KATIE_QT_ANCHORPOINT_IDX = 19,
SBK_KATIE_QT_DROPACTION_IDX = 39,
SBK_KATIE_QT_CHECKSTATE_IDX = 27,
SBK_KATIE_QT_ITEMDATAROLE_IDX = 50,
SBK_KATIE_QT_ITEMFLAG_IDX = 51,
SBK_KATIE_QT_MATCHFLAG_IDX = 57,
SBK_KATIE_QT_WINDOWMODALITY_IDX = 84,
SBK_KATIE_QT_TEXTINTERACTIONFLAG_IDX = 73,
SBK_KATIE_QT_EVENTPRIORITY_IDX = 40,
SBK_KATIE_QT_SIZEHINT_IDX = 67,
SBK_KATIE_QT_WINDOWFRAMESECTION_IDX = 83,
SBK_KATIE_QT_INITIALIZATION_IDX = 49,
SBK_KATIE_QT_COORDINATESYSTEM_IDX = 31,
SBK_KATIE_QT_TOUCHPOINTSTATE_IDX = 79,
SBK_KATIE_QT_GESTURESTATE_IDX = 45,
SBK_KATIE_QT_GESTURETYPE_IDX = 46,
SBK_KATIE_QT_GESTUREFLAG_IDX = 44,
SBK_KATIE_QT_NAVIGATIONMODE_IDX = 60,
SBK_KATIE_QT_CURSORMOVESTYLE_IDX = 33,
SBK_KtCore_IDX_COUNT = 88
};
// This variable stores all Python types exported by this module.
extern PyTypeObject** SbkKtCoreTypes;
// This variable stores the Python module object exported by this module.
extern PyObject* SbkKtCoreModuleObject;
// This variable stores all type converters exported by this module.
extern SbkConverter** SbkKtCoreTypeConverters;
// Converter indices
enum : int {
SBK_KtCore_CONVERTERS_IDX_COUNT = 1
};
// Macros for type check
namespace Shiboken
{
// PyType functions, to get the PyObjectType for a type T
template<> inline PyTypeObject* SbkType< ::Katie::QtMsgType >() { return SbkKtCoreTypes[SBK_KATIE_QTMSGTYPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::GlobalColor >() { return SbkKtCoreTypes[SBK_KATIE_QT_GLOBALCOLOR_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::KeyboardModifier >() { return SbkKtCoreTypes[SBK_KATIE_QT_KEYBOARDMODIFIER_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Modifier >() { return SbkKtCoreTypes[SBK_KATIE_QT_MODIFIER_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::MouseButton >() { return SbkKtCoreTypes[SBK_KATIE_QT_MOUSEBUTTON_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Orientation >() { return SbkKtCoreTypes[SBK_KATIE_QT_ORIENTATION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::FocusPolicy >() { return SbkKtCoreTypes[SBK_KATIE_QT_FOCUSPOLICY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::SortOrder >() { return SbkKtCoreTypes[SBK_KATIE_QT_SORTORDER_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TileRule >() { return SbkKtCoreTypes[SBK_KATIE_QT_TILERULE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::AlignmentFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_ALIGNMENTFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TextFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_TEXTFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TextElideMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_TEXTELIDEMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::WindowType >() { return SbkKtCoreTypes[SBK_KATIE_QT_WINDOWTYPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::WindowState >() { return SbkKtCoreTypes[SBK_KATIE_QT_WINDOWSTATE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::WidgetAttribute >() { return SbkKtCoreTypes[SBK_KATIE_QT_WIDGETATTRIBUTE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ApplicationAttribute >() { return SbkKtCoreTypes[SBK_KATIE_QT_APPLICATIONATTRIBUTE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ImageConversionFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_IMAGECONVERSIONFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::BGMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_BGMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Key >() { return SbkKtCoreTypes[SBK_KATIE_QT_KEY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ArrowType >() { return SbkKtCoreTypes[SBK_KATIE_QT_ARROWTYPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::PenStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_PENSTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::PenCapStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_PENCAPSTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::PenJoinStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_PENJOINSTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::BrushStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_BRUSHSTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::SizeMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_SIZEMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::UIEffect >() { return SbkKtCoreTypes[SBK_KATIE_QT_UIEFFECT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::CursorShape >() { return SbkKtCoreTypes[SBK_KATIE_QT_CURSORSHAPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TextFormat >() { return SbkKtCoreTypes[SBK_KATIE_QT_TEXTFORMAT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::AspectRatioMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_ASPECTRATIOMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::AnchorAttribute >() { return SbkKtCoreTypes[SBK_KATIE_QT_ANCHORATTRIBUTE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::DockWidgetArea >() { return SbkKtCoreTypes[SBK_KATIE_QT_DOCKWIDGETAREA_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::DockWidgetAreaSizes >() { return SbkKtCoreTypes[SBK_KATIE_QT_DOCKWIDGETAREASIZES_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ToolBarArea >() { return SbkKtCoreTypes[SBK_KATIE_QT_TOOLBARAREA_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ToolBarAreaSizes >() { return SbkKtCoreTypes[SBK_KATIE_QT_TOOLBARAREASIZES_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::DateFormat >() { return SbkKtCoreTypes[SBK_KATIE_QT_DATEFORMAT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TimeSpec >() { return SbkKtCoreTypes[SBK_KATIE_QT_TIMESPEC_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::DayOfWeek >() { return SbkKtCoreTypes[SBK_KATIE_QT_DAYOFWEEK_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ScrollBarPolicy >() { return SbkKtCoreTypes[SBK_KATIE_QT_SCROLLBARPOLICY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::CaseSensitivity >() { return SbkKtCoreTypes[SBK_KATIE_QT_CASESENSITIVITY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Corner >() { return SbkKtCoreTypes[SBK_KATIE_QT_CORNER_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ConnectionType >() { return SbkKtCoreTypes[SBK_KATIE_QT_CONNECTIONTYPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ShortcutContext >() { return SbkKtCoreTypes[SBK_KATIE_QT_SHORTCUTCONTEXT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::FillRule >() { return SbkKtCoreTypes[SBK_KATIE_QT_FILLRULE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::MaskMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_MASKMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ClipOperation >() { return SbkKtCoreTypes[SBK_KATIE_QT_CLIPOPERATION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ItemSelectionMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_ITEMSELECTIONMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TransformationMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_TRANSFORMATIONMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Axis >() { return SbkKtCoreTypes[SBK_KATIE_QT_AXIS_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::FocusReason >() { return SbkKtCoreTypes[SBK_KATIE_QT_FOCUSREASON_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ContextMenuPolicy >() { return SbkKtCoreTypes[SBK_KATIE_QT_CONTEXTMENUPOLICY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ToolButtonStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_TOOLBUTTONSTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::LayoutDirection >() { return SbkKtCoreTypes[SBK_KATIE_QT_LAYOUTDIRECTION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::AnchorPoint >() { return SbkKtCoreTypes[SBK_KATIE_QT_ANCHORPOINT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::DropAction >() { return SbkKtCoreTypes[SBK_KATIE_QT_DROPACTION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::CheckState >() { return SbkKtCoreTypes[SBK_KATIE_QT_CHECKSTATE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ItemDataRole >() { return SbkKtCoreTypes[SBK_KATIE_QT_ITEMDATAROLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::ItemFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_ITEMFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::MatchFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_MATCHFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::WindowModality >() { return SbkKtCoreTypes[SBK_KATIE_QT_WINDOWMODALITY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TextInteractionFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_TEXTINTERACTIONFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::EventPriority >() { return SbkKtCoreTypes[SBK_KATIE_QT_EVENTPRIORITY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::SizeHint >() { return SbkKtCoreTypes[SBK_KATIE_QT_SIZEHINT_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::WindowFrameSection >() { return SbkKtCoreTypes[SBK_KATIE_QT_WINDOWFRAMESECTION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::Initialization >() { return SbkKtCoreTypes[SBK_KATIE_QT_INITIALIZATION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::CoordinateSystem >() { return SbkKtCoreTypes[SBK_KATIE_QT_COORDINATESYSTEM_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::TouchPointState >() { return SbkKtCoreTypes[SBK_KATIE_QT_TOUCHPOINTSTATE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::GestureState >() { return SbkKtCoreTypes[SBK_KATIE_QT_GESTURESTATE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::GestureType >() { return SbkKtCoreTypes[SBK_KATIE_QT_GESTURETYPE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::GestureFlag >() { return SbkKtCoreTypes[SBK_KATIE_QT_GESTUREFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::NavigationMode >() { return SbkKtCoreTypes[SBK_KATIE_QT_NAVIGATIONMODE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::Qt::CursorMoveStyle >() { return SbkKtCoreTypes[SBK_KATIE_QT_CURSORMOVESTYLE_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QByteArray >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QBYTEARRAY_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::SpecialCharacter >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_SPECIALCHARACTER_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::Category >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_CATEGORY_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::Direction >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_DIRECTION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::Decomposition >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_DECOMPOSITION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::Joining >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_JOINING_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::CombiningClass >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_COMBININGCLASS_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar::UnicodeVersion >() { return SbkKtCoreTypes[SBK_KATIE_QCHAR_UNICODEVERSION_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QChar >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QCHAR_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QCoreApplication >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QCOREAPPLICATION_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QLatin1Char >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QLATIN1CHAR_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QLatin1String >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QLATIN1STRING_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QObject >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QOBJECT_IDX]); }
template<> inline PyTypeObject* SbkType< ::Katie::QString::SectionFlag >() { return SbkKtCoreTypes[SBK_KATIE_QSTRING_SECTIONFLAG_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QString::SplitBehavior >() { return SbkKtCoreTypes[SBK_KATIE_QSTRING_SPLITBEHAVIOR_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QString::NormalizationForm >() { return SbkKtCoreTypes[SBK_KATIE_QSTRING_NORMALIZATIONFORM_IDX]; }
template<> inline PyTypeObject* SbkType< ::Katie::QString >() { return reinterpret_cast<PyTypeObject*>(SbkKtCoreTypes[SBK_KATIE_QSTRING_IDX]); }
} // namespace Shiboken
#endif // SBK_KTCORE_PYTHON_H

View file

@ -0,0 +1,8 @@
#ifndef PYKTCORE_GLOBAL_H
#define PYKTCORE_GLOBAL_H
#include <shiboken2/shiboken.h>
#include <QtCore/QtCore>
#endif // PYKTCORE_GLOBAL_H

View file

@ -1,68 +0,0 @@
%module KtGui
%include "tricks.i"
// for reference to Core base classes
%include "KtCore.i"
%include "gui/qfontinfo.i"
%include "gui/qfontmetrics.i"
%include "gui/qwidget.i"
%{
#include "QtGui/QApplication"
#include "QtGui/QPaintDevice"
#include "QtGui/QMainWindow"
#include "QtGui/QMatrix"
#include "QtGui/QTransform"
#include "QtGui/QTextFormat"
#include "QtGui/QTextLength"
QT_USE_NAMESPACE
%}
// temporary implementations for testing purposes
class QApplication : public QCoreApplication {
public:
QApplication(int argc, char *argv[]);
~QApplication();
static int exec();
};
class QPaintDevice {
public:
virtual ~QPaintDevice();
protected:
QPaintDevice();
};
class QMainWindow : public QWidget {
public:
QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
~QMainWindow();
};
// stub implementations for QVariant testing
class QMatrix {
public:
QMatrix();
~QMatrix();
};
class QTransform {
public:
QTransform();
~QTransform();
};
class QTextFormat {
public:
QTextFormat();
~QTextFormat();
};
class QTextLength {
public:
QTextLength();
~QTextLength();
};

View file

@ -1,2 +0,0 @@
- container iterators not implemented
- reference classes not implemented (e.g. QStringRef)

View file

@ -1,5 +0,0 @@
- QObject is probably not working as intended
- QVariant is almost not working because it's template and function magic
- QList, QSet and QVector template for types that are not implemented yet
- properties, slots, signals, etc.
- QCoreApplication/QApplication with argc/argv crash?

View file

@ -1,232 +0,0 @@
%{
#include "QtCore/qbytearray.h"
QT_USE_NAMESPACE
%}
char *qstrdup(const char *);
uint qstrlen(const char *str);
uint qstrnlen(const char *str, uint maxlen);
char *qstrcpy(char *dst, const char *src);
char *qstrncpy(char *dst, const char *src, uint len);
int qstrcmp(const char *str1, const char *str2);
int qstrcmp(const QByteArray &str1, const QByteArray &str2);
int qstrcmp(const QByteArray &str1, const char *str2);
static int qstrcmp(const char *str1, const QByteArray &str2);
int qstrncmp(const char *str1, const char *str2, uint len);
int qstricmp(const char *, const char *);
int qstrnicmp(const char *, const char *, uint len);
// implemented in qvsnprintf.cpp
int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap);
int qsnprintf(char *str, size_t n, const char *fmt, ...);
// qChecksum: Internet checksum
quint16 qChecksum(const char *s, uint len);
class QByteArray
{
public:
QByteArray();
QByteArray(const char *);
QByteArray(const char *, int size);
QByteArray(int size, char c);
QByteArray(int size, Qt::Initialization);
QByteArray(const QByteArray &);
~QByteArray();
QByteArray &operator=(const QByteArray &);
QByteArray &operator=(const char *str);
#ifdef Q_COMPILER_RVALUE_REFS
QByteArray &operator=(QByteArray &&other);
#endif
void swap(QByteArray &other);
int size() const;
bool isEmpty() const;
void resize(int size);
QByteArray &fill(char c, int size = -1);
int capacity() const;
void reserve(int size);
void squeeze();
#ifndef QT_NO_CAST_FROM_BYTEARRAY
operator const char *() const;
#endif
char *data();
const char *data() const;
const char *constData() const;
void detach();
bool isDetached() const;
bool isSharedWith(const QByteArray &other) const;
void clear();
char at(int i) const;
char operator[](int i) const;
char operator[](uint i) const;
QByteRef operator[](int i);
QByteRef operator[](uint i);
int indexOf(char c, int from = 0) const;
int indexOf(const char *c, const int from = 0) const;
int indexOf(const QByteArray &a, const int from = 0) const;
int lastIndexOf(char c, const int from = -1) const;
int lastIndexOf(const char *c, const int from = -1) const;
int lastIndexOf(const QByteArray &a, const int from = -1) const;
bool contains(char c) const;
bool contains(const char *a) const;
bool contains(const QByteArray &a) const;
int count(char c) const;
int count(const char *a) const;
int count(const QByteArray &a) const;
QByteArray left(int len) const;
QByteArray right(int len) const;
QByteArray mid(int index, int len = -1) const;
bool startsWith(const QByteArray &a) const;
bool startsWith(char c) const;
bool startsWith(const char *c) const;
bool endsWith(const QByteArray &a) const;
bool endsWith(char c) const;
bool endsWith(const char *c) const;
void truncate(int pos);
void chop(int n);
QByteArray toLower() const;
QByteArray toUpper() const;
QByteArray trimmed() const;
QByteArray simplified() const;
QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
QByteArray &prepend(char c);
QByteArray &prepend(const char *s);
QByteArray &prepend(const char *s, int len);
QByteArray &prepend(const QByteArray &a);
QByteArray &append(char c);
QByteArray &append(const char *s);
QByteArray &append(const char *s, int len);
QByteArray &append(const QByteArray &a);
QByteArray &insert(int i, char c);
QByteArray &insert(int i, const char *s);
QByteArray &insert(int i, const char *s, int len);
QByteArray &insert(int i, const QByteArray &a);
QByteArray &remove(int index, int len);
QByteArray &replace(int index, int len, const char *s);
QByteArray &replace(int index, int len, const char *s, int alen);
QByteArray &replace(int index, int len, const QByteArray &s);
QByteArray &replace(char before, const char *after);
QByteArray &replace(char before, const QByteArray &after);
QByteArray &replace(const char *before, const char *after);
QByteArray &replace(const char *before, int bsize, const char *after, int asize);
QByteArray &replace(const QByteArray &before, const QByteArray &after);
QByteArray &replace(const QByteArray &before, const char *after);
QByteArray &replace(const char *before, const QByteArray &after);
QByteArray &replace(char before, char after);
QByteArray &operator+=(char c);
QByteArray &operator+=(const char *s);
QByteArray &operator+=(const QByteArray &a);
QList<QByteArray> split(char sep) const;
QByteArray repeated(const int times) const;
#ifndef QT_NO_CAST_TO_ASCII
QByteArray &append(const QString &s);
QByteArray &insert(const int i, const QString &s);
QByteArray &replace(const QString &before, const char *after);
QByteArray &replace(char c, const QString &after);
QByteArray &replace(const QString &before, const QByteArray &after);
QByteArray &operator+=(const QString &s);
int indexOf(const QString &s, const int from = 0) const;
int lastIndexOf(const QString &s, int const from = -1) const;
#endif
#ifndef QT_NO_CAST_FROM_ASCII
bool operator==(const QString &s2) const;
bool operator!=(const QString &s2) const;
bool operator<(const QString &s2) const;
bool operator>(const QString &s2) const;
bool operator<=(const QString &s2) const;
bool operator>=(const QString &s2) const;
#endif
short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
float toFloat(bool *ok = Q_NULLPTR) const;
double toDouble(bool *ok = Q_NULLPTR) const;
QByteArray toBase64() const;
QByteArray toHex() const;
QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(),
const QByteArray &include = QByteArray(),
char percent = '%') const;
QByteArray &setNum(short, int base = 10);
QByteArray &setNum(ushort, int base = 10);
QByteArray &setNum(int, int base = 10);
QByteArray &setNum(uint, int base = 10);
QByteArray &setNum(qlonglong, int base = 10);
QByteArray &setNum(qulonglong, int base = 10);
QByteArray &setNum(float, char f = 'g', int prec = 6);
QByteArray &setNum(double, char f = 'g', int prec = 6);
QByteArray &setRawData(const char *a, uint n); // ### Qt 5: use an int
static QByteArray number(int, int base = 10);
static QByteArray number(uint, int base = 10);
static QByteArray number(qlonglong, int base = 10);
static QByteArray number(qulonglong, int base = 10);
static QByteArray number(double, char f = 'g', int prec = 6);
static QByteArray fromRawData(const char *, int size);
static QByteArray fromBase64(const QByteArray &base64);
static QByteArray fromHex(const QByteArray &hexEncoded);
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
// stl compatibility
void push_back(char c);
void push_back(const char *c);
void push_back(const QByteArray &a);
void push_front(char c);
void push_front(const char *c);
void push_front(const QByteArray &a);
static QByteArray fromStdString(const std::string &s);
std::string toStdString() const;
int count() const;
int length() const;
bool isNull() const;
public:
typedef Data * DataPtr;
DataPtr &data_ptr();
};
#if !defined(QT_NO_DATASTREAM)
QDataStream &operator<<(QDataStream &, const QByteArray &);
QDataStream &operator>>(QDataStream &, QByteArray &);
#endif
#ifndef QT_NO_COMPRESS
QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1);
QByteArray qUncompress(const uchar* data, int nbytes);
QByteArray qCompress(const QByteArray& data, int compressionLevel = -1);
QByteArray qUncompress(const QByteArray& data);
#endif

View file

@ -1,255 +0,0 @@
%{
#include "QtCore/qchar.h"
QT_USE_NAMESPACE
%}
class QLatin1Char
{
public:
QLatin1Char(const char c);
char toLatin1() const;
ushort unicode() const;
};
class QChar {
public:
QChar();
#ifndef QT_NO_CAST_FROM_ASCII
QChar(const char c);
QChar(const uchar c);
#endif
QChar(const QLatin1Char ch);
QChar(const uchar c, uchar r);
QChar(const ushort rc);
QChar(const short rc);
QChar(const uint rc);
QChar(const int rc);
enum SpecialCharacter {
Null = 0x0000,
Nbsp = 0x00a0,
ReplacementCharacter = 0xfffd,
ObjectReplacementCharacter = 0xfffc,
ByteOrderMark = 0xfeff,
ByteOrderSwapped = 0xfffe,
ParagraphSeparator = 0x2029,
LineSeparator = 0x2028
};
QChar(const SpecialCharacter sc);
// Unicode information
enum Category
{
NoCategory, // ### Qt 5: replace with Other_NotAssigned
Mark_NonSpacing, // Mn
Mark_SpacingCombining, // Mc
Mark_Enclosing, // Me
Number_DecimalDigit, // Nd
Number_Letter, // Nl
Number_Other, // No
Separator_Space, // Zs
Separator_Line, // Zl
Separator_Paragraph, // Zp
Other_Control, // Cc
Other_Format, // Cf
Other_Surrogate, // Cs
Other_PrivateUse, // Co
Other_NotAssigned, // Cn
Letter_Uppercase, // Lu
Letter_Lowercase, // Ll
Letter_Titlecase, // Lt
Letter_Modifier, // Lm
Letter_Other, // Lo
Punctuation_Connector, // Pc
Punctuation_Dash, // Pd
Punctuation_Open, // Ps
Punctuation_Close, // Pe
Punctuation_InitialQuote, // Pi
Punctuation_FinalQuote, // Pf
Punctuation_Other, // Po
Symbol_Math, // Sm
Symbol_Currency, // Sc
Symbol_Modifier, // Sk
Symbol_Other // So
};
enum Direction
{
DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
};
enum Decomposition
{
NoDecomposition,
Canonical,
Font,
NoBreak,
Initial,
Medial,
Final,
Isolated,
Circle,
Super,
Sub,
Vertical,
Wide,
Narrow,
Small,
Square,
Compat,
Fraction
};
enum Joining
{
OtherJoining, Dual, Right, Center
};
enum CombiningClass
{
Combining_BelowLeftAttached = 200,
Combining_BelowAttached = 202,
Combining_BelowRightAttached = 204,
Combining_LeftAttached = 208,
Combining_RightAttached = 210,
Combining_AboveLeftAttached = 212,
Combining_AboveAttached = 214,
Combining_AboveRightAttached = 216,
Combining_BelowLeft = 218,
Combining_Below = 220,
Combining_BelowRight = 222,
Combining_Left = 224,
Combining_Right = 226,
Combining_AboveLeft = 228,
Combining_Above = 230,
Combining_AboveRight = 232,
Combining_DoubleBelow = 233,
Combining_DoubleAbove = 234,
Combining_IotaSubscript = 240
};
enum UnicodeVersion {
Unicode_Unassigned, // ### Qt 5: assign with some constantly big value
Unicode_1_1,
Unicode_2_0,
Unicode_2_1_2,
Unicode_3_0,
Unicode_3_1,
Unicode_3_2,
Unicode_4_0,
Unicode_4_1,
Unicode_5_0
};
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
Category category() const;
Direction direction() const;
Joining joining() const;
bool hasMirrored() const;
unsigned char combiningClass() const;
QChar mirroredChar() const;
QString decomposition() const;
Decomposition decompositionTag() const;
int digitValue() const;
QChar toLower() const;
QChar toUpper() const;
QChar toTitleCase() const;
QChar toCaseFolded() const;
UnicodeVersion unicodeVersion() const;
char toAscii() const;
char toLatin1() const;
ushort unicode() const;
ushort &unicode();
static QChar fromAscii(const char c);
static QChar fromLatin1(const char c);
bool isNull() const;
bool isPrint() const;
bool isPunct() const;
bool isSpace() const;
bool isMark() const;
bool isLetter() const;
bool isNumber() const;
bool isLetterOrNumber() const;
bool isDigit() const;
bool isSymbol() const;
bool isLower() const;
bool isUpper() const;
bool isTitleCase() const;
bool isHighSurrogate() const;
bool isLowSurrogate() const;
uchar cell() const;
uchar row() const;
void setCell(uchar cell);
void setRow(uchar row);
static bool isHighSurrogate(uint ucs4);
static bool isLowSurrogate(uint ucs4);
static bool requiresSurrogates(uint ucs4);
static uint surrogateToUcs4(ushort high, ushort low);
static uint surrogateToUcs4(QChar high, QChar low);
static ushort highSurrogate(uint ucs4);
static ushort lowSurrogate(uint ucs4);
static Category QT_FASTCALL category(const uint ucs4);
static Category QT_FASTCALL category(const ushort ucs2);
static Direction QT_FASTCALL direction(const uint ucs4);
static Direction QT_FASTCALL direction(const ushort ucs2);
static Joining QT_FASTCALL joining(const uint ucs4);
static Joining QT_FASTCALL joining(const ushort ucs2);
static unsigned char QT_FASTCALL combiningClass(const uint ucs4);
static unsigned char QT_FASTCALL combiningClass(const ushort ucs2);
static uint QT_FASTCALL mirroredChar(const uint ucs4);
static ushort QT_FASTCALL mirroredChar(const ushort ucs2);
static Decomposition QT_FASTCALL decompositionTag(const uint ucs4);
static int QT_FASTCALL digitValue(const uint ucs4);
static int QT_FASTCALL digitValue(const ushort ucs2);
static uint QT_FASTCALL toLower(const uint ucs4);
static ushort QT_FASTCALL toLower(const ushort ucs2);
static uint QT_FASTCALL toUpper(const uint ucs4);
static ushort QT_FASTCALL toUpper(const ushort ucs2);
static uint QT_FASTCALL toTitleCase(const uint ucs4);
static ushort QT_FASTCALL toTitleCase(const ushort ucs2);
static uint QT_FASTCALL toCaseFolded(const uint ucs4);
static ushort QT_FASTCALL toCaseFolded(const ushort ucs2);
static UnicodeVersion QT_FASTCALL unicodeVersion(const uint ucs4);
static UnicodeVersion QT_FASTCALL unicodeVersion(const ushort ucs2);
static UnicodeVersion QT_FASTCALL currentUnicodeVersion();
static QString QT_FASTCALL decomposition(uint ucs4);
private:
#ifdef QT_NO_CAST_FROM_ASCII
QChar(const char c);
QChar(const uchar c);
#endif
};
#ifndef QT_NO_DATASTREAM
QDataStream &operator<<(QDataStream &, const QChar &);
QDataStream &operator>>(QDataStream &, QChar &);
#endif

View file

@ -1,110 +0,0 @@
%{
#include "QtCore/qcoreapplication.h"
QT_USE_NAMESPACE
%}
class QCoreApplication : public QObject
{
Q_OBJECT
Q_PROPERTY(QString applicationName READ applicationName WRITE setApplicationName)
Q_PROPERTY(QString applicationVersion READ applicationVersion WRITE setApplicationVersion)
Q_PROPERTY(QString organizationName READ organizationName WRITE setOrganizationName)
Q_PROPERTY(QString organizationDomain READ organizationDomain WRITE setOrganizationDomain)
public:
QCoreApplication(int &argc, char **argv);
~QCoreApplication();
static QStringList arguments();
static void setAttribute(Qt::ApplicationAttribute attribute, bool on = true);
static bool testAttribute(Qt::ApplicationAttribute attribute);
static void setOrganizationDomain(const QString &orgDomain);
static QString organizationDomain();
static void setOrganizationName(const QString &orgName);
static QString organizationName();
static void setApplicationName(const QString &application);
static QString applicationName();
static void setApplicationVersion(const QString &version);
static QString applicationVersion();
static QCoreApplication *instance();
static int exec();
static void processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents);
static void processEvents(QEventLoop::ProcessEventsFlags flags, int maxtime);
static void exit(int retcode=0);
static bool sendEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event, int priority);
static void sendPostedEvents(QObject *receiver, int event_type);
static void sendPostedEvents();
static void removePostedEvents(QObject *receiver);
static void removePostedEvents(QObject *receiver, int eventType);
static bool hasPendingEvents();
virtual bool notify(QObject *, QEvent *);
static bool startingUp();
static bool closingDown();
static QString applicationDirPath();
static QString applicationFilePath();
static qint64 applicationPid();
#ifndef QT_NO_LIBRARY
static void setLibraryPaths(const QStringList &);
static QStringList libraryPaths();
static void addLibraryPath(const QString &);
static void removeLibraryPath(const QString &);
#endif // QT_NO_LIBRARY
#ifndef QT_NO_TRANSLATION
static void installTranslator(QTranslator * messageFile);
static void removeTranslator(QTranslator * messageFile);
#endif
enum Encoding { CodecForTr, UnicodeUTF8, DefaultCodec = CodecForTr };
static QString translate(const char * context,
const char * sourceText,
const char * disambiguation = Q_NULLPTR,
Encoding encoding = CodecForTr,
int n = -1);
static void flush();
#if defined(Q_OS_UNIX)
static void watchUnixSignal(int signal, bool watch);
#endif
typedef bool (*EventFilter)(void *message, long *result);
EventFilter setEventFilter(EventFilter filter);
bool filterEvent(void *message, long *result);
public Q_SLOTS:
static void quit();
Q_SIGNALS:
void aboutToQuit();
void unixSignal(int);
protected:
bool event(QEvent *);
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
QCoreApplication(QCoreApplicationPrivate &p);
};
#ifdef QT_NO_TRANSLATION
// Simple versions
QString QCoreApplication::translate(const char *, const char *sourceText,
const char *, Encoding encoding = CodecForTr, int = -1);
#endif
typedef void (*QtCleanUpFunction)();
void qAddPostRoutine(QtCleanUpFunction);
void qRemovePostRoutine(QtCleanUpFunction);

View file

@ -1,60 +0,0 @@
%{
#include "QtCore/qeasingcurve.h"
QT_USE_NAMESPACE
%}
class QEasingCurve
{
Q_GADGET
Q_ENUMS(Type)
public:
enum Type {
Linear,
InQuad, OutQuad, InOutQuad, OutInQuad,
InCubic, OutCubic, InOutCubic, OutInCubic,
InQuart, OutQuart, InOutQuart, OutInQuart,
InQuint, OutQuint, InOutQuint, OutInQuint,
InSine, OutSine, InOutSine, OutInSine,
InExpo, OutExpo, InOutExpo, OutInExpo,
InCirc, OutCirc, InOutCirc, OutInCirc,
InElastic, OutElastic, InOutElastic, OutInElastic,
InBack, OutBack, InOutBack, OutInBack,
InBounce, OutBounce, InOutBounce, OutInBounce,
InCurve, OutCurve, SineCurve, CosineCurve,
Custom, NCurveTypes
};
QEasingCurve(Type type = Linear);
QEasingCurve(const QEasingCurve &other);
~QEasingCurve();
QEasingCurve &operator=(const QEasingCurve &other);
bool operator==(const QEasingCurve &other) const;
bool operator!=(const QEasingCurve &other) const;
qreal amplitude() const;
void setAmplitude(qreal amplitude);
qreal period() const;
void setPeriod(qreal period);
qreal overshoot() const;
void setOvershoot(qreal overshoot);
Type type() const;
void setType(Type type);
typedef qreal (*EasingFunction)(qreal progress);
void setCustomType(EasingFunction func);
EasingFunction customType() const;
qreal valueForProgress(qreal progress) const;
};
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QEasingCurve &item);
#endif
#ifndef QT_NO_DATASTREAM
QDataStream &operator<<(QDataStream &, const QEasingCurve&);
QDataStream &operator>>(QDataStream &, QEasingCurve &);
#endif

View file

@ -1,52 +0,0 @@
%{
#include "QtCore/qjsonarray.h"
QT_USE_NAMESPACE
%}
class QJsonArray
{
public:
QJsonArray();
~QJsonArray();
QJsonArray(const QJsonArray &other);
QJsonArray &operator =(const QJsonArray &other);
static QJsonArray fromStringList(const QStringList &list);
static QJsonArray fromVariantList(const QVariantList &list);
QVariantList toVariantList() const;
int size() const;
int count() const;
bool isEmpty() const;
QJsonValue at(int i) const;
QJsonValue first() const;
QJsonValue last() const;
void prepend(const QJsonValue &value);
void append(const QJsonValue &value);
void removeAt(int i);
QJsonValue takeAt(int i);
void removeFirst();
void removeLast();
void insert(int i, const QJsonValue &value);
void replace(int i, const QJsonValue &value);
bool contains(const QJsonValue &element) const;
QJsonValueRef operator[](int i);
QJsonValue operator[](int i) const;
bool operator==(const QJsonArray &other) const;
bool operator!=(const QJsonArray &other) const;
// stl compatibility
void push_back(const QJsonValue &t);
void push_front(const QJsonValue &t);
void pop_front();
void pop_back();
bool empty();
};
QDebug operator<<(QDebug, const QJsonArray &);

View file

@ -1,81 +0,0 @@
%{
#include "QtCore/qjsondocument.h"
QT_USE_NAMESPACE
%}
struct QJsonParseError {
enum ParseError {
NoError = 0,
UnterminatedObject,
MissingNameSeparator,
UnterminatedArray,
MissingValueSeparator,
IllegalValue,
TerminationByNumber,
IllegalNumber,
IllegalEscapeSequence,
IllegalUTF8String,
UnterminatedString,
MissingObject,
DeepNesting,
DocumentTooLarge
};
QString errorString() const;
int offset;
ParseError error;
};
class QJsonDocument
{
public:
QJsonDocument();
QJsonDocument(const QJsonObject &object);
QJsonDocument(const QJsonArray &array);
~QJsonDocument();
QJsonDocument(const QJsonDocument &other);
QJsonDocument &operator =(const QJsonDocument &other);
enum DataValidation {
Validate,
BypassValidation
};
static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate);
const char *rawData(int *size) const;
static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate);
QByteArray toBinaryData() const;
static QJsonDocument fromVariant(const QVariant &variant);
QVariant toVariant() const;
enum JsonFormat {
Indented,
Compact
};
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
QByteArray toJson(JsonFormat format = Indented) const;
bool isEmpty() const;
bool isArray() const;
bool isObject() const;
QJsonObject object() const;
QJsonArray array() const;
void setObject(const QJsonObject &object);
void setArray(const QJsonArray &array);
bool operator==(const QJsonDocument &other) const;
bool operator!=(const QJsonDocument &other) const;
bool isNull() const;
};
QDebug operator<<(QDebug, const QJsonDocument &);

View file

@ -1,41 +0,0 @@
%{
#include "QtCore/qjsonobject.h"
QT_USE_NAMESPACE
%}
class QJsonObject
{
public:
QJsonObject();
~QJsonObject();
QJsonObject(const QJsonObject &other);
QJsonObject &operator =(const QJsonObject &other);
static QJsonObject fromVariantMap(const QVariantMap &map);
QVariantMap toVariantMap() const;
static QJsonObject fromVariantHash(const QVariantHash &map);
QVariantHash toVariantHash() const;
QStringList keys() const;
int size() const;
int count() const;
int length() const;
bool isEmpty() const;
QJsonValue value(const QString &key) const;
QJsonValue operator[] (const QString &key) const;
QJsonValueRef operator[] (const QString &key);
void remove(const QString &key);
QJsonValue take(const QString &key);
bool contains(const QString &key) const;
bool operator==(const QJsonObject &other) const;
bool operator!=(const QJsonObject &other) const;
// STL compatibility
bool empty() const;
};
QDebug operator<<(QDebug, const QJsonObject &);

View file

@ -1,91 +0,0 @@
%{
#include "QtCore/qjsonvalue.h"
QT_USE_NAMESPACE
%}
class QJsonValue
{
public:
enum Type {
Null = 0x0,
Bool = 0x1,
Double = 0x2,
String = 0x3,
Array = 0x4,
Object = 0x5,
Undefined = 0x80
};
QJsonValue(Type = Null);
QJsonValue(bool b);
QJsonValue(double n);
QJsonValue(int n);
QJsonValue(qint64 n);
QJsonValue(const QString &s);
QJsonValue(QLatin1String s);
QJsonValue(const QJsonArray &a);
QJsonValue(const QJsonObject &o);
~QJsonValue();
QJsonValue(const QJsonValue &other);
QJsonValue &operator =(const QJsonValue &other);
static QJsonValue fromVariant(const QVariant &variant);
QVariant toVariant() const;
Type type() const;
bool isNull() const;
bool isBool() const;
bool isDouble() const;
bool isString() const;
bool isArray() const;
bool isObject() const;
bool isUndefined() const;
bool toBool(bool defaultValue = false) const;
int toInt(int defaultValue = 0) const;
double toDouble(double defaultValue = 0) const;
QString toString(const QString &defaultValue = QString()) const;
QJsonArray toArray() const;
QJsonArray toArray(const QJsonArray &defaultValue) const;
QJsonObject toObject() const;
QJsonObject toObject(const QJsonObject &defaultValue) const;
bool operator==(const QJsonValue &other) const;
bool operator!=(const QJsonValue &other) const;
};
class QJsonValueRef
{
public:
QJsonValueRef(QJsonArray *array, int idx);
QJsonValueRef(QJsonObject *object, int idx);
operator QJsonValue() const;
QJsonValueRef &operator = (const QJsonValue &val);
QJsonValueRef &operator = (const QJsonValueRef &val);
QJsonValue::Type type() const;
bool isNull() const;
bool isBool() const;
bool isDouble() const;
bool isString() const;
bool isArray() const;
bool isObject() const;
bool isUndefined() const;
bool toBool() const;
int toInt() const;
double toDouble() const;
QString toString() const;
QJsonArray toArray() const;
QJsonObject toObject() const;
bool operator==(const QJsonValue &other) const;
bool operator!=(const QJsonValue &other) const;
};
// QJsonValueRefPtr and QJsonValuePtr not implemented
QDebug operator<<(QDebug, const QJsonValue &);

View file

@ -1,104 +0,0 @@
%{
#include "QtCore/qlist.h"
QT_USE_NAMESPACE
%}
template <typename T>
class QList
{
public:
QList();
QList(const QList<T> &l);
~QList();
QList<T> &operator=(const QList<T> &l);
#ifdef Q_COMPILER_RVALUE_REFS
QList &operator=(QList &&other);
#endif
void swap(QList<T> &other);
#ifdef Q_COMPILER_INITIALIZER_LISTS
QList(std::initializer_list<T> args);
#endif
bool operator==(const QList<T> &l) const;
bool operator!=(const QList<T> &l) const;
int size() const;
void detach();
void detachShared();
bool isDetached() const;
void setSharable(bool sharable);
bool isSharedWith(const QList<T> &other) const;
bool isEmpty() const;
void clear();
const T &at(int i) const;
const T &operator[](int i) const;
T &operator[](int i);
void reserve(int size);
void append(const T &t);
void append(const QList<T> &t);
void prepend(const T &t);
void insert(int i, const T &t);
void replace(int i, const T &t);
void removeAt(int i);
int removeAll(const T &t);
bool removeOne(const T &t);
T takeAt(int i);
T takeFirst();
T takeLast();
void move(int from, int to);
void swap(int i, int j);
int indexOf(const T &t, int from = 0) const;
int lastIndexOf(const T &t, int from = -1) const;
bool contains(const T &t) const;
int count(const T &t) const;
// more Qt
int count() const;
int length() const;
T& first();
const T& first() const;
T& last();
const T& last() const;
void removeFirst();
void removeLast();
bool startsWith(const T &t) const;
bool endsWith(const T &t) const;
QList<T> mid(int pos, int length = -1) const;
T value(int i) const;
T value(int i, const T &defaultValue) const;
// stl compatibility
void push_back(const T &t);
void push_front(const T &t);
T& front();
const T& front() const;
T& back();
const T& back() const;
void pop_front();
void pop_back();
bool empty() const;
// comfort
QList<T> &operator+=(const QList<T> &l);
QList<T> operator+(const QList<T> &l) const;
QList<T> &operator+=(const T &t);
QList<T> &operator<< (const T &t);
QList<T> &operator<<(const QList<T> &l);
QVector<T> toVector() const;
QSet<T> toSet() const;
static QList<T> fromVector(const QVector<T> &vector);
static QList<T> fromSet(const QSet<T> &set);
static QList<T> fromStdList(const std::list<T> &list);
std::list<T> toStdList() const;
};

View file

@ -1,155 +0,0 @@
%{
#include "QtCore/qobject.h"
QT_USE_NAMESPACE
%}
#ifndef QT_NO_QOBJECT
class QObject
{
/*
Q_OBJECT
Q_PROPERTY(QString objectName READ objectName WRITE setObjectName)
*/
public:
Q_INVOKABLE explicit QObject(QObject *parent = Q_NULLPTR);
virtual ~QObject();
virtual bool event(QEvent *);
virtual bool eventFilter(QObject *, QEvent *);
#ifdef QT_NO_TRANSLATION
static QString tr(const char *sourceText, const char * = Q_NULLPTR, int = -1);
#ifndef QT_NO_TEXTCODEC
static QString trUtf8(const char *sourceText, const char * = Q_NULLPTR, int = -1);
#endif
#endif //QT_NO_TRANSLATION
QString objectName() const;
void setObjectName(const QString &name);
bool isWidgetType() const;
bool signalsBlocked() const;
bool blockSignals(bool b);
QThread *thread() const;
void moveToThread(QThread *thread);
int startTimer(int interval);
void killTimer(int id);
template<typename T>
findChild(const QString &aName = QString()) const;
template<typename T>
QList<T> findChildren(const QString &aName = QString()) const;
#ifndef QT_NO_REGEXP
template<typename T>
QList<T> findChildren(const QRegExp &re) const;
#endif
const QObjectList &children() const;
void setParent(QObject *);
void installEventFilter(QObject *);
void removeEventFilter(QObject *);
static bool connect(const QObject *sender, const char *signal,
const QObject *receiver, const char *member,
Qt::ConnectionType type = Qt::AutoConnection
);
static bool connect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &method,
Qt::ConnectionType type = Qt::AutoConnection
);
bool connect(const QObject *sender, const char *signal,
const char *member,
Qt::ConnectionType type = Qt::AutoConnection
) const;
static bool disconnect(const QObject *sender, const char *signal,
const QObject *receiver, const char *member);
static bool disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &member);
bool disconnect(const char *signal = Q_NULLPTR,
const QObject *receiver = Q_NULLPTR, const char *member = Q_NULLPTR);
bool disconnect(const QObject *receiver, const char *member = Q_NULLPTR);
void dumpObjectTree();
void dumpObjectInfo();
#ifndef QT_NO_PROPERTIES
bool setProperty(const char *name, const QVariant &value);
QVariant property(const char *name) const;
QList<QByteArray> dynamicPropertyNames() const;
#endif // QT_NO_PROPERTIES
Q_SIGNALS:
void destroyed(QObject * = Q_NULLPTR);
public:
QObject *parent() const;
bool inherits(const char *classname) const;
public Q_SLOTS:
void deleteLater();
protected:
QObject *sender() const;
int senderSignalIndex() const;
int receivers(const char* signal) const;
virtual void timerEvent(QTimerEvent *);
virtual void childEvent(QChildEvent *);
virtual void customEvent(QEvent *);
virtual void connectNotify(const char *signal);
virtual void disconnectNotify(const char *signal);
QObject(QObjectPrivate &dd, QObject *parent = Q_NULLPTR);
QObjectData* d_ptr;
static const QMetaObject staticQtMetaObject;
};
/* TODO
template <class T>
T qobject_cast(QObject *object);
template <class T>
T qobject_cast(const QObject *object);
template <class T> const char * qobject_interface_iid()
{ return Q_NULLPTR; }
#ifndef Q_MOC_RUN
# define Q_DECLARE_INTERFACE(IFace, IId) \
QT_BEGIN_NAMESPACE \
template <> const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> IFace *qobject_cast<IFace *>(QObject *object) \
{ return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : Q_NULLPTR)); } \
template <> IFace *qobject_cast<IFace *>(const QObject *object) \
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : Q_NULLPTR)); } \
QT_END_NAMESPACE
#endif // Q_MOC_RUN
*/
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug, const QObject *);
#endif
#endif // QT_NO_QOBJECT
void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
const QMetaObject &mo, QList<void *> *list);
QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo);

View file

@ -1,66 +0,0 @@
%{
#include "QtCore/qregexp.h"
QT_USE_NAMESPACE
%}
#ifndef QT_NO_REGEXP
class QRegExp
{
public:
enum PatternSyntax {
RegExp,
Wildcard,
FixedString,
RegExp2,
WildcardUnix };
enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
QRegExp();
QRegExp(const QString &pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive,
PatternSyntax syntax = RegExp);
QRegExp(const QRegExp &rx);
~QRegExp();
QRegExp &operator=(const QRegExp &rx);
#ifdef Q_COMPILER_RVALUE_REFS
QRegExp &operator=(QRegExp &&other);
#endif
void swap(QRegExp &other);
bool operator==(const QRegExp &rx) const;
bool operator!=(const QRegExp &rx) const;
bool isEmpty() const;
bool isValid() const;
QString pattern() const;
void setPattern(const QString &pattern);
Qt::CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(Qt::CaseSensitivity cs);
PatternSyntax patternSyntax() const;
void setPatternSyntax(PatternSyntax syntax);
bool isMinimal() const;
void setMinimal(bool minimal);
bool exactMatch(const QString &str) const;
int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;
int matchedLength() const;
#ifndef QT_NO_REGEXP_CAPTURE
int captureCount() const;
QStringList capturedTexts() const;
QString cap(int nth = 0) const;
int pos(int nth = 0) const;
QString errorString() const;
#endif
static QString escape(const QString &str);
};
#ifndef QT_NO_DATASTREAM
QDataStream &operator<<(QDataStream &out, const QRegExp &regExp);
QDataStream &operator>>(QDataStream &in, QRegExp &regExp);
#endif
#endif // QT_NO_REGEXP

View file

@ -1,68 +0,0 @@
%{
#include "QtCore/qset.h"
QT_USE_NAMESPACE
%}
template <class T>
class QSet
{
public:
QSet();
QSet(const QSet<T> &other);
QSet<T> &operator=(const QSet<T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
QSet<T> &operator=(QSet<T> &&other);
#endif
void swap(QSet<T> &other);
bool operator==(const QSet<T> &other) const;
bool operator!=(const QSet<T> &other) const;
int size() const;
bool isEmpty() const;
int capacity() const;
void reserve(int size);
void squeeze();
void detach();
bool isDetached() const;
void setSharable(bool sharable);
void clear();
bool remove(const T &value);
bool contains(const T &value) const;
bool contains(const QSet<T> &set) const;
// more Qt
int count() const;
QSet<T> &unite(const QSet<T> &other);
QSet<T> &intersect(const QSet<T> &other);
QSet<T> &subtract(const QSet<T> &other);
bool empty() const;
// comfort
QSet<T> &operator<<(const T &value);
QSet<T> &operator|=(const QSet<T> &other);
QSet<T> &operator|=(const T &value);
QSet<T> &operator&=(const QSet<T> &other);
QSet<T> &operator&=(const T &value);
QSet<T> &operator+=(const QSet<T> &other);
QSet<T> &operator+=(const T &value);
QSet<T> &operator-=(const QSet<T> &other);
QSet<T> &operator-=(const T &value);
QSet<T> operator|(const QSet<T> &other) const;
QSet<T> operator&(const QSet<T> &other) const;
QSet<T> operator+(const QSet<T> &other) const;
QSet<T> operator-(const QSet<T> &other) const;
QList<T> toList() const;
QList<T> values() const;
static QSet<T> fromList(const QList<T> &list);
};

View file

@ -1,568 +0,0 @@
%{
#include "QtCore/qstring.h"
QT_USE_NAMESPACE
%}
class QString
{
public:
QString();
QString(const QChar *unicode, int size = -1);
QString(const QChar c);
QString(const int size, const QChar c);
QString(const QLatin1String &latin1);
QString(const QString &);
~QString();
QString &operator=(QChar c);
QString &operator=(const QString &);
QString &operator=(const QLatin1String &);
#ifdef Q_COMPILER_RVALUE_REFS
QString &operator=(QString &&other);
#endif
void swap(QString &other);
int size() const;
int count() const;
int length() const;
bool isEmpty() const;
bool isNull() const;
void resize(int size);
QString &fill(QChar c, int size = -1);
void truncate(int pos);
void chop(int n);
int capacity() const;
void reserve(int size);
void squeeze();
const QChar *unicode() const;
QChar *data();
const QChar *data() const;
const QChar *constData() const;
void detach();
bool isDetached() const;
bool isSharedWith(const QString &other) const;
void clear();
const QChar at(int i) const;
const QChar operator[](int i) const;
QCharRef operator[](int i);
const QChar operator[](uint i) const;
QCharRef operator[](uint i);
QString arg(qlonglong a, int fieldwidth=0, int base=10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(qulonglong a, int fieldwidth=0, int base=10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(long a, int fieldwidth=0, int base=10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(ulong a, int fieldwidth=0, int base=10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(int a, int fieldWidth = 0, int base = 10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(uint a, int fieldWidth = 0, int base = 10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(short a, int fieldWidth = 0, int base = 10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(ushort a, int fieldWidth = 0, int base = 10,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(char a, int fieldWidth = 0,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(QChar a, int fieldWidth = 0,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(const QString &a, int fieldWidth = 0,
const QChar &fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT;
QString &vsprintf(const char *format, va_list ap)
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 2, 0)))
#endif
;
QString &sprintf(const char *format, ...)
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 2, 3)))
#endif
;
int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QLatin1String &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QStringRef &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QLatin1String &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QStringRef &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#ifndef QT_NO_REGEXP
int indexOf(const QRegExp &, int from = 0) const;
int lastIndexOf(const QRegExp &, int from = -1) const;
bool contains(const QRegExp &rx) const;
int count(const QRegExp &) const;
int indexOf(QRegExp &, int from = 0) const;
int lastIndexOf(QRegExp &, int from = -1) const;
bool contains(QRegExp &rx) const;
#endif
enum SectionFlags {
SectionDefault = 0x00,
SectionSkipEmpty = 0x01,
SectionIncludeLeadingSep = 0x02,
SectionIncludeTrailingSep = 0x04,
SectionCaseInsensitiveSeps = 0x08
};
QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
QString section(const QString &in_sep, int start, int end = -1, SectionFlags flags = SectionDefault) const;
#ifndef QT_NO_REGEXP
QString section(const QRegExp &reg, int start, int end = -1, SectionFlags flags = SectionDefault) const;
#endif
QString left(int n) const Q_REQUIRED_RESULT;
QString right(int n) const Q_REQUIRED_RESULT;
QString mid(int position, int n = -1) const Q_REQUIRED_RESULT;
QStringRef leftRef(int n) const Q_REQUIRED_RESULT;
QStringRef rightRef(int n) const Q_REQUIRED_RESULT;
QStringRef midRef(int position, int n = -1) const Q_REQUIRED_RESULT;
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QLatin1String &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QChar &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
QString toLower() const Q_REQUIRED_RESULT;
QString toUpper() const Q_REQUIRED_RESULT;
QString toCaseFolded() const Q_REQUIRED_RESULT;
QString trimmed() const Q_REQUIRED_RESULT;
QString simplified() const Q_REQUIRED_RESULT;
QString &insert(int i, QChar c);
QString &insert(int i, const QChar *uc, int len);
QString &insert(int i, const QString &s);
QString &insert(int i, const QLatin1String &s);
QString &append(QChar c);
QString &append(const QString &s);
QString &append(const QStringRef &s);
QString &append(const QLatin1String &s);
QString &prepend(QChar c);
QString &prepend(const QString &s);
QString &prepend(const QLatin1String &s);
QString &operator+=(QChar c);
QString &operator+=(QChar::SpecialCharacter c);
QString &operator+=(const QString &s);
QString &operator+=(const QStringRef &s);
QString &operator+=(const QLatin1String &s);
QString &remove(int i, int len);
QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &remove(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(int i, int len, QChar after);
QString &replace(int i, int len, const QChar *s, int slen);
QString &replace(int i, int len, const QString &after);
QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(const QChar *before, int blen, const QChar *after, int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(const QLatin1String &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(const QLatin1String &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(const QString &before, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(const QString &before, const QString &after,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(QChar c, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QString &replace(QChar c, const QLatin1String &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
#ifndef QT_NO_REGEXP
QString &replace(const QRegExp &rx, const QString &after);
QString &remove(const QRegExp &rx);
#endif
enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
QStringList split(const QChar &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
#ifndef QT_NO_REGEXP
QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
#endif
enum NormalizationForm {
NormalizationForm_D,
NormalizationForm_C,
NormalizationForm_KD,
NormalizationForm_KC
};
QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT;
QString normalized(NormalizationForm mode, QChar::UnicodeVersion version) const Q_REQUIRED_RESULT;
QString repeated(int times) const;
const ushort *utf16() const;
QByteArray toAscii() const Q_REQUIRED_RESULT;
QByteArray toLatin1() const Q_REQUIRED_RESULT;
QByteArray toUtf8() const Q_REQUIRED_RESULT;
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
static QString fromAscii(const char *, int size = -1);
static QString fromLatin1(const char *, int size = -1);
static QString fromUtf8(const char *, int size = -1);
static QString fromLocal8Bit(const char *, int size = -1);
static QString fromUtf16(const ushort *, int size = -1);
static QString fromUcs4(const uint *, int size = -1);
static QString fromRawData(const QChar *, int size);
int toWCharArray(wchar_t *array) const;
static QString fromWCharArray(const wchar_t *, int size = -1);
QString &setRawData(const QChar *unicode, int size);
QString &setUnicode(const QChar *unicode, int size);
QString &setUtf16(const ushort *utf16, int size);
int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int compare(const QLatin1String &other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
static int compare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive);
static int compare(const QString& s1, const QLatin1String &s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
static int compare(const QLatin1String& s1, const QString &s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
static int compare(const QString &s1, const QStringRef &s2,
Qt::CaseSensitivity = Qt::CaseSensitive);
int localeAwareCompare(const QString& s) const;
static int localeAwareCompare(const QString& s1, const QString& s2);
int localeAwareCompare(const QStringRef &s) const;
static int localeAwareCompare(const QString& s1, const QStringRef& s2);
short toShort(bool *ok=Q_NULLPTR, int base=10) const;
ushort toUShort(bool *ok=Q_NULLPTR, int base=10) const;
int toInt(bool *ok=Q_NULLPTR, int base=10) const;
uint toUInt(bool *ok=Q_NULLPTR, int base=10) const;
long toLong(bool *ok=Q_NULLPTR, int base=10) const;
ulong toULong(bool *ok=Q_NULLPTR, int base=10) const;
qlonglong toLongLong(bool *ok=Q_NULLPTR, int base=10) const;
qulonglong toULongLong(bool *ok=Q_NULLPTR, int base=10) const;
float toFloat(bool *ok=Q_NULLPTR) const;
double toDouble(bool *ok=Q_NULLPTR) const;
QString &setNum(short, int base=10);
QString &setNum(ushort, int base=10);
QString &setNum(int, int base=10);
QString &setNum(uint, int base=10);
QString &setNum(long, int base=10);
QString &setNum(ulong, int base=10);
QString &setNum(qlonglong, int base=10);
QString &setNum(qulonglong, int base=10);
QString &setNum(float, char f='g', int prec=6);
QString &setNum(double, char f='g', int prec=6);
static QString number(int, int base=10);
static QString number(uint, int base=10);
static QString number(long, int base=10);
static QString number(ulong, int base=10);
static QString number(qlonglong, int base=10);
static QString number(qulonglong, int base=10);
static QString number(double, char f='g', int prec=6);
bool operator==(const QString &s) const;
bool operator<(const QString &s) const;
bool operator>(const QString &s) const;
bool operator!=(const QString &s) const;
bool operator<=(const QString &s) const;
bool operator>=(const QString &s) const;
bool operator==(const QLatin1String &s) const;
bool operator<(const QLatin1String &s) const;
bool operator>(const QLatin1String &s) const;
bool operator!=(const QLatin1String &s) const;
bool operator<=(const QLatin1String &s) const;
bool operator>=(const QLatin1String &s) const;
// ASCII compatibility
#ifndef QT_NO_CAST_FROM_ASCII
QString(const char *ch);
QString(const QByteArray &a);
QString &operator=(const char *ch);
QString &operator=(const QByteArray &a);
QString &operator=(char c);
// these are needed, so it compiles with STL support enabled
QString &prepend(const char *s);
QString &prepend(const QByteArray &s);
QString &append(const char *s);
QString &append(const QByteArray &s);
QString &operator+=(const char *s);
QString &operator+=(const QByteArray &s);
QString &operator+=(char c);
bool operator==(const char *s) const;
bool operator!=(const char *s) const;
bool operator<(const char *s) const;
bool operator<=(const char *s2) const;
bool operator>(const char *s2) const;
bool operator>=(const char *s2) const;
bool operator==(const QByteArray &s) const;
bool operator!=(const QByteArray &s) const;
bool operator<(const QByteArray &s) const;
bool operator>(const QByteArray &s) const;
bool operator<=(const QByteArray &s) const;
bool operator>=(const QByteArray &s) const;
#endif
typedef QChar *iterator;
typedef const QChar *const_iterator;
typedef iterator Iterator;
typedef const_iterator ConstIterator;
iterator begin();
const_iterator begin() const;
const_iterator constBegin() const;
iterator end();
const_iterator end() const;
const_iterator constEnd() const;
// STL compatibility
typedef const QChar & const_reference;
typedef QChar & reference;
typedef QChar value_type;
void push_back(QChar c);
void push_back(const QString &s);
void push_front(QChar c);
void push_front(const QString &s);
static QString fromStdString(const std::string &s);
std::string toStdString() const;
#ifndef QT_NO_STL_WCHAR
static QString fromStdWString(const QStdWString &s);
QStdWString toStdWString() const;
#endif // QT_NO_STL_WCHAR
bool isSimpleText() const;
bool isRightToLeft() const;
QString(int size, Qt::Initialization);
typedef Data * DataPtr;
DataPtr &data_ptr();
};
class QLatin1String
{
public:
QLatin1String(const char *s);
QLatin1String &operator=(const QLatin1String &other);
const char *latin1() const;
bool operator==(const QString &s) const;
bool operator!=(const QString &s) const;
bool operator>(const QString &s) const;
bool operator<(const QString &s) const;
bool operator>=(const QString &s) const;
bool operator<=(const QString &s) const;
// QT_ASCII_CAST_WARN
bool operator==(const char *s) const;
bool operator!=(const char *s) const;
bool operator<(const char *s) const;
bool operator>(const char *s) const;
bool operator<=(const char *s) const;
bool operator>=(const char *s) const;
};
class QCharRef {
QCharRef(QString &str, int idx);
public:
// most QChar operations repeated here
// all this is not documented: We just say "like QChar" and let it be.
operator QChar() const;
QCharRef &operator=(const QChar &c);
// An operator= for each QChar cast constructors
#ifndef QT_NO_CAST_FROM_ASCII
QCharRef &operator=(char c);
QCharRef &operator=(uchar c);
#endif
QCharRef &operator=(const QCharRef &c);
QCharRef &operator=(ushort rc);
QCharRef &operator=(short rc);
QCharRef &operator=(uint rc);
QCharRef &operator=(int rc);
// each function...
bool isNull() const;
bool isPrint() const;
bool isPunct() const;
bool isSpace() const;
bool isMark() const;
bool isLetter() const;
bool isNumber() const;
bool isLetterOrNumber() const;
bool isDigit() const;
bool isLower() const;
bool isUpper() const;
bool isTitleCase() const;
int digitValue() const;
QChar toLower() const;
QChar toUpper() const;
QChar toTitleCase () const;
QChar::Category category() const;
QChar::Direction direction() const;
QChar::Joining joining() const;
bool hasMirrored() const;
QChar mirroredChar() const;
QString decomposition() const;
QChar::Decomposition decompositionTag() const;
uchar combiningClass() const;
QChar::UnicodeVersion unicodeVersion() const;
uchar cell() const;
uchar row() const;
void setCell(uchar cell);
void setRow(uchar row);
char toAscii() const;
char toLatin1() const;
ushort unicode() const;
ushort& unicode();
};
#if !defined(QT_NO_DATASTREAM)
QDataStream &operator<<(QDataStream &, const QString &);
QDataStream &operator>>(QDataStream &, QString &);
#endif
class QStringRef {
public:
QStringRef();
QStringRef(const QString *string, int position, int size);
QStringRef(const QString *string);
QStringRef(const QStringRef &other);
~QStringRef();
const QString *string() const;
int position() const;
int size() const;
int count() const;
int length() const;
QStringRef &operator=(const QStringRef &other);
int indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QStringRef &operator=(const QString *string);
const QChar *unicode() const;
const QChar *data() const;
const QChar *constData() const;
QByteArray toAscii() const Q_REQUIRED_RESULT;
QByteArray toLatin1() const Q_REQUIRED_RESULT;
QByteArray toUtf8() const Q_REQUIRED_RESULT;
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
void clear();
QString toString() const;
bool isEmpty() const;
bool isNull() const;
QStringRef appendTo(QString *string) const;
const QChar at(int i) const;
int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
static int compare(const QStringRef &s1, const QString &s2,
Qt::CaseSensitivity = Qt::CaseSensitive);
static int compare(const QStringRef &s1, const QStringRef &s2,
Qt::CaseSensitivity = Qt::CaseSensitive);
static int compare(const QStringRef &s1, QLatin1String s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
int localeAwareCompare(const QString &s) const;
int localeAwareCompare(const QStringRef &s) const;
static int localeAwareCompare(const QStringRef &s1, const QString &s2);
static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
};
// Those are Q_CORE_EXPORT'ed not inline'ed
bool operator==(const QStringRef &s1,const QStringRef &s2);
bool operator==(const QString &s1,const QStringRef &s2);
bool operator==(const QLatin1String &s1, const QStringRef &s2);
bool operator<(const QStringRef &s1,const QStringRef &s2);

View file

@ -1,55 +0,0 @@
%{
#include "QtCore/qstringlist.h"
QT_USE_NAMESPACE
%}
typedef QListIterator<QString> QStringListIterator;
typedef QMutableListIterator<QString> QMutableStringListIterator;
class QStringList : public QList<QString>
{
public:
QStringList();
QStringList(const QString &i);
QStringList(const QStringList &l);
QStringList(const QList<QString> &l);
#ifdef Q_COMPILER_INITIALIZER_LISTS
QStringList(std::initializer_list<QString> args);
#endif
void sort();
int removeDuplicates();
QString join(const QString &sep) const;
QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
QStringList operator+(const QStringList &other) const;
QStringList &operator<<(const QString &str);
QStringList &operator<<(const QStringList &l);
#ifndef QT_NO_REGEXP
QStringList filter(const QRegExp &rx) const;
QStringList &replaceInStrings(const QRegExp &rx, const QString &after);
int indexOf(const QRegExp &rx, int from = 0) const;
int lastIndexOf(const QRegExp &rx, int from = -1) const;
int indexOf(QRegExp &rx, int from = 0) const;
int lastIndexOf(QRegExp &rx, int from = -1) const;
#endif
#if !defined(Q_NO_USING_KEYWORD)
using QList<QString>::indexOf;
using QList<QString>::lastIndexOf;
#else
int indexOf(const QString &str, int from = 0) const;
int lastIndexOf(const QString &str, int from = -1) const;
#endif
};
#ifndef QT_NO_DATASTREAM
QDataStream &operator>>(QDataStream &in, QStringList &list);
QDataStream &operator<<(QDataStream &out, const QStringList &list);
#endif // QT_NO_DATASTREAM

View file

@ -1,269 +0,0 @@
%{
#include "QtCore/qvariant.h"
QT_USE_NAMESPACE
%}
template <typename T>
QVariant qVariantFromValue(const T &);
template<typename T>
T qvariant_cast(const QVariant &);
class QVariant
{
public:
enum Type {
Invalid = QMetaType::Void,
Bool = QMetaType::Bool,
Int = QMetaType::Int,
UInt = QMetaType::UInt,
LongLong = QMetaType::LongLong,
ULongLong = QMetaType::ULongLong,
Double = QMetaType::Double,
Char = QMetaType::QChar,
Map = QMetaType::QVariantMap,
List = QMetaType::QVariantList,
String = QMetaType::QString,
StringList = QMetaType::QStringList,
ByteArray = QMetaType::QByteArray,
BitArray = QMetaType::QBitArray,
Date = QMetaType::QDate,
Time = QMetaType::QTime,
DateTime = QMetaType::QDateTime,
Url = QMetaType::QUrl,
Locale = QMetaType::QLocale,
Rect = QMetaType::QRect,
RectF = QMetaType::QRectF,
Size = QMetaType::QSize,
SizeF = QMetaType::QSizeF,
Line = QMetaType::QLine,
LineF = QMetaType::QLineF,
Point = QMetaType::QPoint,
PointF = QMetaType::QPointF,
RegExp = QMetaType::QRegExp,
Hash = QMetaType::QVariantHash,
EasingCurve = QMetaType::QEasingCurve,
JsonValue = QMetaType::QJsonValue,
JsonObject = QMetaType::QJsonObject,
JsonArray = QMetaType::QJsonArray,
JsonDocument = QMetaType::QJsonDocument,
LastCoreType = QMetaType::LastCoreType,
Font = QMetaType::QFont,
Pixmap = QMetaType::QPixmap,
Brush = QMetaType::QBrush,
Color = QMetaType::QColor,
Palette = QMetaType::QPalette,
Icon = QMetaType::QIcon,
Image = QMetaType::QImage,
Polygon = QMetaType::QPolygon,
Region = QMetaType::QRegion,
Bitmap = QMetaType::QBitmap,
Cursor = QMetaType::QCursor,
SizePolicy = QMetaType::QSizePolicy,
KeySequence = QMetaType::QKeySequence,
Pen = QMetaType::QPen,
TextLength = QMetaType::QTextLength,
TextFormat = QMetaType::QTextFormat,
Matrix = QMetaType::QMatrix,
Transform = QMetaType::QTransform,
Matrix4x4 = QMetaType::QMatrix4x4,
Vector2D = QMetaType::QVector2D,
Vector3D = QMetaType::QVector3D,
Vector4D = QMetaType::QVector4D,
Quaternion = QMetaType::QQuaternion,
LastGuiType = QMetaType::LastGuiType,
UserType = 127,
LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
};
QVariant();
~QVariant();
QVariant(Type type);
QVariant(int typeOrUserType, const void *copy);
QVariant(int typeOrUserType, const void *copy, uint flags);
QVariant(const QVariant &other);
#ifndef QT_NO_DATASTREAM
QVariant(QDataStream &s);
#endif
QVariant(int i);
QVariant(uint ui);
QVariant(qlonglong ll);
QVariant(qulonglong ull);
QVariant(bool b);
QVariant(double d);
QVariant(float f);
#ifndef QT_NO_CAST_FROM_ASCII
QVariant(const char *str);
#endif
QVariant(const QByteArray &bytearray);
QVariant(const QBitArray &bitarray);
QVariant(const QString &string);
QVariant(const QLatin1String &string);
QVariant(const QStringList &stringlist);
QVariant(const QChar &qchar);
QVariant(const QDate &date);
QVariant(const QTime &time);
QVariant(const QDateTime &datetime);
QVariant(const QList<QVariant> &list);
QVariant(const QMap<QString,QVariant> &map);
QVariant(const QHash<QString,QVariant> &hash);
#ifndef QT_NO_GEOM_VARIANT
QVariant(const QSize &size);
QVariant(const QSizeF &size);
QVariant(const QPoint &pt);
QVariant(const QPointF &pt);
QVariant(const QLine &line);
QVariant(const QLineF &line);
QVariant(const QRect &rect);
QVariant(const QRectF &rect);
#endif
QVariant(const QUrl &url);
QVariant(const QLocale &locale);
#ifndef QT_NO_REGEXP
QVariant(const QRegExp &regExp);
#endif
QVariant(const QJsonValue &jsonValue);
QVariant(const QJsonObject &jsonObject);
QVariant(const QJsonArray &jsonArray);
QVariant(const QJsonDocument &jsonDocument);
#ifndef QT_BOOTSTRAPPED
QVariant(const QEasingCurve &easing);
#endif
QVariant& operator=(const QVariant &other);
#ifdef Q_COMPILER_RVALUE_REFS
QVariant &operator=(QVariant &&other);
#endif
void swap(QVariant &other);
Type type() const;
int userType() const;
const char *typeName() const;
bool canConvert(Type t) const;
bool convert(Type t);
bool isValid() const;
bool isNull() const;
void clear();
void detach();
bool isDetached() const;
int toInt(bool *ok = Q_NULLPTR) const;
uint toUInt(bool *ok = Q_NULLPTR) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR) const;
bool toBool() const;
double toDouble(bool *ok = Q_NULLPTR) const;
float toFloat(bool *ok = Q_NULLPTR) const;
qreal toReal(bool *ok = Q_NULLPTR) const;
QByteArray toByteArray() const;
QBitArray toBitArray() const;
QString toString() const;
QStringList toStringList() const;
QChar toChar() const;
QDate toDate() const;
QTime toTime() const;
QDateTime toDateTime() const;
QList<QVariant> toList() const;
QMap<QString, QVariant> toMap() const;
QHash<QString, QVariant> toHash() const;
#ifndef QT_NO_GEOM_VARIANT
QPoint toPoint() const;
QPointF toPointF() const;
QRect toRect() const;
QSize toSize() const;
QSizeF toSizeF() const;
QLine toLine() const;
QLineF toLineF() const;
QRectF toRectF() const;
#endif
QUrl toUrl() const;
QLocale toLocale() const;
#ifndef QT_NO_REGEXP
QRegExp toRegExp() const;
#endif
#ifndef QT_BOOTSTRAPPED
QJsonValue toJsonValue() const;
QJsonObject toJsonObject() const;
QJsonArray toJsonArray() const;
QJsonDocument toJsonDocument() const;
QEasingCurve toEasingCurve() const;
#endif
#ifndef QT_NO_DATASTREAM
void load(QDataStream &ds);
void save(QDataStream &ds) const;
#endif
static const char *typeToName(Type type);
static Type nameToType(const char *name);
void *data();
const void *constData() const;
const void *data() const;
template<typename T>
void setValue(const T &value);
template<typename T>
T value() const;
template<typename T>
static QVariant fromValue(const T &value);
template<typename T>
bool canConvert() const;
bool operator==(const QVariant &v) const;
bool operator!=(const QVariant &v) const;
};
bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr);
template <typename T>
QVariant qVariantFromValue(const T &t);
template <>
QVariant qVariantFromValue(const QVariant &t);
template <typename T>
void qVariantSetValue(QVariant &v, const T &t);
template <>
void qVariantSetValue<QVariant>(QVariant &v, const QVariant &t);
template<typename T>
void QVariant::setValue(const T &avalue);
#ifndef QT_NO_DATASTREAM
QDataStream& operator>> (QDataStream& s, QVariant& p);
QDataStream& operator<< (QDataStream& s, const QVariant& p);
QDataStream& operator>> (QDataStream& s, QVariant::Type& p);
QDataStream& operator<< (QDataStream& s, const QVariant::Type p);
#endif
#ifndef QT_MOC
template<typename T> T qvariant_cast(const QVariant &v);
template<> QVariant qvariant_cast<QVariant>(const QVariant &v);
#endif // QT_MOC
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug, const QVariant &);
QDebug operator<<(QDebug, const QVariant::Type);
#endif

View file

@ -1,101 +0,0 @@
%{
#include "QtCore/qvector.h"
QT_USE_NAMESPACE
%}
template <typename T>
class QVector
{
public:
QVector();
QVector(int size);
QVector(int size, const T &t);
QVector(const QVector<T> &v);
~QVector();
QVector<T> &operator=(const QVector<T> &v);
#ifdef Q_COMPILER_RVALUE_REFS
QVector<T> operator=(QVector<T> &&other);
#endif
void swap(QVector<T> &other);
#ifdef Q_COMPILER_INITIALIZER_LISTS
QVector(std::initializer_list<T> args);
#endif
bool operator==(const QVector<T> &v) const;
bool operator!=(const QVector<T> &v) const;
int size() const;
bool isEmpty() const;
void resize(int size);
int capacity() const;
void reserve(int size);
void squeeze();
void detach();
bool isDetached() const;
void setSharable(bool sharable);
bool isSharedWith(const QVector<T> &other) const;
T *data();
const T *data() const;
const T *constData() const;
void clear();
const T &at(int i) const;
T &operator[](int i);
const T &operator[](int i) const;
void append(const T &t);
void prepend(const T &t);
void insert(int i, const T &t);
void insert(int i, int n, const T &t);
void replace(int i, const T &t);
void remove(int i);
void remove(int i, int n);
QVector<T> &fill(const T &t, int size = -1);
int indexOf(const T &t, int from = 0) const;
int lastIndexOf(const T &t, int from = -1) const;
bool contains(const T &t) const;
int count(const T &t) const;
// more Qt
int count() const;
T& first();
const T &first() const;
T& last();
const T &last() const;
bool startsWith(const T &t) const;
bool endsWith(const T &t) const;
QVector<T> mid(int pos, int length = -1) const;
T value(int i) const;
T value(int i, const T &defaultValue) const;
// STL compatibility
void push_back(const T &t);
void push_front(const T &t);
void pop_back();
void pop_front();
bool empty() const;
T& front();
const T &front() const;
T &back();
const T &back();
// comfort
QVector<T> &operator+=(const QVector<T> &l);
QVector<T> operator+(const QVector<T> &l) const;
QVector<T> &operator+=(const T &t);
QVector<T> &operator<< (const T &t);
QVector<T> &operator<<(const QVector<T> &l);
QList<T> toList() const;
static QVector<T> fromList(const QList<T> &list);
static QVector<T> fromStdVector(const std::vector<T> &vector);
std::vector<T> toStdVector() const;
};

View file

@ -1,31 +0,0 @@
%{
#include "QtGui/qfontinfo.h"
QT_USE_NAMESPACE
%}
class QFontInfo
{
public:
QFontInfo(const QFont &);
QFontInfo(const QFontInfo &);
~QFontInfo();
QFontInfo &operator=(const QFontInfo &);
QString family() const;
QString styleName() const;
int pixelSize() const;
int pointSize() const;
qreal pointSizeF() const;
bool italic() const;
QFont::Style style() const;
int weight() const;
bool bold() const;
bool underline() const;
bool overline() const;
bool strikeOut() const;
bool fixedPitch() const;
QFont::StyleHint styleHint() const;
bool exactMatch() const;
};

View file

@ -1,115 +0,0 @@
%{
#include "QtGui/qfontmetrics.h"
QT_USE_NAMESPACE
%}
class QFontMetrics
{
public:
QFontMetrics(const QFont &);
QFontMetrics(const QFont &, QPaintDevice *pd);
QFontMetrics(const QFontMetrics &);
~QFontMetrics();
QFontMetrics &operator=(const QFontMetrics &);
#ifdef Q_COMPILER_RVALUE_REFS
QFontMetrics &operator=(QFontMetrics &&other);
#endif
int ascent() const;
int descent() const;
int height() const;
int leading() const;
int lineSpacing() const;
int minLeftBearing() const;
int minRightBearing() const;
int maxWidth() const;
int xHeight() const;
int averageCharWidth() const;
bool inFont(QChar) const;
bool inFontUcs4(uint ucs4) const;
int leftBearing(QChar) const;
int rightBearing(QChar) const;
int width(const QString &, int len = -1) const;
int width(const QString &, int len, int flags) const;
int width(QChar) const;
int charWidth(const QString &str, int pos) const;
QRect boundingRect(QChar) const;
QRect boundingRect(const QString &text) const;
QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops=0, int *tabarray=0) const;
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
int tabstops=0, int *tabarray=0) const;
QSize size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
QRect tightBoundingRect(const QString &text) const;
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags = 0) const;
int underlinePos() const;
int overlinePos() const;
int strikeOutPos() const;
int lineWidth() const;
bool operator==(const QFontMetrics &other) const;
bool operator !=(const QFontMetrics &other) const;
};
class QFontMetricsF
{
public:
QFontMetricsF(const QFont &);
QFontMetricsF(const QFont &, QPaintDevice *pd);
QFontMetricsF(const QFontMetrics &);
QFontMetricsF(const QFontMetricsF &);
~QFontMetricsF();
QFontMetricsF &operator=(const QFontMetricsF &);
QFontMetricsF &operator=(const QFontMetrics &);
#ifdef Q_COMPILER_RVALUE_REFS
QFontMetricsF &operator=(QFontMetricsF &&other);
#endif
qreal ascent() const;
qreal descent() const;
qreal height() const;
qreal leading() const;
qreal lineSpacing() const;
qreal minLeftBearing() const;
qreal minRightBearing() const;
qreal maxWidth() const;
qreal xHeight() const;
qreal averageCharWidth() const;
bool inFont(QChar) const;
bool inFontUcs4(uint ucs4) const;
qreal leftBearing(QChar) const;
qreal rightBearing(QChar) const;
qreal width(const QString &string) const;
qreal width(QChar) const;
QRectF boundingRect(const QString &string) const;
QRectF boundingRect(QChar) const;
QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops=0, int *tabarray=0) const;
QSizeF size(int flags, const QString& str, int tabstops=0, int *tabarray=0) const;
QRectF tightBoundingRect(const QString &text) const;
QString elidedText(const QString &text, Qt::TextElideMode mode, qreal width, int flags = 0) const;
qreal underlinePos() const;
qreal overlinePos() const;
qreal strikeOutPos() const;
qreal lineWidth() const;
bool operator==(const QFontMetricsF &other) const;
bool operator !=(const QFontMetricsF &other) const;
};

View file

@ -1,533 +0,0 @@
%{
#include "QtGui/qwidget.h"
QT_USE_NAMESPACE
%}
class QWidget : public QObject, public QPaintDevice
{
Q_OBJECT
Q_PROPERTY(bool modal READ isModal)
Q_PROPERTY(Qt::WindowModality windowModality READ windowModality WRITE setWindowModality)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
Q_PROPERTY(QRect frameGeometry READ frameGeometry)
Q_PROPERTY(QRect normalGeometry READ normalGeometry)
Q_PROPERTY(int x READ x)
Q_PROPERTY(int y READ y)
Q_PROPERTY(QPoint pos READ pos WRITE move DESIGNABLE false STORED false)
Q_PROPERTY(QSize frameSize READ frameSize)
Q_PROPERTY(QSize size READ size WRITE resize DESIGNABLE false STORED false)
Q_PROPERTY(int width READ width)
Q_PROPERTY(int height READ height)
Q_PROPERTY(QRect rect READ rect)
Q_PROPERTY(QRect childrenRect READ childrenRect)
Q_PROPERTY(QRegion childrenRegion READ childrenRegion)
Q_PROPERTY(QSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy)
Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth STORED false DESIGNABLE false)
Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight STORED false DESIGNABLE false)
Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth STORED false DESIGNABLE false)
Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight STORED false DESIGNABLE false)
Q_PROPERTY(QSize sizeIncrement READ sizeIncrement WRITE setSizeIncrement)
Q_PROPERTY(QSize baseSize READ baseSize WRITE setBaseSize)
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
Q_PROPERTY(QFont font READ font WRITE setFont)
#ifndef QT_NO_CURSOR
Q_PROPERTY(QCursor cursor READ cursor WRITE setCursor RESET unsetCursor)
#endif
Q_PROPERTY(bool mouseTracking READ hasMouseTracking WRITE setMouseTracking)
Q_PROPERTY(bool isActiveWindow READ isActiveWindow)
Q_PROPERTY(Qt::FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy)
Q_PROPERTY(bool focus READ hasFocus)
Q_PROPERTY(Qt::ContextMenuPolicy contextMenuPolicy READ contextMenuPolicy WRITE setContextMenuPolicy)
Q_PROPERTY(bool updatesEnabled READ updatesEnabled WRITE setUpdatesEnabled DESIGNABLE false)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)
Q_PROPERTY(bool minimized READ isMinimized)
Q_PROPERTY(bool maximized READ isMaximized)
Q_PROPERTY(bool fullScreen READ isFullScreen)
Q_PROPERTY(QSize sizeHint READ sizeHint)
Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint)
Q_PROPERTY(bool acceptDrops READ acceptDrops WRITE setAcceptDrops)
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle DESIGNABLE isWindow)
Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon DESIGNABLE isWindow)
Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText DESIGNABLE isWindow)
Q_PROPERTY(double windowOpacity READ windowOpacity WRITE setWindowOpacity DESIGNABLE isWindow)
Q_PROPERTY(bool windowModified READ isWindowModified WRITE setWindowModified DESIGNABLE isWindow)
#ifndef QT_NO_TOOLTIP
Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip)
#endif
#ifndef QT_NO_STATUSTIP
Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip)
#endif
#ifndef QT_NO_WHATSTHIS
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)
#endif
#ifndef QT_NO_ACCESSIBILITY
Q_PROPERTY(QString accessibleName READ accessibleName WRITE setAccessibleName)
Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription)
#endif
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)
QDOC_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags)
Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground)
#ifndef QT_NO_STYLE_STYLESHEET
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
#endif
Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET unsetLocale)
Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath DESIGNABLE isWindow)
public:
enum RenderFlags {
DrawWindowBackground = 0x1,
DrawChildren = 0x2,
IgnoreMask = 0x4
};
QWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = 0);
~QWidget();
int devType() const;
WId winId() const;
void createWinId(); // internal, going away
WId internalWinId() const;
WId effectiveWinId() const;
// GUI style setting
QStyle *style() const;
void setStyle(QStyle *);
// Widget types and states
bool isTopLevel() const;
bool isWindow() const;
bool isModal() const;
Qt::WindowModality windowModality() const;
void setWindowModality(Qt::WindowModality windowModality);
bool isEnabled() const;
bool isEnabledTo(QWidget*) const;
bool isEnabledToTLW() const;
public Q_SLOTS:
void setEnabled(bool);
void setDisabled(bool);
void setWindowModified(bool);
// Widget coordinates
public:
QRect frameGeometry() const;
const QRect &geometry() const;
QRect normalGeometry() const;
int x() const;
int y() const;
QPoint pos() const;
QSize frameSize() const;
QSize size() const;
int width() const;
int height() const;
QRect rect() const;
QRect childrenRect() const;
QRegion childrenRegion() const;
QSize minimumSize() const;
QSize maximumSize() const;
int minimumWidth() const;
int minimumHeight() const;
int maximumWidth() const;
int maximumHeight() const;
void setMinimumSize(const QSize &);
void setMinimumSize(int minw, int minh);
void setMaximumSize(const QSize &);
void setMaximumSize(int maxw, int maxh);
void setMinimumWidth(int minw);
void setMinimumHeight(int minh);
void setMaximumWidth(int maxw);
void setMaximumHeight(int maxh);
QSize sizeIncrement() const;
void setSizeIncrement(const QSize &);
void setSizeIncrement(int w, int h);
QSize baseSize() const;
void setBaseSize(const QSize &);
void setBaseSize(int basew, int baseh);
void setFixedSize(const QSize &);
void setFixedSize(int w, int h);
void setFixedWidth(int w);
void setFixedHeight(int h);
// Widget coordinate mapping
QPoint mapToGlobal(const QPoint &) const;
QPoint mapFromGlobal(const QPoint &) const;
QPoint mapToParent(const QPoint &) const;
QPoint mapFromParent(const QPoint &) const;
QPoint mapTo(QWidget *, const QPoint &) const;
QPoint mapFrom(QWidget *, const QPoint &) const;
QWidget *window() const;
QWidget *nativeParentWidget() const;
QWidget *topLevelWidget() const;
// Widget appearance functions
const QPalette &palette() const;
void setPalette(const QPalette &);
void setBackgroundRole(QPalette::ColorRole);
QPalette::ColorRole backgroundRole() const;
void setForegroundRole(QPalette::ColorRole);
QPalette::ColorRole foregroundRole() const;
const QFont &font() const;
void setFont(const QFont &);
QFontMetrics fontMetrics() const;
QFontInfo fontInfo() const;
#ifndef QT_NO_CURSOR
QCursor cursor() const;
void setCursor(const QCursor &);
void unsetCursor();
#endif
void setMouseTracking(bool enable);
bool hasMouseTracking() const;
bool underMouse() const;
void setMask(const QBitmap &);
void setMask(const QRegion &);
QRegion mask() const;
void clearMask();
void render(QPaintDevice *target, const QPoint &targetOffset = QPoint(),
const QRegion &sourceRegion = QRegion(),
RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren));
void render(QPainter *painter, const QPoint &targetOffset = QPoint(),
const QRegion &sourceRegion = QRegion(),
RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren));
#ifndef QT_NO_GRAPHICSEFFECT
QGraphicsEffect *graphicsEffect() const;
void setGraphicsEffect(QGraphicsEffect *effect);
#endif //QT_NO_GRAPHICSEFFECT
#ifndef QT_NO_GESTURES
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
void ungrabGesture(Qt::GestureType type);
#endif
public Q_SLOTS:
void setWindowTitle(const QString &);
#ifndef QT_NO_STYLE_STYLESHEET
void setStyleSheet(const QString& styleSheet);
#endif
public:
#ifndef QT_NO_STYLE_STYLESHEET
QString styleSheet() const;
#endif
QString windowTitle() const;
void setWindowIcon(const QIcon &icon);
QIcon windowIcon() const;
void setWindowIconText(const QString &);
QString windowIconText() const;
void setWindowRole(const QString &);
QString windowRole() const;
void setWindowFilePath(const QString &filePath);
QString windowFilePath() const;
void setWindowOpacity(qreal level);
qreal windowOpacity() const;
bool isWindowModified() const;
#ifndef QT_NO_TOOLTIP
void setToolTip(const QString &);
QString toolTip() const;
#endif
#ifndef QT_NO_STATUSTIP
void setStatusTip(const QString &);
QString statusTip() const;
#endif
#ifndef QT_NO_WHATSTHIS
void setWhatsThis(const QString &);
QString whatsThis() const;
#endif
#ifndef QT_NO_ACCESSIBILITY
QString accessibleName() const;
void setAccessibleName(const QString &name);
QString accessibleDescription() const;
void setAccessibleDescription(const QString &description);
#endif
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;
void unsetLayoutDirection();
void setLocale(const QLocale &locale);
QLocale locale() const;
void unsetLocale();
bool isRightToLeft() const;
bool isLeftToRight() const;
public Q_SLOTS:
void setFocus();
public:
bool isActiveWindow() const;
void activateWindow();
void clearFocus();
void setFocus(Qt::FocusReason reason);
Qt::FocusPolicy focusPolicy() const;
void setFocusPolicy(Qt::FocusPolicy policy);
bool hasFocus() const;
static void setTabOrder(QWidget *, QWidget *);
void setFocusProxy(QWidget *);
QWidget *focusProxy() const;
Qt::ContextMenuPolicy contextMenuPolicy() const;
void setContextMenuPolicy(Qt::ContextMenuPolicy policy);
// Grab functions
void grabMouse();
#ifndef QT_NO_CURSOR
void grabMouse(const QCursor &);
#endif
void releaseMouse();
void grabKeyboard();
void releaseKeyboard();
#ifndef QT_NO_SHORTCUT
int grabShortcut(const QKeySequence &key, Qt::ShortcutContext context = Qt::WindowShortcut);
void releaseShortcut(int id);
void setShortcutEnabled(int id, bool enable = true);
void setShortcutAutoRepeat(int id, bool enable = true);
#endif
static QWidget *mouseGrabber();
static QWidget *keyboardGrabber();
// Update/refresh functions
bool updatesEnabled() const;
void setUpdatesEnabled(bool enable);
#ifndef QT_NO_GRAPHICSVIEW
QGraphicsProxyWidget *graphicsProxyWidget() const;
#endif
public Q_SLOTS:
void update();
void repaint();
public:
void update(int x, int y, int w, int h);
void update(const QRect&);
void update(const QRegion&);
void repaint(int x, int y, int w, int h);
void repaint(const QRect &);
void repaint(const QRegion &);
public Q_SLOTS:
// Widget management functions
virtual void setVisible(bool visible);
void setHidden(bool hidden);
void show();
void hide();
void showMinimized();
void showMaximized();
void showFullScreen();
void showNormal();
bool close();
void raise();
void lower();
public:
void stackUnder(QWidget*);
void move(int x, int y);
void move(const QPoint &);
void resize(int w, int h);
void resize(const QSize &);
void setGeometry(int x, int y, int w, int h);
void setGeometry(const QRect &);
QByteArray saveGeometry() const;
bool restoreGeometry(const QByteArray &geometry);
void adjustSize();
bool isVisible() const;
bool isVisibleTo(const QWidget*) const;
bool isHidden() const;
bool isMinimized() const;
bool isMaximized() const;
bool isFullScreen() const;
Qt::WindowStates windowState() const;
void setWindowState(Qt::WindowStates state);
void overrideWindowState(Qt::WindowStates state);
virtual QSize sizeHint() const;
virtual QSize minimumSizeHint() const;
QSizePolicy sizePolicy() const;
void setSizePolicy(QSizePolicy);
void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
virtual int heightForWidth(int) const;
QRegion visibleRegion() const;
void setContentsMargins(int left, int top, int right, int bottom);
void setContentsMargins(const QMargins &margins);
void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
QMargins contentsMargins() const;
QRect contentsRect() const;
public:
QLayout *layout() const;
void setLayout(QLayout *);
void updateGeometry();
void setParent(QWidget *parent);
void setParent(QWidget *parent, Qt::WindowFlags f);
void scroll(int dx, int dy);
void scroll(int dx, int dy, const QRect&);
// Misc. functions
QWidget *focusWidget() const;
QWidget *nextInFocusChain() const;
QWidget *previousInFocusChain() const;
// drag and drop
bool acceptDrops() const;
void setAcceptDrops(bool on);
#ifndef QT_NO_ACTION
//actions
void addAction(QAction *action);
void addActions(QList<QAction*> actions);
void insertAction(QAction *before, QAction *action);
void insertActions(QAction *before, QList<QAction*> actions);
void removeAction(QAction *action);
QList<QAction*> actions() const;
#endif
QWidget *parentWidget() const;
void setWindowFlags(Qt::WindowFlags type);
Qt::WindowFlags windowFlags() const;
void overrideWindowFlags(Qt::WindowFlags type);
Qt::WindowType windowType() const;
static QWidget *find(WId);
QWidget *childAt(int x, int y) const;
QWidget *childAt(const QPoint &p) const;
#if defined(Q_WS_X11)
const QX11Info &x11Info() const;
Qt::HANDLE x11PictureHandle() const;
#endif
Qt::HANDLE handle() const;
void setAttribute(Qt::WidgetAttribute, bool on = true);
bool testAttribute(Qt::WidgetAttribute) const;
QPaintEngine *paintEngine() const;
void ensurePolished() const;
bool isAncestorOf(const QWidget *child) const;
#ifdef QT_KEYPAD_NAVIGATION
bool hasEditFocus() const;
void setEditFocus(bool on);
#endif
bool autoFillBackground() const;
void setAutoFillBackground(bool enabled);
void setWindowSurface(QWindowSurface *surface);
QWindowSurface *windowSurface() const;
Q_SIGNALS:
void customContextMenuRequested(const QPoint &pos);
protected:
// Event handlers
bool event(QEvent *);
virtual void mousePressEvent(QMouseEvent *);
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseMoveEvent(QMouseEvent *);
#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *);
#endif
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void focusOutEvent(QFocusEvent *);
virtual void enterEvent(QEvent *);
virtual void leaveEvent(QEvent *);
virtual void paintEvent(QPaintEvent *);
virtual void moveEvent(QMoveEvent *);
virtual void resizeEvent(QResizeEvent *);
virtual void closeEvent(QCloseEvent *);
#ifndef QT_NO_CONTEXTMENU
virtual void contextMenuEvent(QContextMenuEvent *);
#endif
#ifndef QT_NO_ACTION
virtual void actionEvent(QActionEvent *);
#endif
#ifndef QT_NO_DRAGANDDROP
virtual void dragEnterEvent(QDragEnterEvent *);
virtual void dragMoveEvent(QDragMoveEvent *);
virtual void dragLeaveEvent(QDragLeaveEvent *);
virtual void dropEvent(QDropEvent *);
#endif
virtual void showEvent(QShowEvent *);
virtual void hideEvent(QHideEvent *);
#if defined(Q_WS_X11)
virtual bool x11Event(XEvent *);
#endif
// Misc. protected functions
virtual void changeEvent(QEvent *);
int metric(PaintDeviceMetric) const;
protected Q_SLOTS:
void updateMicroFocus();
protected:
void create(WId = 0, bool initializeWindow = true,
bool destroyOldWindow = true);
void destroy(bool destroyWindow = true,
bool destroySubWindows = true);
virtual bool focusNextPrevChild(bool next);
bool focusNextChild();
bool focusPreviousChild();
QWidget(QWidgetPrivate &d, QWidget* parent, Qt::WindowFlags f);
virtual void styleChange(QStyle&); // compat
virtual void enabledChange(bool); // compat
virtual void paletteChange(const QPalette &); // compat
virtual void fontChange(const QFont &); // compat
virtual void windowActivationChange(bool); // compat
virtual void languageChange(); // compat
};
template <> QWidget *qobject_cast<QWidget*>(QObject *o);
template <> const QWidget *qobject_cast<const QWidget*>(const QObject *o);

View file

@ -1,9 +1,6 @@
#!/usr/bin/python
import sys, KtCore, KtGui
import sys, KtCore
a = KtGui.QApplication(0, None)
w = KtGui.QMainWindow()
w.setWindowTitle(KtCore.QString('Test'))
w.show()
a = KtCore.QCoreApplication(0, None)
sys.exit(a._exec())

View file

@ -1,19 +0,0 @@
#include "QtCore/qglobal.h"
/* ASCII interface is needed and macro uses are purged anyway
#define QT_ASCII_CAST_WARN
#define QT_ASCII_CAST_WARN_CONSTRUCTOR
*/
#define Q_GADGET
#define Q_ENUMS(x)
#define Q_NO_USING_KEYWORD
#define Q_REQUIRED_RESULT
#define QT_FASTCALL
#define Q_OBJECT
#define Q_PROPERTY(x)
#define QDOC_PROPERTY(x)
#define Q_SLOTS
#define Q_SIGNALS protected
#define Q_INVOKABLE

View file

@ -0,0 +1,282 @@
<?xml version="1.0"?>
<typesystem package="KtCore">
<primitive-type name="bool"/>
<primitive-type name="int"/>
<primitive-type name="uint"/>
<primitive-type name="unsigned int"/>
<primitive-type name="double"/>
<primitive-type name="float"/>
<primitive-type name="long"/>
<primitive-type name="ulong"/>
<primitive-type name="longlong"/>
<primitive-type name="long long"/>
<primitive-type name="ulonglong"/>
<primitive-type name="unsigned long long"/>
<primitive-type name="short"/>
<primitive-type name="ushort"/>
<primitive-type name="char"/>
<primitive-type name="uchar"/>
<primitive-type name="unsigned char"/>
<primitive-type name="pid_t"/>
<primitive-type name="size_t"/>
<primitive-type name="int64_t"/>
<primitive-type name="mode_t"/>
<primitive-type name="time_t"/>
<primitive-type name="std::string"/>
<primitive-type name="qint64"/>
<primitive-type name="qlonglong"/>
<template name="cpplist_to_pylist_convertion">
PyObject* %out = PyList_New((int) %in.size());
%INTYPE::const_iterator it = %in.begin();
for (int idx = 0; it != %in.end(); ++it, ++idx) {
%INTYPE_0 cppItem(*it);
PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));
}
return %out;
</template>
<template name="pyseq_to_cpplist_convertion">
Shiboken::AutoDecRef seq(PySequence_Fast(%in, 0));
for (int i = 0; i &lt; PySequence_Fast_GET_SIZE(seq.object()); i++) {
PyObject* pyItem = PySequence_Fast_GET_ITEM(seq.object(), i);
%OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
%out.push_back(cppItem);
}
</template>
<template name="cppvector_to_pylist_convertion">
PyObject* %out = PyList_New((int) %in.size());
%INTYPE::const_iterator it = %in.begin();
for (int idx = 0; it != %in.end(); ++it, ++idx) {
%INTYPE_0 cppItem(*it);
PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));
}
return %out;
</template>
<template name="pyseq_to_cppvector_convertion">
Shiboken::AutoDecRef seq(PySequence_Fast(%in, 0));
for (int i = 0; i &lt; PySequence_Fast_GET_SIZE(seq.object()); i++) {
PyObject* pyItem = PySequence_Fast_GET_ITEM(seq.object(), i);
%OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
%out.push_back(cppItem);
}
</template>
<template name="cppmap_to_pymap_conversion">
PyObject *%out = PyDict_New();
for (%INTYPE::const_iterator it = %in.begin(); it != %in.end(); ++it) {
%INTYPE_0 key = it->first;
%INTYPE_1 value = it->second;
PyObject *pyKey = %CONVERTTOPYTHON[%INTYPE_0](key);
PyObject *pyValue = %CONVERTTOPYTHON[%INTYPE_1](value);
PyDict_SetItem(%out, pyKey, pyValue);
Py_DECREF(pyKey);
Py_DECREF(pyValue);
}
return %out;
</template>
<template name="pydict_to_cppmap_conversion">
PyObject *key;
PyObject *value;
Py_ssize_t pos = 0;
while (PyDict_Next(%in, &amp;pos, &amp;key, &amp;value)) {
%OUTTYPE_0 cppKey = %CONVERTTOCPP[%OUTTYPE_0](key);
%OUTTYPE_1 cppValue = %CONVERTTOCPP[%OUTTYPE_1](value);
%out[cppKey] = cppValue;
}
</template>
<container-type name="std::list" type="list">
<include file-name="list" location="global"/>
<conversion-rule>
<native-to-target>
<insert-template name="cpplist_to_pylist_convertion"/>
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
<insert-template name="pyseq_to_cpplist_convertion"/>
</add-conversion>
</target-to-native>
</conversion-rule>
</container-type>
<container-type name="std::vector" type="vector">
<include file-name="vector" location="global"/>
<conversion-rule>
<native-to-target>
<insert-template name="cppvector_to_pylist_convertion"/>
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
<insert-template name="pyseq_to_cppvector_convertion"/>
</add-conversion>
</target-to-native>
</conversion-rule>
</container-type>
<container-type name="std::map" type="map">
<include file-name="map" location="global"/>
<conversion-rule>
<native-to-target>
<insert-template name="cppmap_to_pymap_conversion"/>
</native-to-target>
<target-to-native>
<add-conversion type="PyDict">
<insert-template name="pydict_to_cppmap_conversion"/>
</add-conversion>
</target-to-native>
</conversion-rule>
</container-type>
<container-type name="std::pair" type="pair">
<include file-name="utility" location="global"/>
<conversion-rule>
<native-to-target>
PyObject *%out = PyTuple_New(2);
PyTuple_SET_ITEM(%out, 0, %CONVERTTOPYTHON[%INTYPE_0](%in.first));
PyTuple_SET_ITEM(%out, 1, %CONVERTTOPYTHON[%INTYPE_1](%in.second));
return %out;
</native-to-target>
<target-to-native>
<add-conversion type="PySequence">
%out.first = %CONVERTTOCPP[%OUTTYPE_0](PySequence_Fast_GET_ITEM(%in, 0));
%out.second = %CONVERTTOCPP[%OUTTYPE_1](PySequence_Fast_GET_ITEM(%in, 1));
</add-conversion>
</target-to-native>
</conversion-rule>
</container-type>
<!-- using generate="no" to avoid namespaced bindings, this puts types into module namespace -->
<namespace-type name="Katie" generate="no">
<enum-type name="QtMsgType"/>
<namespace-type name="Qt" generate="no">
<enum-type name="AlignmentFlag"/>
<enum-type name="AnchorAttribute"/>
<enum-type name="AnchorPoint"/>
<enum-type name="ApplicationAttribute"/>
<enum-type name="ArrowType"/>
<enum-type name="AspectRatioMode"/>
<enum-type name="Axis"/>
<enum-type name="BGMode"/>
<enum-type name="BrushStyle"/>
<enum-type name="CaseSensitivity"/>
<enum-type name="CheckState"/>
<enum-type name="ClipOperation"/>
<enum-type name="ConnectionType"/>
<enum-type name="ContextMenuPolicy"/>
<enum-type name="CoordinateSystem"/>
<enum-type name="Corner"/>
<enum-type name="CursorMoveStyle"/>
<enum-type name="CursorShape"/>
<enum-type name="DateFormat"/>
<enum-type name="DayOfWeek"/>
<enum-type name="DockWidgetArea"/>
<enum-type name="DockWidgetAreaSizes"/>
<enum-type name="DropAction"/>
<enum-type name="EventPriority"/>
<enum-type name="FillRule"/>
<enum-type name="FocusPolicy"/>
<enum-type name="FocusReason"/>
<enum-type name="GestureFlag"/>
<enum-type name="GestureState"/>
<enum-type name="GestureType"/>
<enum-type name="GlobalColor"/>
<enum-type name="ImageConversionFlag"/>
<enum-type name="Initialization"/>
<enum-type name="ItemDataRole"/>
<enum-type name="ItemFlag"/>
<enum-type name="ItemSelectionMode"/>
<enum-type name="Key"/>
<enum-type name="KeyboardModifier"/>
<enum-type name="LayoutDirection"/>
<enum-type name="MaskMode"/>
<enum-type name="MatchFlag"/>
<enum-type name="Modifier"/>
<enum-type name="MouseButton"/>
<enum-type name="NavigationMode"/>
<enum-type name="Orientation"/>
<enum-type name="PenCapStyle"/>
<enum-type name="PenJoinStyle"/>
<enum-type name="PenStyle"/>
<enum-type name="ScrollBarPolicy"/>
<enum-type name="ShortcutContext"/>
<enum-type name="SizeHint"/>
<enum-type name="SizeMode"/>
<enum-type name="SortOrder"/>
<enum-type name="TextElideMode"/>
<enum-type name="TextFlag"/>
<enum-type name="TextFormat"/>
<enum-type name="TextInteractionFlag"/>
<enum-type name="TileRule"/>
<enum-type name="TimeSpec"/>
<enum-type name="ToolBarArea"/>
<enum-type name="ToolBarAreaSizes"/>
<enum-type name="ToolButtonStyle"/>
<enum-type name="TouchPointState"/>
<enum-type name="TransformationMode"/>
<enum-type name="UIEffect"/>
<enum-type name="WidgetAttribute"/>
<enum-type name="WindowFrameSection"/>
<enum-type name="WindowModality"/>
<enum-type name="WindowState"/>
<enum-type name="WindowType"/>
</namespace-type>
<object-type name="QByteArray">
</object-type>
<object-type name="QChar">
<enum-type name="SpecialCharacter"/>
<enum-type name="Category"/>
<enum-type name="Direction"/>
<enum-type name="Decomposition"/>
<enum-type name="Joining"/>
<enum-type name="CombiningClass"/>
<enum-type name="UnicodeVersion"/>
</object-type>
<object-type name="QCoreApplication">
<modify-function signature="QCoreApplication(int &amp;, char**)">
<modify-argument index="1">
<remove-argument/>
<conversion-rule class="native">
int %out = PySequence_Size(%PYARG_1);
</conversion-rule>
</modify-argument>
<modify-argument index="2">
<replace-type modified-type="PySequence" />
<conversion-rule class="native">
Shiboken::AutoArrayPointer&lt;char*&gt; %out(%1);
for (int i = 0; i &lt; %1; ++i)
%out[i] = %CONVERTTOCPP[char*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
</conversion-rule>
</modify-argument>
</modify-function>
</object-type>
<object-type name="QObject">
</object-type>
<object-type name="QString">
<enum-type name="SectionFlag"/>
<primitive-type name="SectionFlags"/>
<enum-type name="SplitBehavior"/>
<enum-type name="NormalizationForm"/>
</object-type>
<object-type name="QLatin1Char">
</object-type>
<object-type name="QLatin1String">
</object-type>
</namespace-type>
</typesystem>

View file

@ -0,0 +1,82 @@
# - Try to find Shiboken
# Once done this will define
#
# SHIBOKEN_FOUND - system has Shiboken
# SHIBOKEN_INCLUDES - the Shiboken include directory
# SHIBOKEN_LIBRARIES - the libraries needed to use Shiboken
# SHIBOKEN_BINARY - the binary needed to use Shiboken
# SHIBOKEN_VERSION - the Shiboken version
if(SHIBOKEN_INCLUDES AND SHIBOKEN_LIBRARIES AND SHIBOKEN_BINARY)
set(SHIBOKEN_FIND_QUIETLY TRUE)
endif()
include(FindPkgConfig)
pkg_check_modules(PC_SHIBOKEN QUIET shiboken2)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=includedir shiboken2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE pkg_result
ERROR_VARIABLE pkg_error
OUTPUT_VARIABLE shiboken_includedir
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=python_include_dir shiboken2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE pkg_result
ERROR_VARIABLE pkg_error
OUTPUT_VARIABLE python_shiboken_include_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(SHIBOKEN_INCLUDES
${shiboken_includedir}
${python_shiboken_include_dir}
)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --libs shiboken2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE pkg_result
ERROR_VARIABLE pkg_error
OUTPUT_VARIABLE shiboken_libraries
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(SHIBOKEN_LIBRARIES)
foreach(lib ${shiboken_libraries})
# message(STATUS "shiboken_libraries: ${lib}")
set(SHIBOKEN_LIBRARIES
${SHIBOKEN_LIBRARIES}
${lib}
)
endforeach()
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=generator_location shiboken2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE pkg_result
ERROR_VARIABLE pkg_error
OUTPUT_VARIABLE SHIBOKEN_BINARY
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion shiboken2
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE pkg_result
ERROR_VARIABLE pkg_error
OUTPUT_VARIABLE SHIBOKEN_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Shiboken
VERSION_VAR SHIBOKEN_VERSION
REQUIRED_VARS SHIBOKEN_INCLUDES SHIBOKEN_LIBRARIES SHIBOKEN_BINARY
)
mark_as_advanced(SHIBOKEN_INCLUDES SHIBOKEN_LIBRARIES SHIBOKEN_BINARY)

View file

@ -291,3 +291,41 @@ macro(KATIE_TEST TESTNAME TESTSOURCES)
COMMAND ${CMAKE_BINARY_DIR}/runtest.sh ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}
)
endmacro()
# a macro to generate Python bindings sources
macro(KATANA_GENERATE_BINDINGS FORTARGET OUTPUTFILES)
set(outputfiles ${OUTPUTFILES} ${ARGN})
set(includedirs)
get_directory_property(dirincs INCLUDE_DIRECTORIES)
foreach(incdir ${SHIBOKEN_INCLUDES} ${dirincs})
if(NOT includedirs)
set(includedirs "${incdir}")
else()
set(includedirs "${includedirs}:${incdir}")
endif()
endforeach()
get_target_property(targetsources ${FORTARGET} SOURCES)
add_custom_command(
COMMENT "Generating Python bindings for: ${FORTARGET}"
COMMAND ${SHIBOKEN_BINARY}
--use-isnull-as-nb_nonzero
--enable-return-value-heuristic
--enable-parent-ctor-heuristic
--avoid-protected-hack
--include-paths="${includedirs}"
--output-directory="${CMAKE_SOURCE_DIR}/bindings"
--license-file="${CMAKE_SOURCE_DIR}/header.BSD"
"${CMAKE_SOURCE_DIR}/bindings/${FORTARGET}_global.hpp"
"${CMAKE_SOURCE_DIR}/bindings/typesystem_${FORTARGET}.xml"
DEPENDS
${FORTARGET}
${targetsources}
"${CMAKE_SOURCE_DIR}/bindings/${FORTARGET}_global.hpp"
"${CMAKE_SOURCE_DIR}/bindings/typesystem_${FORTARGET}.xml"
"${CMAKE_SOURCE_DIR}/header.BSD"
OUTPUT ${outputfiles}
)
set_source_files_properties(${outputfiles} PROPERTIES GENERATED TRUE)
set_source_files_properties(${outputfiles} PROPERTIES SKIP_AUTOGEN ON)
endmacro()