Skip to content

Commit 0b3cd63

Browse files
author
builder@murbella
committed
Replace complex typed static variables with getters
1 parent 949c056 commit 0b3cd63

7 files changed

+254
-186
lines changed

src/PythonQt.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ PythonQtPrivate::~PythonQtPrivate() {
337337
delete i.next().value();
338338
}
339339
}
340-
PythonQtConv::global_valueStorage.clear();
341-
PythonQtConv::global_ptrStorage.clear();
342-
PythonQtConv::global_variantStorage.clear();
340+
PythonQtConv::global_valueStorage().clear();
341+
PythonQtConv::global_ptrStorage().clear();
342+
PythonQtConv::global_variantStorage().clear();
343343

344344
PythonQtMethodInfo::cleanupCachedMethodInfos();
345345
}
@@ -1299,9 +1299,9 @@ PythonQtPrivate::PythonQtPrivate()
12991299
_systemExitExceptionHandlerEnabled = false;
13001300
_debugAPI = new PythonQtDebugAPI(this);
13011301

1302-
PythonQtConv::global_valueStorage.init();
1303-
PythonQtConv::global_ptrStorage.init();
1304-
PythonQtConv::global_variantStorage.init();
1302+
PythonQtConv::global_valueStorage().init();
1303+
PythonQtConv::global_ptrStorage().init();
1304+
PythonQtConv::global_variantStorage().init();
13051305
}
13061306

13071307
void PythonQtPrivate::setupSharedLibrarySuffixes()

src/PythonQtClassInfo.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
#include <QMetaObject>
4848
#include <QMetaEnum>
4949

50-
QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict;
51-
5250
PythonQtClassInfo::PythonQtClassInfo() {
5351
_meta = NULL;
5452
_constructors = NULL;

src/PythonQtConversion.cpp

Lines changed: 92 additions & 54 deletions
Large diffs are not rendered by default.

src/PythonQtConversion.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ class PYTHONQT_EXPORT PythonQtConv {
160160
static QString CPPObjectToString(int type, const void* data);
161161

162162
//! register a converter callback from python to cpp for given metatype
163-
static void registerPythonToMetaTypeConverter(int metaTypeId, PythonQtConvertPythonToMetaTypeCB* cb) { _pythonToMetaTypeConverters.insert(metaTypeId, cb); }
163+
static void registerPythonToMetaTypeConverter(int metaTypeId, PythonQtConvertPythonToMetaTypeCB* cb) { _pythonToMetaTypeConverters().insert(metaTypeId, cb); }
164164

165165
//! register a converter callback from cpp to python for given metatype
166-
static void registerMetaTypeToPythonConverter(int metaTypeId, PythonQtConvertMetaTypeToPythonCB* cb) { _metaTypeToPythonConverters.insert(metaTypeId, cb); }
166+
static void registerMetaTypeToPythonConverter(int metaTypeId, PythonQtConvertMetaTypeToPythonCB* cb) { _metaTypeToPythonConverters().insert(metaTypeId, cb); }
167167

168168
//! converts the Qt parameter given in \c data, interpreting it as a \c type registered qvariant/meta type, into a Python object,
169169
static PyObject* convertQtValueToPythonInternal(int type, const void* data);
@@ -182,13 +182,13 @@ class PYTHONQT_EXPORT PythonQtConv {
182182

183183
public:
184184

185-
static PythonQtValueStorage<qint64, 128> global_valueStorage;
186-
static PythonQtValueStorage<void*, 128> global_ptrStorage;
187-
static PythonQtValueStorageWithCleanup<QVariant, 128> global_variantStorage;
185+
static PythonQtValueStorage<qint64, 128>& global_valueStorage();
186+
static PythonQtValueStorage<void*, 128>& global_ptrStorage();
187+
static PythonQtValueStorageWithCleanup<QVariant, 128>& global_variantStorage();
188188

189189
protected:
190-
static QHash<int, PythonQtConvertMetaTypeToPythonCB*> _metaTypeToPythonConverters;
191-
static QHash<int, PythonQtConvertPythonToMetaTypeCB*> _pythonToMetaTypeConverters;
190+
static QHash<int, PythonQtConvertMetaTypeToPythonCB*>& _metaTypeToPythonConverters();
191+
static QHash<int, PythonQtConvertPythonToMetaTypeCB*>& _pythonToMetaTypeConverters();
192192

193193
//! handle automatic conversion of some special types (QColor, QBrush, ...)
194194
static void* handlePythonToQtAutoConversion(int typeId, PyObject* obj, void* alreadyAllocatedCPPObject);

src/PythonQtMethodInfo.cpp

Lines changed: 139 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,41 @@
4343
#include "PythonQtClassInfo.h"
4444
#include <iostream>
4545

46-
QHash<QByteArray, PythonQtMethodInfo*> PythonQtMethodInfo::_cachedSignatures;
47-
QHash<int, PythonQtMethodInfo::ParameterInfo> PythonQtMethodInfo::_cachedParameterInfos;
48-
QHash<QByteArray, QByteArray> PythonQtMethodInfo::_parameterNameAliases;
46+
QHash<QByteArray, int>& PythonQtMethodInfo::_parameterTypeDict()
47+
{
48+
static QHash<QByteArray, int>* _parameterTypeDict = 0;
49+
if (_parameterTypeDict == 0) {
50+
_parameterTypeDict = new QHash<QByteArray, int>;
51+
}
52+
return *_parameterTypeDict;
53+
}
54+
55+
QHash<QByteArray, QByteArray>& PythonQtMethodInfo::_parameterNameAliases()
56+
{
57+
static QHash<QByteArray, QByteArray>* _parameterNameAliases = 0;
58+
if (_parameterNameAliases == 0) {
59+
_parameterNameAliases = new QHash<QByteArray, QByteArray>;
60+
}
61+
return *_parameterNameAliases;
62+
}
63+
64+
QHash<QByteArray, PythonQtMethodInfo*>& PythonQtMethodInfo::_cachedSignatures()
65+
{
66+
static QHash<QByteArray, PythonQtMethodInfo*>* _cachedSignatures = 0;
67+
if (_cachedSignatures == 0) {
68+
_cachedSignatures = new QHash<QByteArray, PythonQtMethodInfo*>;
69+
}
70+
return *_cachedSignatures;
71+
}
72+
73+
QHash<int, PythonQtMethodInfo::ParameterInfo>& PythonQtMethodInfo::_cachedParameterInfos()
74+
{
75+
static QHash<int, PythonQtMethodInfo::ParameterInfo>* _cachedParameterInfos = 0;
76+
if (_cachedParameterInfos == 0) {
77+
_cachedParameterInfos = new QHash<int, PythonQtMethodInfo::ParameterInfo>;
78+
}
79+
return *_cachedParameterInfos;
80+
}
4981

5082
PythonQtMethodInfo::PythonQtMethodInfo(const QMetaMethod& meta, PythonQtClassInfo* classInfo)
5183
{
@@ -82,10 +114,10 @@ const PythonQtMethodInfo* PythonQtMethodInfo::getCachedMethodInfo(const QMetaMet
82114
QByteArray sig(PythonQtUtils::signature(signal));
83115
sig = sig.mid(sig.indexOf('('));
84116
QByteArray fullSig = QByteArray(signal.typeName()) + " " + sig;
85-
PythonQtMethodInfo* result = _cachedSignatures.value(fullSig);
117+
PythonQtMethodInfo* result = _cachedSignatures().value(fullSig);
86118
if (!result) {
87119
result = new PythonQtMethodInfo(signal, classInfo);
88-
_cachedSignatures.insert(fullSig, result);
120+
_cachedSignatures().insert(fullSig, result);
89121
}
90122
return result;
91123
}
@@ -105,10 +137,10 @@ const PythonQtMethodInfo* PythonQtMethodInfo::getCachedMethodInfoFromArgumentLis
105137
arguments << arg;
106138
}
107139
fullSig += ")";
108-
PythonQtMethodInfo* result = _cachedSignatures.value(fullSig);
140+
PythonQtMethodInfo* result = _cachedSignatures().value(fullSig);
109141
if (!result) {
110142
result = new PythonQtMethodInfo(typeName, arguments);
111-
_cachedSignatures.insert(fullSig, result);
143+
_cachedSignatures().insert(fullSig, result);
112144
}
113145
return result;
114146
}
@@ -166,7 +198,7 @@ void PythonQtMethodInfo::fillParameterInfo(ParameterInfo& type, const QByteArray
166198
type.pointerCount = pointerCount;
167199
type.isReference = hadReference;
168200

169-
QByteArray alias = _parameterNameAliases.value(name);
201+
QByteArray alias = _parameterNameAliases().value(name);
170202
if (!alias.isEmpty()) {
171203
name = alias;
172204
}
@@ -236,110 +268,110 @@ QByteArray PythonQtMethodInfo::getInnerTemplateTypeName(const QByteArray& typeNa
236268

237269
int PythonQtMethodInfo::nameToType(const char* name)
238270
{
239-
if (_parameterTypeDict.isEmpty()) {
271+
if (_parameterTypeDict().isEmpty()) {
240272
// we could also use QMetaType::nameToType, but that does a string compare search
241273
// and does not support QVariant
242274

243275
// QMetaType names
244-
_parameterTypeDict.insert("long", QMetaType::Long);
245-
_parameterTypeDict.insert("int", QMetaType::Int);
246-
_parameterTypeDict.insert("short", QMetaType::Short);
247-
_parameterTypeDict.insert("char", QMetaType::Char);
248-
_parameterTypeDict.insert("ulong", QMetaType::ULong);
249-
_parameterTypeDict.insert("unsigned long", QMetaType::ULong);
250-
_parameterTypeDict.insert("uint", QMetaType::UInt);
251-
_parameterTypeDict.insert("unsigned int", QMetaType::UInt);
252-
_parameterTypeDict.insert("ushort", QMetaType::UShort);
253-
_parameterTypeDict.insert("unsigned short", QMetaType::UShort);
254-
_parameterTypeDict.insert("uchar", QMetaType::UChar);
255-
_parameterTypeDict.insert("unsigned char", QMetaType::UChar);
256-
_parameterTypeDict.insert("bool", QMetaType::Bool);
257-
_parameterTypeDict.insert("float", QMetaType::Float);
258-
_parameterTypeDict.insert("double", QMetaType::Double);
259-
_parameterTypeDict.insert("qreal", QMetaType::Double);
260-
_parameterTypeDict.insert("QChar", QMetaType::QChar);
261-
_parameterTypeDict.insert("QByteArray", QMetaType::QByteArray);
262-
_parameterTypeDict.insert("QString", QMetaType::QString);
263-
_parameterTypeDict.insert("", QMetaType::Void);
264-
_parameterTypeDict.insert("void", QMetaType::Void);
265-
_parameterTypeDict.insert("QtMsgType", QMetaType::Int);
276+
_parameterTypeDict().insert("long", QMetaType::Long);
277+
_parameterTypeDict().insert("int", QMetaType::Int);
278+
_parameterTypeDict().insert("short", QMetaType::Short);
279+
_parameterTypeDict().insert("char", QMetaType::Char);
280+
_parameterTypeDict().insert("ulong", QMetaType::ULong);
281+
_parameterTypeDict().insert("unsigned long", QMetaType::ULong);
282+
_parameterTypeDict().insert("uint", QMetaType::UInt);
283+
_parameterTypeDict().insert("unsigned int", QMetaType::UInt);
284+
_parameterTypeDict().insert("ushort", QMetaType::UShort);
285+
_parameterTypeDict().insert("unsigned short", QMetaType::UShort);
286+
_parameterTypeDict().insert("uchar", QMetaType::UChar);
287+
_parameterTypeDict().insert("unsigned char", QMetaType::UChar);
288+
_parameterTypeDict().insert("bool", QMetaType::Bool);
289+
_parameterTypeDict().insert("float", QMetaType::Float);
290+
_parameterTypeDict().insert("double", QMetaType::Double);
291+
_parameterTypeDict().insert("qreal", QMetaType::Double);
292+
_parameterTypeDict().insert("QChar", QMetaType::QChar);
293+
_parameterTypeDict().insert("QByteArray", QMetaType::QByteArray);
294+
_parameterTypeDict().insert("QString", QMetaType::QString);
295+
_parameterTypeDict().insert("", QMetaType::Void);
296+
_parameterTypeDict().insert("void", QMetaType::Void);
297+
_parameterTypeDict().insert("QtMsgType", QMetaType::Int);
266298

267299
// GL types
268-
_parameterTypeDict.insert("GLenum", QMetaType::UInt);
269-
_parameterTypeDict.insert("GLboolean", QMetaType::UChar);
270-
_parameterTypeDict.insert("GLbitfield", QMetaType::UInt);
271-
_parameterTypeDict.insert("GLbyte", QMetaType::Char);
272-
_parameterTypeDict.insert("GLubyte", QMetaType::UChar);
273-
_parameterTypeDict.insert("GLshort", QMetaType::Short);
274-
_parameterTypeDict.insert("GLushort", QMetaType::UShort);
275-
_parameterTypeDict.insert("GLint", QMetaType::Int);
276-
_parameterTypeDict.insert("GLuint", QMetaType::UInt);
277-
_parameterTypeDict.insert("GLsizei", QMetaType::UInt);
278-
_parameterTypeDict.insert("GLclampf", QMetaType::Float);
279-
_parameterTypeDict.insert("GLfloat", QMetaType::Float);
280-
_parameterTypeDict.insert("GLclampd", QMetaType::Double);
281-
_parameterTypeDict.insert("GLdouble", QMetaType::Double);
282-
_parameterTypeDict.insert("GLvoid", QMetaType::Void);
300+
_parameterTypeDict().insert("GLenum", QMetaType::UInt);
301+
_parameterTypeDict().insert("GLboolean", QMetaType::UChar);
302+
_parameterTypeDict().insert("GLbitfield", QMetaType::UInt);
303+
_parameterTypeDict().insert("GLbyte", QMetaType::Char);
304+
_parameterTypeDict().insert("GLubyte", QMetaType::UChar);
305+
_parameterTypeDict().insert("GLshort", QMetaType::Short);
306+
_parameterTypeDict().insert("GLushort", QMetaType::UShort);
307+
_parameterTypeDict().insert("GLint", QMetaType::Int);
308+
_parameterTypeDict().insert("GLuint", QMetaType::UInt);
309+
_parameterTypeDict().insert("GLsizei", QMetaType::UInt);
310+
_parameterTypeDict().insert("GLclampf", QMetaType::Float);
311+
_parameterTypeDict().insert("GLfloat", QMetaType::Float);
312+
_parameterTypeDict().insert("GLclampd", QMetaType::Double);
313+
_parameterTypeDict().insert("GLdouble", QMetaType::Double);
314+
_parameterTypeDict().insert("GLvoid", QMetaType::Void);
283315
if (QT_POINTER_SIZE == 8) {
284-
_parameterTypeDict.insert("qgl_GLintptr", QMetaType::LongLong);
285-
_parameterTypeDict.insert("qgl_GLsizeiptr", QMetaType::LongLong);
286-
_parameterTypeDict.insert("size_t", QMetaType::ULongLong);
316+
_parameterTypeDict().insert("qgl_GLintptr", QMetaType::LongLong);
317+
_parameterTypeDict().insert("qgl_GLsizeiptr", QMetaType::LongLong);
318+
_parameterTypeDict().insert("size_t", QMetaType::ULongLong);
287319
} else {
288-
_parameterTypeDict.insert("qgl_GLintptr", QMetaType::Int);
289-
_parameterTypeDict.insert("qgl_GLsizeiptr", QMetaType::Int);
290-
_parameterTypeDict.insert("size_t", QMetaType::UInt);
320+
_parameterTypeDict().insert("qgl_GLintptr", QMetaType::Int);
321+
_parameterTypeDict().insert("qgl_GLsizeiptr", QMetaType::Int);
322+
_parameterTypeDict().insert("size_t", QMetaType::UInt);
291323
}
292324

293325
// QVariant names
294-
_parameterTypeDict.insert("Q_LLONG", QMetaType::LongLong);
295-
_parameterTypeDict.insert("Q_ULLONG", QMetaType::ULongLong);
296-
_parameterTypeDict.insert("qlonglong", QMetaType::LongLong);
297-
_parameterTypeDict.insert("qulonglong", QMetaType::ULongLong);
298-
_parameterTypeDict.insert("qint64", QMetaType::LongLong);
299-
_parameterTypeDict.insert("quint64", QMetaType::ULongLong);
300-
_parameterTypeDict.insert("QVariantHash", QMetaType::QVariantHash);
301-
_parameterTypeDict.insert("QVariantMap", QMetaType::QVariantMap);
302-
_parameterTypeDict.insert("QVariantList", QMetaType::QVariantList);
303-
_parameterTypeDict.insert("QHash<QString,QVariant>", QMetaType::QVariantHash);
304-
_parameterTypeDict.insert("QMap<QString,QVariant>", QMetaType::QVariantMap);
305-
_parameterTypeDict.insert("QList<QVariant>", QMetaType::QVariantList);
306-
_parameterTypeDict.insert("QStringList", QMetaType::QStringList);
307-
_parameterTypeDict.insert("QBitArray", QMetaType::QBitArray);
308-
_parameterTypeDict.insert("QDate", QMetaType::QDate);
309-
_parameterTypeDict.insert("QTime", QMetaType::QTime);
310-
_parameterTypeDict.insert("QDateTime", QMetaType::QDateTime);
311-
_parameterTypeDict.insert("QUrl", QMetaType::QUrl);
312-
_parameterTypeDict.insert("QLocale", QMetaType::QLocale);
313-
_parameterTypeDict.insert("QRect", QMetaType::QRect);
314-
_parameterTypeDict.insert("QRectF", QMetaType::QRectF);
315-
_parameterTypeDict.insert("QSize", QMetaType::QSize);
316-
_parameterTypeDict.insert("QSizeF", QMetaType::QSizeF);
317-
_parameterTypeDict.insert("QLine", QMetaType::QLine);
318-
_parameterTypeDict.insert("QLineF", QMetaType::QLineF);
319-
_parameterTypeDict.insert("QPoint", QMetaType::QPoint);
320-
_parameterTypeDict.insert("QPointF", QMetaType::QPointF);
321-
_parameterTypeDict.insert("QRegExp", QMetaType::QRegExp);
322-
_parameterTypeDict.insert("QFont", QMetaType::QFont);
323-
_parameterTypeDict.insert("QPixmap", QMetaType::QPixmap);
324-
_parameterTypeDict.insert("QBrush", QMetaType::QBrush);
325-
_parameterTypeDict.insert("QColor", QMetaType::QColor);
326-
_parameterTypeDict.insert("QCursor", QMetaType::QCursor);
327-
_parameterTypeDict.insert("QPalette", QMetaType::QPalette);
328-
_parameterTypeDict.insert("QIcon", QMetaType::QIcon);
329-
_parameterTypeDict.insert("QImage", QMetaType::QImage);
330-
_parameterTypeDict.insert("QRegion", QMetaType::QRegion);
331-
_parameterTypeDict.insert("QBitmap", QMetaType::QBitmap);
332-
_parameterTypeDict.insert("QSizePolicy", QMetaType::QSizePolicy);
333-
_parameterTypeDict.insert("QKeySequence", QMetaType::QKeySequence);
334-
_parameterTypeDict.insert("QPen", QMetaType::QPen);
335-
_parameterTypeDict.insert("QTextLength", QMetaType::QTextLength);
336-
_parameterTypeDict.insert("QTextFormat", QMetaType::QTextFormat);
337-
_parameterTypeDict.insert("QMatrix", QMetaType::QMatrix);
338-
_parameterTypeDict.insert("QVariant", PythonQtMethodInfo::Variant);
326+
_parameterTypeDict().insert("Q_LLONG", QMetaType::LongLong);
327+
_parameterTypeDict().insert("Q_ULLONG", QMetaType::ULongLong);
328+
_parameterTypeDict().insert("qlonglong", QMetaType::LongLong);
329+
_parameterTypeDict().insert("qulonglong", QMetaType::ULongLong);
330+
_parameterTypeDict().insert("qint64", QMetaType::LongLong);
331+
_parameterTypeDict().insert("quint64", QMetaType::ULongLong);
332+
_parameterTypeDict().insert("QVariantHash", QMetaType::QVariantHash);
333+
_parameterTypeDict().insert("QVariantMap", QMetaType::QVariantMap);
334+
_parameterTypeDict().insert("QVariantList", QMetaType::QVariantList);
335+
_parameterTypeDict().insert("QHash<QString,QVariant>", QMetaType::QVariantHash);
336+
_parameterTypeDict().insert("QMap<QString,QVariant>", QMetaType::QVariantMap);
337+
_parameterTypeDict().insert("QList<QVariant>", QMetaType::QVariantList);
338+
_parameterTypeDict().insert("QStringList", QMetaType::QStringList);
339+
_parameterTypeDict().insert("QBitArray", QMetaType::QBitArray);
340+
_parameterTypeDict().insert("QDate", QMetaType::QDate);
341+
_parameterTypeDict().insert("QTime", QMetaType::QTime);
342+
_parameterTypeDict().insert("QDateTime", QMetaType::QDateTime);
343+
_parameterTypeDict().insert("QUrl", QMetaType::QUrl);
344+
_parameterTypeDict().insert("QLocale", QMetaType::QLocale);
345+
_parameterTypeDict().insert("QRect", QMetaType::QRect);
346+
_parameterTypeDict().insert("QRectF", QMetaType::QRectF);
347+
_parameterTypeDict().insert("QSize", QMetaType::QSize);
348+
_parameterTypeDict().insert("QSizeF", QMetaType::QSizeF);
349+
_parameterTypeDict().insert("QLine", QMetaType::QLine);
350+
_parameterTypeDict().insert("QLineF", QMetaType::QLineF);
351+
_parameterTypeDict().insert("QPoint", QMetaType::QPoint);
352+
_parameterTypeDict().insert("QPointF", QMetaType::QPointF);
353+
_parameterTypeDict().insert("QRegExp", QMetaType::QRegExp);
354+
_parameterTypeDict().insert("QFont", QMetaType::QFont);
355+
_parameterTypeDict().insert("QPixmap", QMetaType::QPixmap);
356+
_parameterTypeDict().insert("QBrush", QMetaType::QBrush);
357+
_parameterTypeDict().insert("QColor", QMetaType::QColor);
358+
_parameterTypeDict().insert("QCursor", QMetaType::QCursor);
359+
_parameterTypeDict().insert("QPalette", QMetaType::QPalette);
360+
_parameterTypeDict().insert("QIcon", QMetaType::QIcon);
361+
_parameterTypeDict().insert("QImage", QMetaType::QImage);
362+
_parameterTypeDict().insert("QRegion", QMetaType::QRegion);
363+
_parameterTypeDict().insert("QBitmap", QMetaType::QBitmap);
364+
_parameterTypeDict().insert("QSizePolicy", QMetaType::QSizePolicy);
365+
_parameterTypeDict().insert("QKeySequence", QMetaType::QKeySequence);
366+
_parameterTypeDict().insert("QPen", QMetaType::QPen);
367+
_parameterTypeDict().insert("QTextLength", QMetaType::QTextLength);
368+
_parameterTypeDict().insert("QTextFormat", QMetaType::QTextFormat);
369+
_parameterTypeDict().insert("QMatrix", QMetaType::QMatrix);
370+
_parameterTypeDict().insert("QVariant", PythonQtMethodInfo::Variant);
339371
// own special types... (none so far, could be e.g. ObjectList
340372
}
341-
QHash<QByteArray, int>::const_iterator it = _parameterTypeDict.find(name);
342-
if (it!=_parameterTypeDict.end()) {
373+
QHash<QByteArray, int>::const_iterator it = _parameterTypeDict().find(name);
374+
if (it!=_parameterTypeDict().end()) {
343375
return it.value();
344376
} else {
345377
return PythonQtMethodInfo::Unknown;
@@ -348,29 +380,29 @@ int PythonQtMethodInfo::nameToType(const char* name)
348380

349381
void PythonQtMethodInfo::cleanupCachedMethodInfos()
350382
{
351-
QHashIterator<QByteArray, PythonQtMethodInfo *> i(_cachedSignatures);
383+
QHashIterator<QByteArray, PythonQtMethodInfo *> i(_cachedSignatures());
352384
while (i.hasNext()) {
353385
delete i.next().value();
354386
}
355-
_cachedSignatures.clear();
356-
_cachedParameterInfos.clear();
387+
_cachedSignatures().clear();
388+
_cachedParameterInfos().clear();
357389
}
358390

359391
void PythonQtMethodInfo::addParameterTypeAlias(const QByteArray& alias, const QByteArray& name)
360392
{
361-
_parameterNameAliases.insert(alias, name);
393+
_parameterNameAliases().insert(alias, name);
362394
}
363395

364396
const PythonQtMethodInfo::ParameterInfo& PythonQtMethodInfo::getParameterInfoForMetaType(int type)
365397
{
366-
QHash<int, ParameterInfo>::ConstIterator it = _cachedParameterInfos.find(type);
367-
if (it != _cachedParameterInfos.constEnd()) {
398+
QHash<int, ParameterInfo>::ConstIterator it = _cachedParameterInfos().find(type);
399+
if (it != _cachedParameterInfos().constEnd()) {
368400
return it.value();
369401
}
370402
ParameterInfo info;
371403
fillParameterInfo(info, QMetaType::typeName(type));
372-
_cachedParameterInfos.insert(type, info);
373-
return _cachedParameterInfos[type];
404+
_cachedParameterInfos().insert(type, info);
405+
return _cachedParameterInfos()[type];
374406
}
375407

376408
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)