From 067b17252ecdb61dfec1c808fc906e2b256da059 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Mon, 17 Jul 2023 10:30:44 +0200 Subject: [PATCH] [cpp-qt-client] Fix warning (#16083) * [cpp-qt-client] Fix warning * Handle warnings for MSVC * Add warning flags only for non-MSVC compilers * Fix warnings for MSVC compiler too --- .../cpp-qt-client/helpers-body.mustache | 2 +- .../cpp-qt-client/model-body.mustache | 26 +++--- .../cpp-qt-client/model-header.mustache | 2 +- .../resources/cpp-qt-client/object.mustache | 8 +- samples/client/petstore/cpp-qt/CMakeLists.txt | 6 ++ .../petstore/cpp-qt/client/PFXApiResponse.cpp | 30 +++---- .../petstore/cpp-qt/client/PFXApiResponse.h | 6 +- .../petstore/cpp-qt/client/PFXCategory.cpp | 20 ++--- .../petstore/cpp-qt/client/PFXCategory.h | 4 +- .../petstore/cpp-qt/client/PFXHelpers.cpp | 2 +- .../client/petstore/cpp-qt/client/PFXObject.h | 8 +- .../petstore/cpp-qt/client/PFXOrder.cpp | 60 +++++++------- .../client/petstore/cpp-qt/client/PFXOrder.h | 12 +-- .../client/petstore/cpp-qt/client/PFXPet.cpp | 72 ++++++++--------- .../client/petstore/cpp-qt/client/PFXPet.h | 12 +-- .../client/petstore/cpp-qt/client/PFXTag.cpp | 20 ++--- .../client/petstore/cpp-qt/client/PFXTag.h | 4 +- .../petstore/cpp-qt/client/PFXTestAnyType.cpp | 20 ++--- .../petstore/cpp-qt/client/PFXTestAnyType.h | 4 +- .../client/petstore/cpp-qt/client/PFXUser.cpp | 80 +++++++++---------- .../client/petstore/cpp-qt/client/PFXUser.h | 16 ++-- 21 files changed, 216 insertions(+), 198 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache index 707a93be139..134a55fe691 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/helpers-body.mustache @@ -225,7 +225,7 @@ bool fromStringValue(const QString &inStr, QByteArray &value) { } else { value.clear(); value.append(inStr.toUtf8()); - return value.size() > 0; + return !value.isEmpty(); } } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-body.mustache index 7eb6c0b5cb0..28e3f674e41 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-body.mustache @@ -46,9 +46,9 @@ void {{classname}}::fromJson(QString jsonString) { void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) { {{^isEnum}}{{#vars}}{{^isContainer}} - m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue(m_{{name}}, json[QString("{{baseName}}")]); m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/isContainer}}{{#isContainer}}{{^items.isContainer}} - m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue({{name}}, json[QString("{{baseName}}")]); + m_{{name}}_isValid = ::{{cppNamespace}}::fromJsonValue(m_{{name}}, json[QString("{{baseName}}")]); m_{{name}}_isSet = !json[QString("{{baseName}}")].isNull() && m_{{name}}_isValid;{{/items.isContainer}}{{#items.isContainer}}{{#isArray}} if(json["{{baseName}}"].isArray()){ auto arr = json["{{baseName}}"].toArray(); @@ -58,7 +58,7 @@ void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnu {{^items.isContainer}}{{items.baseType}}{{/items.isContainer}}{{#items.isArray}}QList<{{items.items.baseType}}>{{/items.isArray}}{{#items.isMap}}QMap{{/items.isMap}} item; m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); m_{{name}}_isSet = !jval.isNull() && m_{{name}}_isValid; - {{name}}.push_back(item); + m_{{name}}.push_back(item); } } }{{/isArray}}{{#isMap}} @@ -71,7 +71,7 @@ void {{classname}}::fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnu auto jval = QJsonValue::fromVariant(varmap.value(val)); m_{{name}}_isValid &= ::{{cppNamespace}}::fromJsonValue(item, jval); m_{{name}}_isSet &= !jval.isNull() && m_{{name}}_isValid; - {{name}}.insert({{name}}.end(), val, item); + m_{{name}}.insert(m_{{name}}.end(), val, item); } } }{{/isMap}}{{/items.isContainer}}{{/isContainer}}{{^-last}} @@ -100,24 +100,24 @@ QString {{classname}}::asJson() const { QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} {{classname}}::asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const { {{^isEnum}}QJsonObject obj;{{#vars}}{{^isContainer}}{{#complexType}} - if ({{name}}.isSet()){{/complexType}}{{^complexType}} + if (m_{{name}}.isSet()){{/complexType}}{{^complexType}} if (m_{{name}}_isSet){{/complexType}} { - obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}})); + obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue(m_{{name}})); }{{/isContainer}}{{#isContainer}} - if ({{name}}.size() > 0) { - {{^items.isContainer}}obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue({{name}}));{{/items.isContainer}}{{#items.isContainer}} - obj.insert(QString("{{baseName}}"), toJsonValue({{name}}));{{/items.isContainer}} + if (m_{{name}}.size() > 0) { + {{^items.isContainer}}obj.insert(QString("{{baseName}}"), ::{{cppNamespace}}::toJsonValue(m_{{name}}));{{/items.isContainer}}{{#items.isContainer}} + obj.insert(QString("{{baseName}}"), toJsonValue(m_{{name}}));{{/items.isContainer}} }{{/isContainer}}{{/vars}} return obj;{{/isEnum}}{{#isEnum}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{^isString}}return QJsonValue(static_cast(m_value));{{/isString}}{{#isString}}return QJsonValue(asJson());{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/isEnum}} } {{^isEnum}}{{#vars}}{{{dataType}}} {{classname}}::{{getter}}() const { - return {{name}}; + return m_{{name}}; } void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) { - this->{{name}} = {{name}}; - this->m_{{name}}_isSet = true; + m_{{name}} = {{name}}; + m_{{name}}_isSet = true; } bool {{classname}}::is_{{name}}_Set() const{ @@ -141,7 +141,7 @@ void {{classname}}::setValue(const {{classname}}::e{{classname}}& value){ bool {{classname}}::isSet() const { {{^isEnum}}bool isObjectUpdated = false; do { -{{#vars}} {{#isContainer}}if ({{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if ({{name}}.isSet()){{/complexType}}{{^complexType}}if (m_{{name}}_isSet){{/complexType}}{{/isContainer}} { +{{#vars}} {{#isContainer}}if (m_{{name}}.size() > 0){{/isContainer}}{{^isContainer}}{{#complexType}}if (m_{{name}}.isSet()){{/complexType}}{{^complexType}}if (m_{{name}}_isSet){{/complexType}}{{/isContainer}} { isObjectUpdated = true; break; }{{^-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache index 9179d3c7f7d..8b4a1a6d4d2 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache @@ -60,7 +60,7 @@ public: private: void initializeModel(); {{^isEnum}}{{#vars}} - {{{dataType}}} {{name}}; + {{{dataType}}} m_{{name}}; bool m_{{name}}_isSet; bool m_{{name}}_isValid; {{/vars}}{{/isEnum}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/object.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/object.mustache index 40a967d517c..6a6b3758a86 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/object.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/object.mustache @@ -54,7 +54,13 @@ inline bool operator==(const {{prefix}}Object& left, const {{prefix}}Object& rig return (left.asJsonObject() == right.asJsonObject()); } -inline uint qHash(const {{prefix}}Object& obj, uint seed = 0) noexcept{ +inline +#if QT_VERSION < 0x060000 +uint +#else +size_t +#endif +qHash(const {{prefix}}Object& obj, uint seed = 0) noexcept{ return qHash(obj.asJsonObject(), seed); } diff --git a/samples/client/petstore/cpp-qt/CMakeLists.txt b/samples/client/petstore/cpp-qt/CMakeLists.txt index 4ec3a21f490..938da937a9c 100644 --- a/samples/client/petstore/cpp-qt/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/CMakeLists.txt @@ -7,6 +7,12 @@ set(CMAKE_AUTOMOC ON) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network Gui Test) +if(MSVC) + add_compile_options(/W4 /WX) +else() + add_compile_options(-Wall -Wextra -Werror) +endif() + add_subdirectory(client) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test) diff --git a/samples/client/petstore/cpp-qt/client/PFXApiResponse.cpp b/samples/client/petstore/cpp-qt/client/PFXApiResponse.cpp index f7b652df278..8fbef0fb8c5 100644 --- a/samples/client/petstore/cpp-qt/client/PFXApiResponse.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXApiResponse.cpp @@ -52,13 +52,13 @@ void PFXApiResponse::fromJson(QString jsonString) { void PFXApiResponse::fromJsonObject(QJsonObject json) { - m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]); + m_code_isValid = ::test_namespace::fromJsonValue(m_code, json[QString("code")]); m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; - m_type_isValid = ::test_namespace::fromJsonValue(type, json[QString("type")]); + m_type_isValid = ::test_namespace::fromJsonValue(m_type, json[QString("type")]); m_type_isSet = !json[QString("type")].isNull() && m_type_isValid; - m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]); + m_message_isValid = ::test_namespace::fromJsonValue(m_message, json[QString("message")]); m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; } @@ -72,23 +72,23 @@ QString PFXApiResponse::asJson() const { QJsonObject PFXApiResponse::asJsonObject() const { QJsonObject obj; if (m_code_isSet) { - obj.insert(QString("code"), ::test_namespace::toJsonValue(code)); + obj.insert(QString("code"), ::test_namespace::toJsonValue(m_code)); } if (m_type_isSet) { - obj.insert(QString("type"), ::test_namespace::toJsonValue(type)); + obj.insert(QString("type"), ::test_namespace::toJsonValue(m_type)); } if (m_message_isSet) { - obj.insert(QString("message"), ::test_namespace::toJsonValue(message)); + obj.insert(QString("message"), ::test_namespace::toJsonValue(m_message)); } return obj; } qint32 PFXApiResponse::getCode() const { - return code; + return m_code; } void PFXApiResponse::setCode(const qint32 &code) { - this->code = code; - this->m_code_isSet = true; + m_code = code; + m_code_isSet = true; } bool PFXApiResponse::is_code_Set() const{ @@ -100,11 +100,11 @@ bool PFXApiResponse::is_code_Valid() const{ } QString PFXApiResponse::getType() const { - return type; + return m_type; } void PFXApiResponse::setType(const QString &type) { - this->type = type; - this->m_type_isSet = true; + m_type = type; + m_type_isSet = true; } bool PFXApiResponse::is_type_Set() const{ @@ -116,11 +116,11 @@ bool PFXApiResponse::is_type_Valid() const{ } QString PFXApiResponse::getMessage() const { - return message; + return m_message; } void PFXApiResponse::setMessage(const QString &message) { - this->message = message; - this->m_message_isSet = true; + m_message = message; + m_message_isSet = true; } bool PFXApiResponse::is_message_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXApiResponse.h b/samples/client/petstore/cpp-qt/client/PFXApiResponse.h index e4ba4d4dd08..dc768220656 100644 --- a/samples/client/petstore/cpp-qt/client/PFXApiResponse.h +++ b/samples/client/petstore/cpp-qt/client/PFXApiResponse.h @@ -59,15 +59,15 @@ public: private: void initializeModel(); - qint32 code; + qint32 m_code; bool m_code_isSet; bool m_code_isValid; - QString type; + QString m_type; bool m_type_isSet; bool m_type_isValid; - QString message; + QString m_message; bool m_message_isSet; bool m_message_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXCategory.cpp b/samples/client/petstore/cpp-qt/client/PFXCategory.cpp index f39272a12a3..1651c44c1c3 100644 --- a/samples/client/petstore/cpp-qt/client/PFXCategory.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXCategory.cpp @@ -49,10 +49,10 @@ void PFXCategory::fromJson(QString jsonString) { void PFXCategory::fromJsonObject(QJsonObject json) { - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(m_id, json[QString("id")]); m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isValid = ::test_namespace::fromJsonValue(m_name, json[QString("name")]); m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } @@ -66,20 +66,20 @@ QString PFXCategory::asJson() const { QJsonObject PFXCategory::asJsonObject() const { QJsonObject obj; if (m_id_isSet) { - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(m_id)); } if (m_name_isSet) { - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(m_name)); } return obj; } qint64 PFXCategory::getId() const { - return id; + return m_id; } void PFXCategory::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; + m_id = id; + m_id_isSet = true; } bool PFXCategory::is_id_Set() const{ @@ -91,11 +91,11 @@ bool PFXCategory::is_id_Valid() const{ } QString PFXCategory::getName() const { - return name; + return m_name; } void PFXCategory::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; + m_name = name; + m_name_isSet = true; } bool PFXCategory::is_name_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXCategory.h b/samples/client/petstore/cpp-qt/client/PFXCategory.h index 544a946b1d9..d86eee9a262 100644 --- a/samples/client/petstore/cpp-qt/client/PFXCategory.h +++ b/samples/client/petstore/cpp-qt/client/PFXCategory.h @@ -54,11 +54,11 @@ public: private: void initializeModel(); - qint64 id; + qint64 m_id; bool m_id_isSet; bool m_id_isValid; - QString name; + QString m_name; bool m_name_isSet; bool m_name_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp b/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp index a25beb3c517..464f53c6b30 100644 --- a/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXHelpers.cpp @@ -233,7 +233,7 @@ bool fromStringValue(const QString &inStr, QByteArray &value) { } else { value.clear(); value.append(inStr.toUtf8()); - return value.size() > 0; + return !value.isEmpty(); } } diff --git a/samples/client/petstore/cpp-qt/client/PFXObject.h b/samples/client/petstore/cpp-qt/client/PFXObject.h index e30bee0fd46..7b2e81b5344 100644 --- a/samples/client/petstore/cpp-qt/client/PFXObject.h +++ b/samples/client/petstore/cpp-qt/client/PFXObject.h @@ -62,7 +62,13 @@ inline bool operator==(const PFXObject& left, const PFXObject& right){ return (left.asJsonObject() == right.asJsonObject()); } -inline uint qHash(const PFXObject& obj, uint seed = 0) noexcept{ +inline +#if QT_VERSION < 0x060000 +uint +#else +size_t +#endif +qHash(const PFXObject& obj, uint seed = 0) noexcept{ return qHash(obj.asJsonObject(), seed); } diff --git a/samples/client/petstore/cpp-qt/client/PFXOrder.cpp b/samples/client/petstore/cpp-qt/client/PFXOrder.cpp index ccafb4c74c6..15f7e8c3601 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOrder.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXOrder.cpp @@ -61,22 +61,22 @@ void PFXOrder::fromJson(QString jsonString) { void PFXOrder::fromJsonObject(QJsonObject json) { - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(m_id, json[QString("id")]); m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - m_pet_id_isValid = ::test_namespace::fromJsonValue(pet_id, json[QString("petId")]); + m_pet_id_isValid = ::test_namespace::fromJsonValue(m_pet_id, json[QString("petId")]); m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid; - m_quantity_isValid = ::test_namespace::fromJsonValue(quantity, json[QString("quantity")]); + m_quantity_isValid = ::test_namespace::fromJsonValue(m_quantity, json[QString("quantity")]); m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid; - m_ship_date_isValid = ::test_namespace::fromJsonValue(ship_date, json[QString("shipDate")]); + m_ship_date_isValid = ::test_namespace::fromJsonValue(m_ship_date, json[QString("shipDate")]); m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid; - m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); + m_status_isValid = ::test_namespace::fromJsonValue(m_status, json[QString("status")]); m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; - m_complete_isValid = ::test_namespace::fromJsonValue(complete, json[QString("complete")]); + m_complete_isValid = ::test_namespace::fromJsonValue(m_complete, json[QString("complete")]); m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid; } @@ -90,32 +90,32 @@ QString PFXOrder::asJson() const { QJsonObject PFXOrder::asJsonObject() const { QJsonObject obj; if (m_id_isSet) { - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(m_id)); } if (m_pet_id_isSet) { - obj.insert(QString("petId"), ::test_namespace::toJsonValue(pet_id)); + obj.insert(QString("petId"), ::test_namespace::toJsonValue(m_pet_id)); } if (m_quantity_isSet) { - obj.insert(QString("quantity"), ::test_namespace::toJsonValue(quantity)); + obj.insert(QString("quantity"), ::test_namespace::toJsonValue(m_quantity)); } if (m_ship_date_isSet) { - obj.insert(QString("shipDate"), ::test_namespace::toJsonValue(ship_date)); + obj.insert(QString("shipDate"), ::test_namespace::toJsonValue(m_ship_date)); } if (m_status_isSet) { - obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); + obj.insert(QString("status"), ::test_namespace::toJsonValue(m_status)); } if (m_complete_isSet) { - obj.insert(QString("complete"), ::test_namespace::toJsonValue(complete)); + obj.insert(QString("complete"), ::test_namespace::toJsonValue(m_complete)); } return obj; } qint64 PFXOrder::getId() const { - return id; + return m_id; } void PFXOrder::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; + m_id = id; + m_id_isSet = true; } bool PFXOrder::is_id_Set() const{ @@ -127,11 +127,11 @@ bool PFXOrder::is_id_Valid() const{ } qint64 PFXOrder::getPetId() const { - return pet_id; + return m_pet_id; } void PFXOrder::setPetId(const qint64 &pet_id) { - this->pet_id = pet_id; - this->m_pet_id_isSet = true; + m_pet_id = pet_id; + m_pet_id_isSet = true; } bool PFXOrder::is_pet_id_Set() const{ @@ -143,11 +143,11 @@ bool PFXOrder::is_pet_id_Valid() const{ } qint32 PFXOrder::getQuantity() const { - return quantity; + return m_quantity; } void PFXOrder::setQuantity(const qint32 &quantity) { - this->quantity = quantity; - this->m_quantity_isSet = true; + m_quantity = quantity; + m_quantity_isSet = true; } bool PFXOrder::is_quantity_Set() const{ @@ -159,11 +159,11 @@ bool PFXOrder::is_quantity_Valid() const{ } QDateTime PFXOrder::getShipDate() const { - return ship_date; + return m_ship_date; } void PFXOrder::setShipDate(const QDateTime &ship_date) { - this->ship_date = ship_date; - this->m_ship_date_isSet = true; + m_ship_date = ship_date; + m_ship_date_isSet = true; } bool PFXOrder::is_ship_date_Set() const{ @@ -175,11 +175,11 @@ bool PFXOrder::is_ship_date_Valid() const{ } QString PFXOrder::getStatus() const { - return status; + return m_status; } void PFXOrder::setStatus(const QString &status) { - this->status = status; - this->m_status_isSet = true; + m_status = status; + m_status_isSet = true; } bool PFXOrder::is_status_Set() const{ @@ -191,11 +191,11 @@ bool PFXOrder::is_status_Valid() const{ } bool PFXOrder::isComplete() const { - return complete; + return m_complete; } void PFXOrder::setComplete(const bool &complete) { - this->complete = complete; - this->m_complete_isSet = true; + m_complete = complete; + m_complete_isSet = true; } bool PFXOrder::is_complete_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXOrder.h b/samples/client/petstore/cpp-qt/client/PFXOrder.h index 6ff0993304c..3d58afa70e3 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOrder.h +++ b/samples/client/petstore/cpp-qt/client/PFXOrder.h @@ -75,27 +75,27 @@ public: private: void initializeModel(); - qint64 id; + qint64 m_id; bool m_id_isSet; bool m_id_isValid; - qint64 pet_id; + qint64 m_pet_id; bool m_pet_id_isSet; bool m_pet_id_isValid; - qint32 quantity; + qint32 m_quantity; bool m_quantity_isSet; bool m_quantity_isValid; - QDateTime ship_date; + QDateTime m_ship_date; bool m_ship_date_isSet; bool m_ship_date_isValid; - QString status; + QString m_status; bool m_status_isSet; bool m_status_isValid; - bool complete; + bool m_complete; bool m_complete_isSet; bool m_complete_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXPet.cpp b/samples/client/petstore/cpp-qt/client/PFXPet.cpp index 0d06a35c39b..6f99209ba90 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPet.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPet.cpp @@ -61,22 +61,22 @@ void PFXPet::fromJson(QString jsonString) { void PFXPet::fromJsonObject(QJsonObject json) { - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(m_id, json[QString("id")]); m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - m_category_isValid = ::test_namespace::fromJsonValue(category, json[QString("category")]); + m_category_isValid = ::test_namespace::fromJsonValue(m_category, json[QString("category")]); m_category_isSet = !json[QString("category")].isNull() && m_category_isValid; - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isValid = ::test_namespace::fromJsonValue(m_name, json[QString("name")]); m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; - m_photo_urls_isValid = ::test_namespace::fromJsonValue(photo_urls, json[QString("photoUrls")]); + m_photo_urls_isValid = ::test_namespace::fromJsonValue(m_photo_urls, json[QString("photoUrls")]); m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid; - m_tags_isValid = ::test_namespace::fromJsonValue(tags, json[QString("tags")]); + m_tags_isValid = ::test_namespace::fromJsonValue(m_tags, json[QString("tags")]); m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid; - m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); + m_status_isValid = ::test_namespace::fromJsonValue(m_status, json[QString("status")]); m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; } @@ -90,32 +90,32 @@ QString PFXPet::asJson() const { QJsonObject PFXPet::asJsonObject() const { QJsonObject obj; if (m_id_isSet) { - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(m_id)); } - if (category.isSet()) { - obj.insert(QString("category"), ::test_namespace::toJsonValue(category)); + if (m_category.isSet()) { + obj.insert(QString("category"), ::test_namespace::toJsonValue(m_category)); } if (m_name_isSet) { - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(m_name)); } - if (photo_urls.size() > 0) { - obj.insert(QString("photoUrls"), ::test_namespace::toJsonValue(photo_urls)); + if (m_photo_urls.size() > 0) { + obj.insert(QString("photoUrls"), ::test_namespace::toJsonValue(m_photo_urls)); } - if (tags.size() > 0) { - obj.insert(QString("tags"), ::test_namespace::toJsonValue(tags)); + if (m_tags.size() > 0) { + obj.insert(QString("tags"), ::test_namespace::toJsonValue(m_tags)); } if (m_status_isSet) { - obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); + obj.insert(QString("status"), ::test_namespace::toJsonValue(m_status)); } return obj; } qint64 PFXPet::getId() const { - return id; + return m_id; } void PFXPet::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; + m_id = id; + m_id_isSet = true; } bool PFXPet::is_id_Set() const{ @@ -127,11 +127,11 @@ bool PFXPet::is_id_Valid() const{ } PFXCategory PFXPet::getCategory() const { - return category; + return m_category; } void PFXPet::setCategory(const PFXCategory &category) { - this->category = category; - this->m_category_isSet = true; + m_category = category; + m_category_isSet = true; } bool PFXPet::is_category_Set() const{ @@ -143,11 +143,11 @@ bool PFXPet::is_category_Valid() const{ } QString PFXPet::getName() const { - return name; + return m_name; } void PFXPet::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; + m_name = name; + m_name_isSet = true; } bool PFXPet::is_name_Set() const{ @@ -159,11 +159,11 @@ bool PFXPet::is_name_Valid() const{ } QList PFXPet::getPhotoUrls() const { - return photo_urls; + return m_photo_urls; } void PFXPet::setPhotoUrls(const QList &photo_urls) { - this->photo_urls = photo_urls; - this->m_photo_urls_isSet = true; + m_photo_urls = photo_urls; + m_photo_urls_isSet = true; } bool PFXPet::is_photo_urls_Set() const{ @@ -175,11 +175,11 @@ bool PFXPet::is_photo_urls_Valid() const{ } QList PFXPet::getTags() const { - return tags; + return m_tags; } void PFXPet::setTags(const QList &tags) { - this->tags = tags; - this->m_tags_isSet = true; + m_tags = tags; + m_tags_isSet = true; } bool PFXPet::is_tags_Set() const{ @@ -191,11 +191,11 @@ bool PFXPet::is_tags_Valid() const{ } QString PFXPet::getStatus() const { - return status; + return m_status; } void PFXPet::setStatus(const QString &status) { - this->status = status; - this->m_status_isSet = true; + m_status = status; + m_status_isSet = true; } bool PFXPet::is_status_Set() const{ @@ -214,7 +214,7 @@ bool PFXPet::isSet() const { break; } - if (category.isSet()) { + if (m_category.isSet()) { isObjectUpdated = true; break; } @@ -224,12 +224,12 @@ bool PFXPet::isSet() const { break; } - if (photo_urls.size() > 0) { + if (m_photo_urls.size() > 0) { isObjectUpdated = true; break; } - if (tags.size() > 0) { + if (m_tags.size() > 0) { isObjectUpdated = true; break; } diff --git a/samples/client/petstore/cpp-qt/client/PFXPet.h b/samples/client/petstore/cpp-qt/client/PFXPet.h index 3a5617940e1..86395d417ac 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPet.h +++ b/samples/client/petstore/cpp-qt/client/PFXPet.h @@ -79,27 +79,27 @@ public: private: void initializeModel(); - qint64 id; + qint64 m_id; bool m_id_isSet; bool m_id_isValid; - PFXCategory category; + PFXCategory m_category; bool m_category_isSet; bool m_category_isValid; - QString name; + QString m_name; bool m_name_isSet; bool m_name_isValid; - QList photo_urls; + QList m_photo_urls; bool m_photo_urls_isSet; bool m_photo_urls_isValid; - QList tags; + QList m_tags; bool m_tags_isSet; bool m_tags_isValid; - QString status; + QString m_status; bool m_status_isSet; bool m_status_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXTag.cpp b/samples/client/petstore/cpp-qt/client/PFXTag.cpp index 2f3e76a34ad..ea32dc81476 100644 --- a/samples/client/petstore/cpp-qt/client/PFXTag.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXTag.cpp @@ -49,10 +49,10 @@ void PFXTag::fromJson(QString jsonString) { void PFXTag::fromJsonObject(QJsonObject json) { - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(m_id, json[QString("id")]); m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); + m_name_isValid = ::test_namespace::fromJsonValue(m_name, json[QString("name")]); m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; } @@ -66,20 +66,20 @@ QString PFXTag::asJson() const { QJsonObject PFXTag::asJsonObject() const { QJsonObject obj; if (m_id_isSet) { - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(m_id)); } if (m_name_isSet) { - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); + obj.insert(QString("name"), ::test_namespace::toJsonValue(m_name)); } return obj; } qint64 PFXTag::getId() const { - return id; + return m_id; } void PFXTag::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; + m_id = id; + m_id_isSet = true; } bool PFXTag::is_id_Set() const{ @@ -91,11 +91,11 @@ bool PFXTag::is_id_Valid() const{ } QString PFXTag::getName() const { - return name; + return m_name; } void PFXTag::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; + m_name = name; + m_name_isSet = true; } bool PFXTag::is_name_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXTag.h b/samples/client/petstore/cpp-qt/client/PFXTag.h index 93d8a08b82d..808aab4519e 100644 --- a/samples/client/petstore/cpp-qt/client/PFXTag.h +++ b/samples/client/petstore/cpp-qt/client/PFXTag.h @@ -54,11 +54,11 @@ public: private: void initializeModel(); - qint64 id; + qint64 m_id; bool m_id_isSet; bool m_id_isValid; - QString name; + QString m_name; bool m_name_isSet; bool m_name_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXTestAnyType.cpp b/samples/client/petstore/cpp-qt/client/PFXTestAnyType.cpp index 671ed6fccdc..f0baa2c149e 100644 --- a/samples/client/petstore/cpp-qt/client/PFXTestAnyType.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXTestAnyType.cpp @@ -49,10 +49,10 @@ void PFXTestAnyType::fromJson(QString jsonString) { void PFXTestAnyType::fromJsonObject(QJsonObject json) { - m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]); + m_code_isValid = ::test_namespace::fromJsonValue(m_code, json[QString("code")]); m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; - m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]); + m_message_isValid = ::test_namespace::fromJsonValue(m_message, json[QString("message")]); m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; } @@ -66,20 +66,20 @@ QString PFXTestAnyType::asJson() const { QJsonObject PFXTestAnyType::asJsonObject() const { QJsonObject obj; if (m_code_isSet) { - obj.insert(QString("code"), ::test_namespace::toJsonValue(code)); + obj.insert(QString("code"), ::test_namespace::toJsonValue(m_code)); } if (m_message_isSet) { - obj.insert(QString("message"), ::test_namespace::toJsonValue(message)); + obj.insert(QString("message"), ::test_namespace::toJsonValue(m_message)); } return obj; } QJsonValue PFXTestAnyType::getCode() const { - return code; + return m_code; } void PFXTestAnyType::setCode(const QJsonValue &code) { - this->code = code; - this->m_code_isSet = true; + m_code = code; + m_code_isSet = true; } bool PFXTestAnyType::is_code_Set() const{ @@ -91,11 +91,11 @@ bool PFXTestAnyType::is_code_Valid() const{ } QString PFXTestAnyType::getMessage() const { - return message; + return m_message; } void PFXTestAnyType::setMessage(const QString &message) { - this->message = message; - this->m_message_isSet = true; + m_message = message; + m_message_isSet = true; } bool PFXTestAnyType::is_message_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXTestAnyType.h b/samples/client/petstore/cpp-qt/client/PFXTestAnyType.h index 45e6dae018c..b8a76d1fc96 100644 --- a/samples/client/petstore/cpp-qt/client/PFXTestAnyType.h +++ b/samples/client/petstore/cpp-qt/client/PFXTestAnyType.h @@ -55,11 +55,11 @@ public: private: void initializeModel(); - QJsonValue code; + QJsonValue m_code; bool m_code_isSet; bool m_code_isValid; - QString message; + QString m_message; bool m_message_isSet; bool m_message_isValid; }; diff --git a/samples/client/petstore/cpp-qt/client/PFXUser.cpp b/samples/client/petstore/cpp-qt/client/PFXUser.cpp index a3e9c648369..e466a42424c 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUser.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXUser.cpp @@ -67,28 +67,28 @@ void PFXUser::fromJson(QString jsonString) { void PFXUser::fromJsonObject(QJsonObject json) { - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); + m_id_isValid = ::test_namespace::fromJsonValue(m_id, json[QString("id")]); m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - m_username_isValid = ::test_namespace::fromJsonValue(username, json[QString("username")]); + m_username_isValid = ::test_namespace::fromJsonValue(m_username, json[QString("username")]); m_username_isSet = !json[QString("username")].isNull() && m_username_isValid; - m_first_name_isValid = ::test_namespace::fromJsonValue(first_name, json[QString("firstName")]); + m_first_name_isValid = ::test_namespace::fromJsonValue(m_first_name, json[QString("firstName")]); m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid; - m_last_name_isValid = ::test_namespace::fromJsonValue(last_name, json[QString("lastName")]); + m_last_name_isValid = ::test_namespace::fromJsonValue(m_last_name, json[QString("lastName")]); m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid; - m_email_isValid = ::test_namespace::fromJsonValue(email, json[QString("email")]); + m_email_isValid = ::test_namespace::fromJsonValue(m_email, json[QString("email")]); m_email_isSet = !json[QString("email")].isNull() && m_email_isValid; - m_password_isValid = ::test_namespace::fromJsonValue(password, json[QString("password")]); + m_password_isValid = ::test_namespace::fromJsonValue(m_password, json[QString("password")]); m_password_isSet = !json[QString("password")].isNull() && m_password_isValid; - m_phone_isValid = ::test_namespace::fromJsonValue(phone, json[QString("phone")]); + m_phone_isValid = ::test_namespace::fromJsonValue(m_phone, json[QString("phone")]); m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid; - m_user_status_isValid = ::test_namespace::fromJsonValue(user_status, json[QString("userStatus")]); + m_user_status_isValid = ::test_namespace::fromJsonValue(m_user_status, json[QString("userStatus")]); m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid; } @@ -102,38 +102,38 @@ QString PFXUser::asJson() const { QJsonObject PFXUser::asJsonObject() const { QJsonObject obj; if (m_id_isSet) { - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); + obj.insert(QString("id"), ::test_namespace::toJsonValue(m_id)); } if (m_username_isSet) { - obj.insert(QString("username"), ::test_namespace::toJsonValue(username)); + obj.insert(QString("username"), ::test_namespace::toJsonValue(m_username)); } if (m_first_name_isSet) { - obj.insert(QString("firstName"), ::test_namespace::toJsonValue(first_name)); + obj.insert(QString("firstName"), ::test_namespace::toJsonValue(m_first_name)); } if (m_last_name_isSet) { - obj.insert(QString("lastName"), ::test_namespace::toJsonValue(last_name)); + obj.insert(QString("lastName"), ::test_namespace::toJsonValue(m_last_name)); } if (m_email_isSet) { - obj.insert(QString("email"), ::test_namespace::toJsonValue(email)); + obj.insert(QString("email"), ::test_namespace::toJsonValue(m_email)); } if (m_password_isSet) { - obj.insert(QString("password"), ::test_namespace::toJsonValue(password)); + obj.insert(QString("password"), ::test_namespace::toJsonValue(m_password)); } if (m_phone_isSet) { - obj.insert(QString("phone"), ::test_namespace::toJsonValue(phone)); + obj.insert(QString("phone"), ::test_namespace::toJsonValue(m_phone)); } if (m_user_status_isSet) { - obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(user_status)); + obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(m_user_status)); } return obj; } qint64 PFXUser::getId() const { - return id; + return m_id; } void PFXUser::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; + m_id = id; + m_id_isSet = true; } bool PFXUser::is_id_Set() const{ @@ -145,11 +145,11 @@ bool PFXUser::is_id_Valid() const{ } QString PFXUser::getUsername() const { - return username; + return m_username; } void PFXUser::setUsername(const QString &username) { - this->username = username; - this->m_username_isSet = true; + m_username = username; + m_username_isSet = true; } bool PFXUser::is_username_Set() const{ @@ -161,11 +161,11 @@ bool PFXUser::is_username_Valid() const{ } QString PFXUser::getFirstName() const { - return first_name; + return m_first_name; } void PFXUser::setFirstName(const QString &first_name) { - this->first_name = first_name; - this->m_first_name_isSet = true; + m_first_name = first_name; + m_first_name_isSet = true; } bool PFXUser::is_first_name_Set() const{ @@ -177,11 +177,11 @@ bool PFXUser::is_first_name_Valid() const{ } QString PFXUser::getLastName() const { - return last_name; + return m_last_name; } void PFXUser::setLastName(const QString &last_name) { - this->last_name = last_name; - this->m_last_name_isSet = true; + m_last_name = last_name; + m_last_name_isSet = true; } bool PFXUser::is_last_name_Set() const{ @@ -193,11 +193,11 @@ bool PFXUser::is_last_name_Valid() const{ } QString PFXUser::getEmail() const { - return email; + return m_email; } void PFXUser::setEmail(const QString &email) { - this->email = email; - this->m_email_isSet = true; + m_email = email; + m_email_isSet = true; } bool PFXUser::is_email_Set() const{ @@ -209,11 +209,11 @@ bool PFXUser::is_email_Valid() const{ } QString PFXUser::getPassword() const { - return password; + return m_password; } void PFXUser::setPassword(const QString &password) { - this->password = password; - this->m_password_isSet = true; + m_password = password; + m_password_isSet = true; } bool PFXUser::is_password_Set() const{ @@ -225,11 +225,11 @@ bool PFXUser::is_password_Valid() const{ } QString PFXUser::getPhone() const { - return phone; + return m_phone; } void PFXUser::setPhone(const QString &phone) { - this->phone = phone; - this->m_phone_isSet = true; + m_phone = phone; + m_phone_isSet = true; } bool PFXUser::is_phone_Set() const{ @@ -241,11 +241,11 @@ bool PFXUser::is_phone_Valid() const{ } qint32 PFXUser::getUserStatus() const { - return user_status; + return m_user_status; } void PFXUser::setUserStatus(const qint32 &user_status) { - this->user_status = user_status; - this->m_user_status_isSet = true; + m_user_status = user_status; + m_user_status_isSet = true; } bool PFXUser::is_user_status_Set() const{ diff --git a/samples/client/petstore/cpp-qt/client/PFXUser.h b/samples/client/petstore/cpp-qt/client/PFXUser.h index a8ce7f8356a..5a3def81b53 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUser.h +++ b/samples/client/petstore/cpp-qt/client/PFXUser.h @@ -84,35 +84,35 @@ public: private: void initializeModel(); - qint64 id; + qint64 m_id; bool m_id_isSet; bool m_id_isValid; - QString username; + QString m_username; bool m_username_isSet; bool m_username_isValid; - QString first_name; + QString m_first_name; bool m_first_name_isSet; bool m_first_name_isValid; - QString last_name; + QString m_last_name; bool m_last_name_isSet; bool m_last_name_isValid; - QString email; + QString m_email; bool m_email_isSet; bool m_email_isValid; - QString password; + QString m_password; bool m_password_isSet; bool m_password_isValid; - QString phone; + QString m_phone; bool m_phone_isSet; bool m_phone_isValid; - qint32 user_status; + qint32 m_user_status; bool m_user_status_isSet; bool m_user_status_isValid; };