From c9786ed7b7806309e5b349cf920a33b783a298b2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 9 Feb 2023 16:20:10 +0200 Subject: [PATCH] Refactoring. --- src/libs/ifc/xml/vbackgroundpatternimage.h | 2 - src/libs/qmuparser/qmudef.h | 1 + src/libs/qmuparser/qmuparserdef.h | 2 + src/libs/vmisc/qxtcsvmodel.h | 1 + src/libs/vpropertyexplorer/vproperty_p.h | 52 ++++++++++++------- .../vpropertyexplorer/vwidgetproperty_p.h | 2 +- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/libs/ifc/xml/vbackgroundpatternimage.h b/src/libs/ifc/xml/vbackgroundpatternimage.h index 21e7f54a1..79083dd88 100644 --- a/src/libs/ifc/xml/vbackgroundpatternimage.h +++ b/src/libs/ifc/xml/vbackgroundpatternimage.h @@ -33,8 +33,6 @@ #include #include -#include "../vmisc/typedef.h" - class QPixmap; class QMimeType; diff --git a/src/libs/qmuparser/qmudef.h b/src/libs/qmuparser/qmudef.h index 1dcb900b0..75c5b1058 100644 --- a/src/libs/qmuparser/qmudef.h +++ b/src/libs/qmuparser/qmudef.h @@ -23,6 +23,7 @@ #define QMUDEF_H #include "qmuparser_global.h" +#include "qmuparserdef.h" #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index 47d0d1f21..937e32314 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -28,7 +28,9 @@ #include #include +#ifdef __INTEL_COMPILER #include "qmuparserfixes.h" +#endif /** @file @brief This file contains standard definitions used by the parser. diff --git a/src/libs/vmisc/qxtcsvmodel.h b/src/libs/vmisc/qxtcsvmodel.h index 846b941c0..73b746721 100644 --- a/src/libs/vmisc/qxtcsvmodel.h +++ b/src/libs/vmisc/qxtcsvmodel.h @@ -49,6 +49,7 @@ #include "def.h" class QxtCsvModelPrivate; +class QTextCodec; class QxtCsvModel final : public QAbstractTableModel { diff --git a/src/libs/vpropertyexplorer/vproperty_p.h b/src/libs/vpropertyexplorer/vproperty_p.h index dd94d5a4f..c59b7eb37 100644 --- a/src/libs/vpropertyexplorer/vproperty_p.h +++ b/src/libs/vpropertyexplorer/vproperty_p.h @@ -41,48 +41,60 @@ public: //! This does not have to be used by subclasses, but it makes sense in cases where QVariant supports //! the data type. Also, this can be used as cache, so that when the data() function gets called by //! the model, the data does not have to be converted in a QVariant every time. - QVariant VariantValue; + QVariant VariantValue{}; // NOLINT(misc-non-private-member-variables-in-classes) //! Property name - QString Name; + QString Name{}; // NOLINT(misc-non-private-member-variables-in-classes) //! Description - QString Description; + QString Description{}; // NOLINT(misc-non-private-member-variables-in-classes) //! Specifies whether the property is empty or not - bool IsEmpty; + bool IsEmpty{false}; // NOLINT(misc-non-private-member-variables-in-classes) //! Stores the property type - QVariant::Type PropertyVariantType; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QMetaType::Type PropertyVariantType; // NOLINT(misc-non-private-member-variables-in-classes) +#else + QVariant::Type PropertyVariantType; // NOLINT(misc-non-private-member-variables-in-classes) +#endif //! Stores whether the views have to update the parent of this property if it changes - bool UpdateParent; + bool UpdateParent{false}; // NOLINT(misc-non-private-member-variables-in-classes) //! Stores whether the views have to update the children of this property if it changes - bool UpdateChildren; + bool UpdateChildren{false}; // NOLINT(misc-non-private-member-variables-in-classes) //! The parent property - VProperty* Parent; + VProperty* Parent{nullptr}; // NOLINT(misc-non-private-member-variables-in-classes) - QWidget* editor; + QWidget* editor{nullptr}; // NOLINT(misc-non-private-member-variables-in-classes) - Property type; + Property type{Property::Simple}; // NOLINT(misc-non-private-member-variables-in-classes) //! List of child properties - QList Children; + QList Children{}; // NOLINT(misc-non-private-member-variables-in-classes) //! Constructor passing name and type - VPropertyPrivate(const QString& name, QVariant::Type type) - : VariantValue(type), Name(name), Description(QString()), IsEmpty(false), PropertyVariantType(type), - UpdateParent(false), UpdateChildren(false), Parent(nullptr), editor(nullptr), type(Property::Simple), - Children(QList()) + VPropertyPrivate(const QString& name, +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QMetaType::Type type) + : VariantValue(QMetaType(type)), +#else + QVariant::Type type) + : VariantValue(type), +#endif + Name(name), + PropertyVariantType(type) {} //! Constructor - VPropertyPrivate() - : VariantValue(), Name(), Description(QString()), IsEmpty(false), PropertyVariantType(QVariant::Invalid), - UpdateParent(false), UpdateChildren(false), Parent(nullptr), editor(nullptr), type(Property::Simple), - Children(QList()) + VPropertyPrivate() +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + : PropertyVariantType(QMetaType::UnknownType) +#else + : PropertyVariantType(QVariant::Invalid) +#endif {} virtual ~VPropertyPrivate(); @@ -92,6 +104,6 @@ private: QT_WARNING_POP -} +} // namespace VPE #endif // VPROPERTY_P_H diff --git a/src/libs/vpropertyexplorer/vwidgetproperty_p.h b/src/libs/vpropertyexplorer/vwidgetproperty_p.h index fd5622eb3..8e41ca4da 100644 --- a/src/libs/vpropertyexplorer/vwidgetproperty_p.h +++ b/src/libs/vpropertyexplorer/vwidgetproperty_p.h @@ -69,6 +69,6 @@ public: QT_WARNING_POP -} +} // namespace VPE #endif // VWIDGETPROPERTY_P_H