Skip to content

Commit e147814

Browse files
author
florianlink
committed
added support for size_t in properties and slots
git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@355 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent 27de3b9 commit e147814

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/PythonQt.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ void PythonQt::init(int flags, const QByteArray& pythonQtModuleName)
7979
qRegisterMetaType<QList<QObject*> >("QList<void*>");
8080
qRegisterMetaType<QObjectList>("QObjectList");
8181
qRegisterMetaType<QList<QObject*> >("QList<QObject*>");
82-
82+
if (QT_POINTER_SIZE == 8) {
83+
qRegisterMetaType<quint64>("size_t");
84+
} else {
85+
qRegisterMetaType<quint32>("size_t");
86+
}
8387
int stringRefId = qRegisterMetaType<QStringRef>("QStringRef");
8488
PythonQtConv::registerMetaTypeToPythonConverter(stringRefId, PythonQtConvertFromStringRef);
8589

src/PythonQtMethodInfo.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ int PythonQtMethodInfo::nameToType(const char* name)
262262
if (QT_POINTER_SIZE == 8) {
263263
_parameterTypeDict.insert("qgl_GLintptr", QMetaType::LongLong);
264264
_parameterTypeDict.insert("qgl_GLsizeiptr", QMetaType::LongLong);
265+
_parameterTypeDict.insert("size_t", QMetaType::ULongLong);
265266
} else {
266267
_parameterTypeDict.insert("qgl_GLintptr", QMetaType::Int);
267268
_parameterTypeDict.insert("qgl_GLsizeiptr", QMetaType::Int);
269+
_parameterTypeDict.insert("size_t", QMetaType::UInt);
268270
}
269271

270272
// QVariant names

0 commit comments

Comments
 (0)