aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--headergenerator.cpp2
-rw-r--r--shibokengenerator.cpp13
-rw-r--r--shibokengenerator.h2
3 files changed, 16 insertions, 1 deletions
diff --git a/headergenerator.cpp b/headergenerator.cpp
index eb2e18083..de2965956 100644
--- a/headergenerator.cpp
+++ b/headergenerator.cpp
@@ -79,7 +79,7 @@ void HeaderGenerator::generateClass(QTextStream& s, const AbstractMetaClass* met
s << endl << '{' << endl << "public:" << endl;
- if (metaClass->hasCloneOperator())
+ if (isCopyable(metaClass))
writeCopyCtor(s, metaClass);
foreach (AbstractMetaFunction *func, filterFunctions(metaClass))
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 1ee65d94e..8a4a4eba0 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -1142,6 +1142,19 @@ QString ShibokenGenerator::getModuleHeaderFileName(QString modName) const
return QString("%1_python.h").arg(modName.toLower());
}
+bool ShibokenGenerator::isCopyable(const AbstractMetaClass *metaClass)
+
+{
+ if (metaClass->isNamespace())
+ return false;
+ else if (metaClass->typeEntry()->copyable() == ComplexTypeEntry::Unknown)
+ return metaClass->hasCloneOperator();
+ else
+ return (metaClass->typeEntry()->copyable() == ComplexTypeEntry::CopyableSet);
+
+ return false;
+}
+
/*
static void dumpFunction(AbstractMetaFunctionList lst)
{
diff --git a/shibokengenerator.h b/shibokengenerator.h
index b46d63d23..4822b8574 100644
--- a/shibokengenerator.h
+++ b/shibokengenerator.h
@@ -279,6 +279,8 @@ public:
bool usePySideExtensions() const;
protected:
bool doSetup(const QMap<QString, QString>& args);
+ // verify whether the class is copyable
+ bool isCopyable(const AbstractMetaClass* metaClass);
bool m_native_jump_table;
static QHash<QString, QString> m_pythonPrimitiveTypeName;