From 691160943b282d10dbb1aad03dfd9a9bcc993e2e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 10 Jul 2024 11:52:59 +0300 Subject: [PATCH] Get rid of "protected" specifier and make visibility of the following members "private". --- src/app/tape/tkmmainwindow.h | 13 +++++---- src/app/tape/tmainwindow.h | 13 +++++---- src/libs/fervor/fvupdater.h | 27 +++++++++---------- src/libs/ifc/exception/vexceptionbadid.h | 2 +- .../ifc/exception/vexceptionconversionerror.h | 15 ++++++----- .../ifc/exception/vexceptionemptyparameter.h | 23 ++++++++-------- src/libs/vdxf/libdxfrw/drw_objects.h | 7 +++-- src/libs/vpatterndb/calculator.h | 7 +++-- .../dialogs/support/dialogeditwrongformula.h | 15 +++++------ .../dialogs/tools/piece/dialogseamallowance.h | 21 +++++++-------- src/libs/vwidgets/vgrainlineitem.h | 27 +++++++++---------- src/libs/vwidgets/vtextgraphicsitem.h | 19 +++++++------ 12 files changed, 91 insertions(+), 98 deletions(-) diff --git a/src/app/tape/tkmmainwindow.h b/src/app/tape/tkmmainwindow.h index e9edc47c6..7712940be 100644 --- a/src/app/tape/tkmmainwindow.h +++ b/src/app/tape/tkmmainwindow.h @@ -64,13 +64,6 @@ public: public slots: void ToolBarStyles(); -protected: - void closeEvent(QCloseEvent *event) override; - void changeEvent(QEvent *event) override; - auto eventFilter(QObject *object, QEvent *event) -> bool override; - void ExportToCSVData(const QString &fileName, bool withHeader, int mib, const QChar &separator) override; - auto RecentFileList() const -> QStringList override; - private slots: void FileNew(); void OpenKnownMeasurements(); @@ -191,6 +184,12 @@ private: auto CSVColumnHeader(int column) const -> QString; auto ReadCSV(const QxtCsvModel &csv, const QVector &map, bool withHeader) -> QVector; void ImportKnownMeasurements(const QxtCsvModel &csv, const QVector &map, bool withHeader); + + void closeEvent(QCloseEvent *event) override; + void changeEvent(QEvent *event) override; + auto eventFilter(QObject *object, QEvent *event) -> bool override; + void ExportToCSVData(const QString &fileName, bool withHeader, int mib, const QChar &separator) override; + auto RecentFileList() const -> QStringList override; }; #endif // TKMMAINWINDOW_H diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index bbff112fc..0de5479ff 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -76,13 +76,6 @@ public: public slots: void ToolBarStyles(); -protected: - void closeEvent(QCloseEvent *event) override; - void changeEvent(QEvent *event) override; - auto eventFilter(QObject *object, QEvent *event) -> bool override; - void ExportToCSVData(const QString &fileName, bool withHeader, int mib, const QChar &separator) override; - auto RecentFileList() const -> QStringList override; - private slots: void FileNew(); void OpenIndividual(); @@ -312,6 +305,12 @@ private: auto CSVColumnHeader(int column) const -> QString; void ExportRowToCSV(QxtCsvModel &csv, int row, const QSharedPointer &meash, const VKnownMeasurements &knownDB) const; + + void closeEvent(QCloseEvent *event) override; + void changeEvent(QEvent *event) override; + auto eventFilter(QObject *object, QEvent *event) -> bool override; + void ExportToCSVData(const QString &fileName, bool withHeader, int mib, const QChar &separator) override; + auto RecentFileList() const -> QStringList override; }; #endif // TMAINWINDOW_H diff --git a/src/libs/fervor/fvupdater.h b/src/libs/fervor/fvupdater.h index cd0e57ffa..96b11a3e0 100644 --- a/src/libs/fervor/fvupdater.h +++ b/src/libs/fervor/fvupdater.h @@ -62,10 +62,6 @@ public slots: bool CheckForUpdatesSilent(); // NOLINT(modernize-use-trailing-return-type) bool CheckForUpdatesNotSilent(); // NOLINT(modernize-use-trailing-return-type) -protected: - friend class FvUpdateWindow; // Uses GetProposedUpdate() and others - auto GetProposedUpdate() -> QPointer; - protected slots: // Update window button slots void InstallUpdate(); @@ -83,8 +79,8 @@ private: // Singleton business // Q_DISABLE_COPY_MOVE(FvUpdater) // NOLINT - FvUpdater(); // Hide main constructor - virtual ~FvUpdater(); // Hide main destructor + FvUpdater(); // Hide main constructor + virtual ~FvUpdater(); // Hide main destructor static QPointer m_Instance; // Singleton instance @@ -101,19 +97,19 @@ private: // // HTTP feed fetcher infrastructure // - QUrl m_feedURL; // Feed URL that will be fetched - QNetworkAccessManager m_qnam; + QUrl m_feedURL; // Feed URL that will be fetched + QNetworkAccessManager m_qnam; QPointer m_reply; - bool m_httpRequestAborted; - bool m_dropOnFinnish; + bool m_httpRequestAborted; + bool m_dropOnFinnish; - QXmlStreamReader m_xml; // XML data collector and parser + QXmlStreamReader m_xml; // XML data collector and parser - void showUpdaterWindowUpdatedWithCurrentUpdateProposal(); // Show updater window - void hideUpdaterWindow(); // Hide + destroy m_updaterWindow + void showUpdaterWindowUpdatedWithCurrentUpdateProposal(); // Show updater window + void hideUpdaterWindow(); // Hide + destroy m_updaterWindow void startDownloadFeed(const QUrl &url); // Start downloading feed - void cancelDownloadFeed(); // Stop downloading the current feed + void cancelDownloadFeed(); // Stop downloading the current feed // Dialogs (notifications) // Show an error message @@ -128,6 +124,9 @@ private: static auto VersionIsIgnored(const QString &version) -> bool; static void IgnoreVersion(const QString &version); static auto CurrentlyRunningOnPlatform(const QString &platform) -> bool; + + friend class FvUpdateWindow; // Uses GetProposedUpdate() and others + auto GetProposedUpdate() -> QPointer; }; #endif // FVUPDATER_H diff --git a/src/libs/ifc/exception/vexceptionbadid.h b/src/libs/ifc/exception/vexceptionbadid.h index 9b51d487f..5c8a2bc41 100644 --- a/src/libs/ifc/exception/vexceptionbadid.h +++ b/src/libs/ifc/exception/vexceptionbadid.h @@ -55,7 +55,7 @@ public: auto BadId() const -> quint32; auto BadKey() const -> QString; -protected: +private: /** @brief id id */ quint32 id; diff --git a/src/libs/ifc/exception/vexceptionconversionerror.h b/src/libs/ifc/exception/vexceptionconversionerror.h index cb99c6d13..d6bc79ecb 100644 --- a/src/libs/ifc/exception/vexceptionconversionerror.h +++ b/src/libs/ifc/exception/vexceptionconversionerror.h @@ -29,7 +29,6 @@ #ifndef VEXCEPTIONCONVERSIONERROR_H #define VEXCEPTIONCONVERSIONERROR_H - #include #include "../ifcdef.h" @@ -41,22 +40,24 @@ class VExceptionConversionError final : public VException { public: - VExceptionConversionError(const QString &error, const QString &str) V_NOEXCEPT_EXPR (true); - VExceptionConversionError(const VExceptionConversionError &e) V_NOEXCEPT_EXPR (true); + VExceptionConversionError(const QString &error, const QString &str) V_NOEXCEPT_EXPR(true); + VExceptionConversionError(const VExceptionConversionError &e) V_NOEXCEPT_EXPR(true); auto operator=(const VExceptionConversionError &e) V_NOEXCEPT_EXPR(true) -> VExceptionConversionError &; - virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR (true) = default; + virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR(true) = default; Q_NORETURN virtual void raise() const override { throw *this; } Q_REQUIRED_RESULT virtual auto clone() const -> VExceptionConversionError * override - { return new VExceptionConversionError(*this); } + { + return new VExceptionConversionError(*this); + } virtual auto ErrorMessage() const -> QString override; auto String() const -> QString; -protected: +private: /** @brief str string, where happend error */ - QString str; + QString str; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/ifc/exception/vexceptionemptyparameter.h b/src/libs/ifc/exception/vexceptionemptyparameter.h index 88a8be52c..7c094d42b 100644 --- a/src/libs/ifc/exception/vexceptionemptyparameter.h +++ b/src/libs/ifc/exception/vexceptionemptyparameter.h @@ -29,7 +29,6 @@ #ifndef VEXCEPTIONEMPTYPARAMETER_H #define VEXCEPTIONEMPTYPARAMETER_H - #include #include @@ -44,16 +43,18 @@ class QDomElement; class VExceptionEmptyParameter final : public VException { public: - VExceptionEmptyParameter(const QString &what, const QString &name, - const QDomElement &domElement) V_NOEXCEPT_EXPR (true); - VExceptionEmptyParameter(const VExceptionEmptyParameter &e) V_NOEXCEPT_EXPR (true); + VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement) + V_NOEXCEPT_EXPR(true); + VExceptionEmptyParameter(const VExceptionEmptyParameter &e) V_NOEXCEPT_EXPR(true); auto operator=(const VExceptionEmptyParameter &e) V_NOEXCEPT_EXPR(true) -> VExceptionEmptyParameter &; - virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) = default; + virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR(true) = default; Q_NORETURN virtual void raise() const override { throw *this; } Q_REQUIRED_RESULT virtual auto clone() const -> VExceptionEmptyParameter * override - { return new VExceptionEmptyParameter(*this); } + { + return new VExceptionEmptyParameter(*this); + } virtual auto ErrorMessage() const -> QString override; virtual auto DetailedInformation() const -> QString override; @@ -62,18 +63,18 @@ public: auto TagName() const -> QString; auto LineNumber() const -> qint32; -protected: +private: /** @brief name name attribute */ - QString name; + QString name; /** @brief tagText tag text */ - QString tagText; + QString tagText; /** @brief tagName tag name */ - QString tagName; + QString tagName; /** @brief lineNumber line number */ - qint32 lineNumber; + qint32 lineNumber; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vdxf/libdxfrw/drw_objects.h b/src/libs/vdxf/libdxfrw/drw_objects.h index 4a6ab7b61..0bddd7b0e 100644 --- a/src/libs/vdxf/libdxfrw/drw_objects.h +++ b/src/libs/vdxf/libdxfrw/drw_objects.h @@ -388,10 +388,6 @@ public: DRW_TableEntry::reset(); } -protected: - auto parseCode(int code, const std::unique_ptr &reader) -> bool override; - -public: UTF8STRING lineType; /*!< line type, code 6 */ int color; /*!< layer color, code 62 */ int color24; /*!< 24-bit color, code 420 */ @@ -399,6 +395,9 @@ public: DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */ std::string handlePlotS; /*!< Hard-pointer ID/handle of plotstyle, code 390 */ std::string handleMaterialS; /*!< Hard-pointer ID/handle of materialstyle, code 347 */ + +private: + auto parseCode(int code, const std::unique_ptr &reader) -> bool override; }; //! Class to handle block record entries diff --git a/src/libs/vpatterndb/calculator.h b/src/libs/vpatterndb/calculator.h index 513e9a397..344dd90f3 100644 --- a/src/libs/vpatterndb/calculator.h +++ b/src/libs/vpatterndb/calculator.h @@ -64,14 +64,13 @@ public: auto EvalFormula(const QHash> *vars, const QString &formula) -> qreal; -protected: - static auto VarFactory(const QString &a_szName, void *a_pUserData) -> qreal *; - static auto Warning(const QString &warningMsg, qreal value) -> qreal; - private: Q_DISABLE_COPY_MOVE(Calculator) // NOLINT QVector> m_varsValues{}; const QHash> *m_vars{nullptr}; + + static auto VarFactory(const QString &a_szName, void *a_pUserData) -> qreal *; + static auto Warning(const QString &warningMsg, qreal value) -> qreal; }; #endif // CALCULATOR_H diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h index a06fad0b4..5101d9beb 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h @@ -104,14 +104,6 @@ signals: */ void DialogApplied(); -protected: - virtual auto IsValid() const -> bool; - void closeEvent(QCloseEvent *event) override; - void showEvent(QShowEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void changeEvent(QEvent *event) override; - virtual void CheckState(); - private slots: void FilterVariablesEdited(const QString &filter); @@ -158,6 +150,13 @@ private: auto Eval(const FormulaData &formulaData, bool &flag) -> qreal; void InitIcons(); + + virtual auto IsValid() const -> bool; + void closeEvent(QCloseEvent *event) override; + void showEvent(QShowEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void changeEvent(QEvent *event) override; + virtual void CheckState(); }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h index 9e9a8828c..c9d2c6f6a 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h @@ -71,17 +71,6 @@ public slots: void ChosenObject(quint32 id, const SceneObject &type) override; void ShowDialog(bool click) override; -protected: - /** @brief SaveData Put dialog data in local variables */ - void SaveData() override; - void CheckState() override; - void closeEvent(QCloseEvent *event) override; - void showEvent(QShowEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void changeEvent(QEvent *event) override; - auto IsValid() const -> bool override; - void SetPatternDoc(VAbstractPattern *doc) override; - private slots: void NameDetailChanged(); void DetailUUIDChanged(); @@ -393,6 +382,16 @@ private: void InitFoldHeightFormula(const VPiece &piece); void InitFoldWidthFormula(const VPiece &piece); void InitFoldCenterFormula(const VPiece &piece); + + /** @brief SaveData Put dialog data in local variables */ + void SaveData() override; + void CheckState() override; + void closeEvent(QCloseEvent *event) override; + void showEvent(QShowEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void changeEvent(QEvent *event) override; + auto IsValid() const -> bool override; + void SetPatternDoc(VAbstractPattern *doc) override; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vwidgets/vgrainlineitem.h b/src/libs/vwidgets/vgrainlineitem.h index 9d2c1a77c..a795d1f2f 100644 --- a/src/libs/vwidgets/vgrainlineitem.h +++ b/src/libs/vwidgets/vgrainlineitem.h @@ -64,20 +64,6 @@ signals: void SignalResized(qreal dLength); void SignalRotated(qreal dRot, const QPointF &ptNewPos); -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *pME) override; - void mouseMoveEvent(QGraphicsSceneMouseEvent *pME) override; - void mouseReleaseEvent(QGraphicsSceneMouseEvent *pME) override; - void hoverEnterEvent(QGraphicsSceneHoverEvent *pME) override; - void hoverLeaveEvent(QGraphicsSceneHoverEvent *pME) override; - void Update() override; - void UpdateRectangle(); - - auto GetAngle(const QPointF &pt) const -> double override; - - static auto Rotate(const QPointF &pt, const QPointF &ptCenter, qreal dAng) -> QPointF; - auto GetInsideCorner(int i, qreal dDist) const -> QPointF; - private: Q_DISABLE_COPY_MOVE(VGrainlineItem) // NOLINT qreal m_dRotation{0}; @@ -106,6 +92,19 @@ private: void UserMoveAndResize(const QPointF &pos); void UpdatePolyResize(); + + void mousePressEvent(QGraphicsSceneMouseEvent *pME) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *pME) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *pME) override; + void hoverEnterEvent(QGraphicsSceneHoverEvent *pME) override; + void hoverLeaveEvent(QGraphicsSceneHoverEvent *pME) override; + void Update() override; + void UpdateRectangle(); + + auto GetAngle(const QPointF &pt) const -> double override; + + static auto Rotate(const QPointF &pt, const QPointF &ptCenter, qreal dAng) -> QPointF; + auto GetInsideCorner(int i, qreal dDist) const -> QPointF; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vwidgets/vtextgraphicsitem.h b/src/libs/vwidgets/vtextgraphicsitem.h index 9cd832c6c..04288658a 100644 --- a/src/libs/vwidgets/vtextgraphicsitem.h +++ b/src/libs/vwidgets/vtextgraphicsitem.h @@ -85,16 +85,6 @@ public: auto GetTextLines() const -> vsizetype; void SetPieceName(const QString &name); -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *pME) override; - void mouseMoveEvent(QGraphicsSceneMouseEvent *pME) override; - void mouseReleaseEvent(QGraphicsSceneMouseEvent *pME) override; - void hoverEnterEvent(QGraphicsSceneHoverEvent *pME) override; - void hoverMoveEvent(QGraphicsSceneHoverEvent *pHE) override; - - void UpdateBox(); - void CorrectLabel(); - signals: void SignalResized(qreal iTW); void SignalRotated(qreal dAng); @@ -125,6 +115,15 @@ private: void PaintLabelSVGFont(QPainter *painter); void NotEnoughSpace() const; + + void mousePressEvent(QGraphicsSceneMouseEvent *pME) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *pME) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *pME) override; + void hoverEnterEvent(QGraphicsSceneHoverEvent *pME) override; + void hoverMoveEvent(QGraphicsSceneHoverEvent *pHE) override; + + void UpdateBox(); + void CorrectLabel(); }; #endif // VTEXTGRAPHICSITEM_H