|
@@ -34,6 +34,7 @@ namespace qtprotobuf {
|
|
|
static const char *PreambleTemplate = "/* This file is autogenerated. DO NOT CHANGE. All changes will be lost */\n\n"
|
|
|
"#pragma once\n\n"
|
|
|
"#include <QObject>\n"
|
|
|
+ "#include <protobufobject.h>\n"
|
|
|
"#include <unordered_map>\n\n";
|
|
|
|
|
|
static const char *InternalIncludeTemplate = "#include \"$type_lower$.h\"\n";
|
|
@@ -43,7 +44,7 @@ static const char *UniversalListModelIncludeTemplate = "\n#include <universallis
|
|
|
|
|
|
static const char *NamespaceTemplate = "\nnamespace $namespace$ {\n";
|
|
|
|
|
|
-static const char *ClassDefinitionTemplate = "\nclass $classname$ : public QObject\n"
|
|
|
+static const char *ClassDefinitionTemplate = "\nclass $classname$ : public ProtobufObject<$classname$>\n"
|
|
|
"{\n"
|
|
|
" Q_OBJECT\n";
|
|
|
|
|
@@ -52,9 +53,9 @@ static const char *MemberTemplate = "$type$ m_$property_name$;\n";
|
|
|
static const char *PublicBlockTemplate = "\npublic:\n";
|
|
|
static const char *EnumDefinitionTemplate = "enum $enum$ {\n";
|
|
|
static const char *EnumFieldTemplate = "$enumvalue$ = $value$,\n";
|
|
|
-static const char *ConstructorTemplate = "$classname$(QObject *parent = nullptr) : QObject(parent)\n";
|
|
|
-static const char *CopyConstructorTemplate = "$classname$(const $classname$ &other) : QObject() {\n";
|
|
|
-static const char *MoveConstructorTemplate = "$classname$($classname$ &&other) : QObject() {\n";
|
|
|
+static const char *ConstructorTemplate = "$classname$(QObject *parent = nullptr) : ProtobufObject(parent)\n";
|
|
|
+static const char *CopyConstructorTemplate = "$classname$(const $classname$ &other) : ProtobufObject() {\n";
|
|
|
+static const char *MoveConstructorTemplate = "$classname$($classname$ &&other) : ProtobufObject() {\n";
|
|
|
static const char *CopyFieldTemplate = "m_$property_name$ = other.m_$property_name$;\n";
|
|
|
static const char *MoveComplexFieldTemplate = "m_$property_name$ = std::move(other.m_$property_name$);\n";
|
|
|
static const char *MoveFieldTemplate = "m_$property_name$ = std::exchange(other.m_$property_name$, 0);\n";
|