PythonQt
Classes | Macros | Typedefs | Functions
PythonQt.h File Reference
#include "PythonQtPythonInclude.h"
#include "PythonQtUtils.h"
#include "PythonQtSystem.h"
#include "PythonQtInstanceWrapper.h"
#include "PythonQtClassWrapper.h"
#include "PythonQtSlot.h"
#include "PythonQtObjectPtr.h"
#include "PythonQtStdIn.h"
#include "PythonQtThreadSupport.h"
#include <QObject>
#include <QVariant>
#include <QList>
#include <QHash>
#include <QByteArray>
#include <QStringList>
#include <QtDebug>
#include <iostream>

Go to the source code of this file.

Classes

class  PythonQtPassOwnershipToCPP< T >
 
class  PythonQtPassOwnershipToPython< T >
 
class  PythonQtNewOwnerOfThis< T >
 
class  PythonQt
 The main interface to the Python Qt binding, realized as a singleton. More...
 
class  PythonQtPrivate
 internal PythonQt details More...
 

Macros

#define QStringToPythonConstCharPointer(arg)   ((arg).toLatin1().constData())
 Helper define to convert from QString to Python C-API. More...
 
#define QStringToPythonCharPointer(arg)   ((arg).toLatin1().data())
 
#define QStringToPythonEncoding(arg)   ((arg).toLatin1())
 

Typedefs

typedef void PythonQtVoidPtrCB(void *object)
 
typedef void PythonQtQObjectWrappedCB(QObject *object)
 
typedef void PythonQtQObjectNoLongerWrappedCB(QObject *object)
 
typedef void * PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)
 
typedef QString PythonQtQObjectMissingAttributeCB(QObject *object, const QString &attribute)
 
typedef void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)
 
typedef QObject * PythonQtQObjectCreatorFunctionCB()
 callback to create a QObject lazily More...
 

Functions

template<class T >
void PythonQtSetInstanceWrapperOnShell (void *object, PythonQtInstanceWrapper *wrapper)
 
template<class T1 , class T2 >
int PythonQtUpcastingOffset ()
 returns the offset that needs to be added to upcast an object of type T1 to T2 More...
 
template<class T >
QObject * PythonQtCreateObject ()
 helper template to create a derived QObject class More...
 

Detailed Description

Author
Florian Link
Last changed by
Author
florian
Date
2006-05

Definition in file PythonQt.h.

Macro Definition Documentation

◆ QStringToPythonCharPointer

#define QStringToPythonCharPointer (   arg)    ((arg).toLatin1().data())

Definition at line 156 of file PythonQt.h.

◆ QStringToPythonConstCharPointer

#define QStringToPythonConstCharPointer (   arg)    ((arg).toLatin1().constData())

Helper define to convert from QString to Python C-API.

Definition at line 155 of file PythonQt.h.

◆ QStringToPythonEncoding

#define QStringToPythonEncoding (   arg)    ((arg).toLatin1())

Definition at line 157 of file PythonQt.h.

Typedef Documentation

◆ PythonQtPolymorphicHandlerCB

typedef void* PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)

Definition at line 76 of file PythonQt.h.

◆ PythonQtQObjectCreatorFunctionCB

typedef QObject* PythonQtQObjectCreatorFunctionCB()

callback to create a QObject lazily

Definition at line 144 of file PythonQt.h.

◆ PythonQtQObjectMissingAttributeCB

typedef QString PythonQtQObjectMissingAttributeCB(QObject *object, const QString &attribute)

Definition at line 77 of file PythonQt.h.

◆ PythonQtQObjectNoLongerWrappedCB

typedef void PythonQtQObjectNoLongerWrappedCB(QObject *object)

Definition at line 75 of file PythonQt.h.

◆ PythonQtQObjectWrappedCB

typedef void PythonQtQObjectWrappedCB(QObject *object)

Definition at line 74 of file PythonQt.h.

◆ PythonQtShellSetInstanceWrapperCB

typedef void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)

Definition at line 79 of file PythonQt.h.

◆ PythonQtVoidPtrCB

typedef void PythonQtVoidPtrCB(void *object)

Definition at line 73 of file PythonQt.h.

Function Documentation

◆ PythonQtCreateObject()

template<class T >
QObject* PythonQtCreateObject ( )

helper template to create a derived QObject class

Definition at line 147 of file PythonQt.h.

147 { return new T(); }

◆ PythonQtSetInstanceWrapperOnShell()

template<class T >
void PythonQtSetInstanceWrapperOnShell ( void *  object,
PythonQtInstanceWrapper wrapper 
)

Definition at line 81 of file PythonQt.h.

81  {
82  (reinterpret_cast<T*>(object))->_wrapper = wrapper;
83 }

◆ PythonQtUpcastingOffset()

template<class T1 , class T2 >
int PythonQtUpcastingOffset ( )

returns the offset that needs to be added to upcast an object of type T1 to T2

Definition at line 138 of file PythonQt.h.

138  {
139  return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
140  - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
141 }