Implemented support for classname on metaobject.
Export QMetaobject. Reviewer: Hugo Lima <hugo.lima@openbossa.org>
This commit is contained in:
parent
73b5357057
commit
b9ce558e29
7 changed files with 371 additions and 14 deletions
|
|
@ -39,6 +39,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlocale_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaclassinfo_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaclassinfo_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaenum_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaenum_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaproperty_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaproperty_wrapper.cpp
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaobject_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmimedata_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmimedata_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmodelindex_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmodelindex_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmutex_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmutex_wrapper.cpp
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,17 @@
|
||||||
<!-- We do not export QStreamManipulator, so use QTextStream.setRealNumberPrecision instead of this -->
|
<!-- We do not export QStreamManipulator, so use QTextStream.setRealNumberPrecision instead of this -->
|
||||||
<rejection class="" function-name="qSetRealNumberPrecision" />
|
<rejection class="" function-name="qSetRealNumberPrecision" />
|
||||||
|
|
||||||
|
<!-- TODO: We do not support void* or const void* as arg -->
|
||||||
|
<rejection class="QGenericArgument"/>
|
||||||
|
<rejection class="QMetaObject" function-name="activate"/>
|
||||||
|
<rejection class="QMetaObject" function-name="invokeMethod"/>
|
||||||
|
<rejection class="QMetaObject" function-name="newInstance"/>
|
||||||
|
<rejection class="QMetaObject" function-name="metacall"/>
|
||||||
|
<rejection class="QMetaObject" function-name="static_metacall"/>
|
||||||
|
<!-- TODO: Support to addGuard(QObject**) -->
|
||||||
|
<rejection class="QMetaObject" function-name="addGuard"/>
|
||||||
|
<rejection class="QMetaObject" function-name="changeGuard"/>
|
||||||
|
<rejection class="QMetaObject" function-name="removeGuard"/>
|
||||||
|
|
||||||
<rejection class="QFutureSynchronizer"/>
|
<rejection class="QFutureSynchronizer"/>
|
||||||
<rejection class="QByteArray" function-name="contains"/>
|
<rejection class="QByteArray" function-name="contains"/>
|
||||||
|
|
@ -684,7 +695,6 @@
|
||||||
<rejection class="reverse_iterator"/>
|
<rejection class="reverse_iterator"/>
|
||||||
<rejection class="stat"/>
|
<rejection class="stat"/>
|
||||||
<rejection class="tm"/>
|
<rejection class="tm"/>
|
||||||
<rejection class="*" function-name="metaObject"/>
|
|
||||||
<rejection class="QVariant" function-name="canConvert"/>
|
<rejection class="QVariant" function-name="canConvert"/>
|
||||||
<rejection class="QVariant" function-name="fromValue"/>
|
<rejection class="QVariant" function-name="fromValue"/>
|
||||||
<rejection class="QVariant" function-name="value"/>
|
<rejection class="QVariant" function-name="value"/>
|
||||||
|
|
@ -1257,7 +1267,11 @@
|
||||||
<include file-name="QCoreApplication" location="global"/>
|
<include file-name="QCoreApplication" location="global"/>
|
||||||
<include file-name="signalmanager.h" location="local" />
|
<include file-name="signalmanager.h" location="local" />
|
||||||
</extra-includes>
|
</extra-includes>
|
||||||
|
<modify-function signature="metaObject() const">
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
<modify-function signature="deleteLater()">
|
<modify-function signature="deleteLater()">
|
||||||
<modify-argument index="this">
|
<modify-argument index="this">
|
||||||
<define-ownership owner="c++"/>
|
<define-ownership owner="c++"/>
|
||||||
|
|
@ -2557,6 +2571,7 @@
|
||||||
</value-type>
|
</value-type>
|
||||||
<object-type name="QMetaObject">
|
<object-type name="QMetaObject">
|
||||||
<include file-name="qobjectdefs.h" location="global" />
|
<include file-name="qobjectdefs.h" location="global" />
|
||||||
|
<modify-function signature="connect(const QObject*, int, const QObject*, int, int, int*)" remove="all" />
|
||||||
</object-type>
|
</object-type>
|
||||||
<value-type name="QMetaProperty" >
|
<value-type name="QMetaProperty" >
|
||||||
<modify-function signature="enclosingMetaObject()const" remove="all" />
|
<modify-function signature="enclosingMetaObject()const" remove="all" />
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "qobjectdefs_pyside.h"
|
#include "qobjectdefs_pyside.h"
|
||||||
//#define Q_QDOC
|
//#define Q_QDOC
|
||||||
//#define qdoc
|
#define qdoc
|
||||||
//#undef Q_MOC_RUN
|
//#undef Q_MOC_RUN
|
||||||
|
|
||||||
//Export X11 related functions
|
//Export X11 related functions
|
||||||
|
|
|
||||||
335
PySide/qobjectdefs_pyside.h
Normal file
335
PySide/qobjectdefs_pyside.h
Normal file
|
|
@ -0,0 +1,335 @@
|
||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** Contact: Qt Software Information (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** This file is part of the QtCore module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** Commercial Usage
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain
|
||||||
|
** additional rights. These rights are described in the Nokia Qt LGPL
|
||||||
|
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
||||||
|
** package.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3.0 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU General Public License version 3.0 requirements will be
|
||||||
|
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at qt-sales@nokia.com.
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QOBJECTDEFS_PYSIDE_H
|
||||||
|
#define QOBJECTDEFS_PYSIDE_H
|
||||||
|
|
||||||
|
#include <QtCore/qnamespace.h>
|
||||||
|
|
||||||
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QT_MODULE(Core)
|
||||||
|
|
||||||
|
class QByteArray;
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
|
||||||
|
#ifndef Q_MOC_OUTPUT_REVISION
|
||||||
|
#define Q_MOC_OUTPUT_REVISION 61
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// macro for onaming members
|
||||||
|
#ifdef METHOD
|
||||||
|
#undef METHOD
|
||||||
|
#endif
|
||||||
|
#ifdef SLOT
|
||||||
|
#undef SLOT
|
||||||
|
#endif
|
||||||
|
#ifdef SIGNAL
|
||||||
|
#undef SIGNAL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Q_CORE_EXPORT const char *qFlagLocation(const char *method);
|
||||||
|
|
||||||
|
#define QTOSTRING_HELPER(s) #s
|
||||||
|
#define QTOSTRING(s) QTOSTRING_HELPER(s)
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
|
# define QLOCATION "\0"__FILE__":"QTOSTRING(__LINE__)
|
||||||
|
# define METHOD(a) qFlagLocation("0"#a QLOCATION)
|
||||||
|
# define SLOT(a) qFlagLocation("1"#a QLOCATION)
|
||||||
|
# define SIGNAL(a) qFlagLocation("2"#a QLOCATION)
|
||||||
|
#else
|
||||||
|
# define METHOD(a) "0"#a
|
||||||
|
# define SLOT(a) "1"#a
|
||||||
|
# define SIGNAL(a) "2"#a
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
#define METHOD_CODE 0 // member type codes
|
||||||
|
#define SLOT_CODE 1
|
||||||
|
#define SIGNAL_CODE 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define QMETHOD_CODE 0 // member type codes
|
||||||
|
#define QSLOT_CODE 1
|
||||||
|
#define QSIGNAL_CODE 2
|
||||||
|
|
||||||
|
#define Q_ARG(type, data) QArgument<type >(#type, data)
|
||||||
|
#define Q_RETURN_ARG(type, data) QReturnArgument<type >(#type, data)
|
||||||
|
|
||||||
|
class QObject;
|
||||||
|
class QMetaMethod;
|
||||||
|
class QMetaEnum;
|
||||||
|
class QMetaProperty;
|
||||||
|
class QMetaClassInfo;
|
||||||
|
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QGenericArgument
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QGenericArgument(const char *aName = 0, const void *aData = 0)
|
||||||
|
: _data(aData), _name(aName) {}
|
||||||
|
inline void *data() const { return const_cast<void *>(_data); }
|
||||||
|
inline const char *name() const { return _name; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
const void *_data;
|
||||||
|
const char *_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)
|
||||||
|
: QGenericArgument(aName, aData)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class QArgument: public QGenericArgument
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QArgument(const char *aName, const T &aData)
|
||||||
|
: QGenericArgument(aName, static_cast<const void *>(&aData))
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class QReturnArgument: public QGenericReturnArgument
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline QReturnArgument(const char *aName, T &aData)
|
||||||
|
: QGenericReturnArgument(aName, static_cast<void *>(&aData))
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Q_CORE_EXPORT QMetaObject
|
||||||
|
{
|
||||||
|
const char *className() const;
|
||||||
|
const QMetaObject *superClass() const;
|
||||||
|
|
||||||
|
QObject *cast(QObject *obj) const;
|
||||||
|
|
||||||
|
#ifndef QT_NO_TRANSLATION
|
||||||
|
// ### Qt 4: Merge overloads
|
||||||
|
QString tr(const char *s, const char *c) const;
|
||||||
|
QString trUtf8(const char *s, const char *c) const;
|
||||||
|
QString tr(const char *s, const char *c, int n) const;
|
||||||
|
QString trUtf8(const char *s, const char *c, int n) const;
|
||||||
|
#endif // QT_NO_TRANSLATION
|
||||||
|
|
||||||
|
int methodOffset() const;
|
||||||
|
int enumeratorOffset() const;
|
||||||
|
int propertyOffset() const;
|
||||||
|
int classInfoOffset() const;
|
||||||
|
|
||||||
|
int constructorCount() const;
|
||||||
|
int methodCount() const;
|
||||||
|
int enumeratorCount() const;
|
||||||
|
int propertyCount() const;
|
||||||
|
int classInfoCount() const;
|
||||||
|
|
||||||
|
int indexOfConstructor(const char *constructor) const;
|
||||||
|
int indexOfMethod(const char *method) const;
|
||||||
|
int indexOfSignal(const char *signal) const;
|
||||||
|
int indexOfSlot(const char *slot) const;
|
||||||
|
int indexOfEnumerator(const char *name) const;
|
||||||
|
int indexOfProperty(const char *name) const;
|
||||||
|
int indexOfClassInfo(const char *name) const;
|
||||||
|
|
||||||
|
QMetaMethod constructor(int index) const;
|
||||||
|
QMetaMethod method(int index) const;
|
||||||
|
QMetaEnum enumerator(int index) const;
|
||||||
|
QMetaProperty property(int index) const;
|
||||||
|
QMetaClassInfo classInfo(int index) const;
|
||||||
|
QMetaProperty userProperty() const;
|
||||||
|
|
||||||
|
static bool checkConnectArgs(const char *signal, const char *method);
|
||||||
|
static QByteArray normalizedSignature(const char *method);
|
||||||
|
static QByteArray normalizedType(const char *type);
|
||||||
|
|
||||||
|
// internal index-based connect
|
||||||
|
static bool connect(const QObject *sender, int signal_index,
|
||||||
|
const QObject *receiver, int method_index,
|
||||||
|
int type = 0, int *types = 0);
|
||||||
|
// internal index-based disconnect
|
||||||
|
static bool disconnect(const QObject *sender, int signal_index,
|
||||||
|
const QObject *receiver, int method_index);
|
||||||
|
// internal slot-name based connect
|
||||||
|
static void connectSlotsByName(QObject *o);
|
||||||
|
|
||||||
|
// internal index-based signal activation
|
||||||
|
static void activate(QObject *sender, int signal_index, void **argv);
|
||||||
|
static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);
|
||||||
|
static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);
|
||||||
|
static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);
|
||||||
|
// internal guarded pointers
|
||||||
|
static void addGuard(QObject **ptr);
|
||||||
|
static void removeGuard(QObject **ptr);
|
||||||
|
static void changeGuard(QObject **ptr, QObject *o);
|
||||||
|
|
||||||
|
static bool invokeMethod(QObject *obj, const char *member,
|
||||||
|
Qt::ConnectionType,
|
||||||
|
QGenericReturnArgument ret,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument());
|
||||||
|
|
||||||
|
static inline bool invokeMethod(QObject *obj, const char *member,
|
||||||
|
QGenericReturnArgument ret,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument())
|
||||||
|
{
|
||||||
|
return invokeMethod(obj, member, Qt::AutoConnection, ret, val0, val1, val2, val3,
|
||||||
|
val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool invokeMethod(QObject *obj, const char *member,
|
||||||
|
Qt::ConnectionType type,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument())
|
||||||
|
{
|
||||||
|
return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,
|
||||||
|
val3, val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool invokeMethod(QObject *obj, const char *member,
|
||||||
|
QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument())
|
||||||
|
{
|
||||||
|
return invokeMethod(obj, member, Qt::AutoConnection, QGenericReturnArgument(), val0,
|
||||||
|
val1, val2, val3, val4, val5, val6, val7, val8, val9);
|
||||||
|
}
|
||||||
|
|
||||||
|
QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),
|
||||||
|
QGenericArgument val1 = QGenericArgument(),
|
||||||
|
QGenericArgument val2 = QGenericArgument(),
|
||||||
|
QGenericArgument val3 = QGenericArgument(),
|
||||||
|
QGenericArgument val4 = QGenericArgument(),
|
||||||
|
QGenericArgument val5 = QGenericArgument(),
|
||||||
|
QGenericArgument val6 = QGenericArgument(),
|
||||||
|
QGenericArgument val7 = QGenericArgument(),
|
||||||
|
QGenericArgument val8 = QGenericArgument(),
|
||||||
|
QGenericArgument val9 = QGenericArgument()) const;
|
||||||
|
|
||||||
|
enum Call {
|
||||||
|
InvokeMetaMethod,
|
||||||
|
ReadProperty,
|
||||||
|
WriteProperty,
|
||||||
|
ResetProperty,
|
||||||
|
QueryPropertyDesignable,
|
||||||
|
QueryPropertyScriptable,
|
||||||
|
QueryPropertyStored,
|
||||||
|
QueryPropertyEditable,
|
||||||
|
QueryPropertyUser,
|
||||||
|
CreateInstance
|
||||||
|
};
|
||||||
|
|
||||||
|
int static_metacall(Call, int, void **) const;
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
QT3_SUPPORT const char *superClassName() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct { // private data
|
||||||
|
const QMetaObject *superdata;
|
||||||
|
const char *stringdata;
|
||||||
|
const uint *data;
|
||||||
|
const void *extradata;
|
||||||
|
} d;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct QMetaObjectExtraData
|
||||||
|
{
|
||||||
|
const QMetaObject **objects;
|
||||||
|
int (*static_metacall)(QMetaObject::Call, int, void **);
|
||||||
|
};
|
||||||
|
|
||||||
|
inline const char *QMetaObject::className() const
|
||||||
|
{ return d.stringdata; }
|
||||||
|
|
||||||
|
inline const QMetaObject *QMetaObject::superClass() const
|
||||||
|
{ return d.superdata; }
|
||||||
|
|
||||||
|
#ifdef QT3_SUPPORT
|
||||||
|
inline const char *QMetaObject::superClassName() const
|
||||||
|
{ return d.superdata ? d.superdata->className() : 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_END_HEADER
|
||||||
|
|
||||||
|
#endif // QOBJECTDEFS_H
|
||||||
|
|
@ -55,12 +55,13 @@ static int registerString(const QByteArray& s, QList<QByteArray>* strings)
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicQMetaObject::DynamicQMetaObject(const QMetaObject* metaObject)
|
DynamicQMetaObject::DynamicQMetaObject(const char *className, const QMetaObject* metaObject)
|
||||||
{
|
{
|
||||||
d.superdata = metaObject;
|
d.superdata = metaObject;
|
||||||
d.stringdata = 0;
|
d.stringdata = 0;
|
||||||
d.data = 0;
|
d.data = 0;
|
||||||
d.extradata = 0;
|
d.extradata = 0;
|
||||||
|
m_className = QByteArray(className);
|
||||||
updateMetaObject();
|
updateMetaObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,13 +101,16 @@ void DynamicQMetaObject::updateMetaObject()
|
||||||
|
|
||||||
uint n_signals = m_signals.count();
|
uint n_signals = m_signals.count();
|
||||||
uint n_methods = n_signals + m_slots.count();
|
uint n_methods = n_signals + m_slots.count();
|
||||||
int header[] = {2, // revision
|
int header[] = {5, // revision
|
||||||
0, // class name index in m_metadata
|
0, // class name index in m_metadata
|
||||||
0, 0, // classinfo and classinfo index, not used by us
|
0, 0, // classinfo and classinfo index, not used by us
|
||||||
n_methods, 0, // method count and method list index
|
n_methods, 0, // method count and method list index
|
||||||
0, 0, // prop count and prop indexes
|
0, 0, // prop count and prop indexes
|
||||||
0, 0 // enum count and enum index
|
0, 0, // enum count and enum index
|
||||||
};
|
0, 0, // constructors
|
||||||
|
0, // flags
|
||||||
|
n_signals // signalCount
|
||||||
|
};
|
||||||
|
|
||||||
const int HEADER_LENGHT = sizeof(header)/sizeof(int);
|
const int HEADER_LENGHT = sizeof(header)/sizeof(int);
|
||||||
header[5] = HEADER_LENGHT;
|
header[5] = HEADER_LENGHT;
|
||||||
|
|
@ -117,7 +121,7 @@ void DynamicQMetaObject::updateMetaObject()
|
||||||
std::memcpy(data, header, sizeof(header));
|
std::memcpy(data, header, sizeof(header));
|
||||||
|
|
||||||
QList<QByteArray> strings;
|
QList<QByteArray> strings;
|
||||||
registerString(d.superdata->className(), &strings); // register class string
|
registerString(m_className, &strings); // register class string
|
||||||
const int NULL_INDEX = registerString("", &strings); // register a null string
|
const int NULL_INDEX = registerString("", &strings); // register a null string
|
||||||
int index = HEADER_LENGHT;
|
int index = HEADER_LENGHT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace PySide
|
||||||
class PYSIDE_API DynamicQMetaObject : public QMetaObject
|
class PYSIDE_API DynamicQMetaObject : public QMetaObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DynamicQMetaObject(const QMetaObject* metaObject);
|
DynamicQMetaObject(const char* className, const QMetaObject* metaObject);
|
||||||
~DynamicQMetaObject();
|
~DynamicQMetaObject();
|
||||||
void addSignal(const char* signal);
|
void addSignal(const char* signal);
|
||||||
void addSlot(const char* slot);
|
void addSlot(const char* slot);
|
||||||
|
|
@ -56,6 +56,7 @@ public:
|
||||||
private:
|
private:
|
||||||
QLinkedList<QByteArray> m_signals;
|
QLinkedList<QByteArray> m_signals;
|
||||||
QLinkedList<QByteArray> m_slots;
|
QLinkedList<QByteArray> m_slots;
|
||||||
|
QByteArray m_className;
|
||||||
|
|
||||||
void updateMetaObject();
|
void updateMetaObject();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@
|
||||||
|
|
||||||
using namespace PySide;
|
using namespace PySide;
|
||||||
|
|
||||||
GlobalReceiver::GlobalReceiver() : m_metaObject(&QObject::staticMetaObject)
|
GlobalReceiver::GlobalReceiver()
|
||||||
|
: m_metaObject("GlobalReceiver", &QObject::staticMetaObject)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue