From a40836dbf95fd0e96e7cd87ce30098b8127ce5a1 Mon Sep 17 00:00:00 2001 From: Adrian Carpenter Date: Sat, 15 May 2021 17:49:14 +0100 Subject: [PATCH] chore: doxygen refactoring --- contributing.md | 2 +- src/RibbonButton.h | 7 +++++-- src/RibbonButtonPlugin.h | 6 +++++- src/RibbonCheckBox.h | 6 +++++- src/RibbonCheckBoxPlugin.h | 6 +++++- src/RibbonComboBox.h | 6 +++++- src/RibbonComboBoxPlugin.h | 6 +++++- src/RibbonDropButton.h | 18 +++++++++++++----- src/RibbonDropButtonPlugin.h | 6 +++++- src/RibbonFontManager.h | 8 ++++++-- src/RibbonGroup.h | 16 ++++++++++++---- src/RibbonGroupPlugin.h | 6 +++++- src/RibbonLineEdit.h | 14 +++++++++----- src/RibbonLineEditPlugin.h | 6 +++++- src/RibbonPushButton.h | 18 +++++++++++++----- src/RibbonPushButtonPlugin.h | 6 +++++- src/RibbonSlider.h | 6 +++++- src/RibbonSliderPlugin.h | 6 +++++- src/RibbonTabBar.h | 12 ++++++++---- src/RibbonToolButton.h | 6 +++++- src/RibbonToolButtonPlugin.h | 6 +++++- src/RibbonWidget.h | 22 +++++++++++++--------- src/RibbonWidgetPlugin.h | 6 +++++- src/RibbonWidgetsCollection.h | 6 +++++- 24 files changed, 155 insertions(+), 52 deletions(-) diff --git a/contributing.md b/contributing.md index aa76f1a..6e371ee 100644 --- a/contributing.md +++ b/contributing.md @@ -2,7 +2,7 @@ The following document contains a set of guidelines for contributing to the project. Any pull-requests should be compliant with this guide. Code style is often fluent, if you have a suggestion which you think will improve the readability of the code then please open an issue so that we can discuss that potentially modify the style guide to accommodate any new changes. -#C++ Style Guide +# C++ Style Guide The following guide should be followed to ensure consistent code throughout the project. diff --git a/src/RibbonButton.h b/src/RibbonButton.h index d2eec87..34c8ee9 100644 --- a/src/RibbonButton.h +++ b/src/RibbonButton.h @@ -73,8 +73,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheets(bool isDarkMode) -> void; private: - std::shared_ptr d; - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! an instance of theme support + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonButtonPlugin.h b/src/RibbonButtonPlugin.h index 5a9128c..b0b248e 100644 --- a/src/RibbonButtonPlugin.h +++ b/src/RibbonButtonPlugin.h @@ -125,7 +125,11 @@ class RibbonButtonPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONBUTTONPLUGIN_H diff --git a/src/RibbonCheckBox.h b/src/RibbonCheckBox.h index 2d6bffb..76ad58e 100644 --- a/src/RibbonCheckBox.h +++ b/src/RibbonCheckBox.h @@ -63,7 +63,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonCheckBoxPlugin.h b/src/RibbonCheckBoxPlugin.h index 0c04b89..e6831fb 100644 --- a/src/RibbonCheckBoxPlugin.h +++ b/src/RibbonCheckBoxPlugin.h @@ -125,7 +125,11 @@ class RibbonCheckBoxPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONCHECKBOXPLUGIN_H diff --git a/src/RibbonComboBox.h b/src/RibbonComboBox.h index ee85053..5f0ddf0 100644 --- a/src/RibbonComboBox.h +++ b/src/RibbonComboBox.h @@ -63,7 +63,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonComboBoxPlugin.h b/src/RibbonComboBoxPlugin.h index 40eb3e2..2292399 100644 --- a/src/RibbonComboBoxPlugin.h +++ b/src/RibbonComboBoxPlugin.h @@ -125,7 +125,11 @@ class RibbonComboBoxPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONCOMBOBOXPLUGIN_H diff --git a/src/RibbonDropButton.h b/src/RibbonDropButton.h index 139493d..35f5c28 100644 --- a/src/RibbonDropButton.h +++ b/src/RibbonDropButton.h @@ -50,9 +50,13 @@ namespace Nedrysoft { namespace Ribbon { private: Q_OBJECT + //! @cond + Q_PROPERTY(QIcon icon READ icon WRITE setIcon) Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) + //! @endcond + public: /** * @brief Constructs a new RibbonDropButton which is a child of the parent. @@ -116,11 +120,15 @@ namespace Nedrysoft { namespace Ribbon { Q_SIGNAL void clicked(bool dropdown); private: - QVBoxLayout *m_layout; //! the layout for this widget - QPushButton *m_mainButton; //! the main button - QPushButton *m_dropButton; //! the drop down button - QSize m_iconSize; //! the size of the icon - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + //! @cond + + QVBoxLayout *m_layout; + QPushButton *m_mainButton; + QPushButton *m_dropButton; + QSize m_iconSize; + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonDropButtonPlugin.h b/src/RibbonDropButtonPlugin.h index a17a894..a28b44a 100644 --- a/src/RibbonDropButtonPlugin.h +++ b/src/RibbonDropButtonPlugin.h @@ -124,7 +124,11 @@ class RibbonDropButtonPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONDROPBUTTONPLUGIN_H diff --git a/src/RibbonFontManager.h b/src/RibbonFontManager.h index 9285ed2..32e716a 100644 --- a/src/RibbonFontManager.h +++ b/src/RibbonFontManager.h @@ -79,8 +79,12 @@ namespace Nedrysoft { namespace Ribbon { auto boldFont() -> QString const; private: - int m_regularFontId; //! Regular font id after loading - int m_boldFontId; //! Bold font id after loading + //! @cond + + int m_regularFontId; + int m_boldFontId; + + //! @endcond }; }} diff --git a/src/RibbonGroup.h b/src/RibbonGroup.h index dae5c5d..4ca97b7 100644 --- a/src/RibbonGroup.h +++ b/src/RibbonGroup.h @@ -52,8 +52,12 @@ namespace Nedrysoft { namespace Ribbon { private: Q_OBJECT + //! @cond + Q_PROPERTY(QString groupName READ groupName WRITE setGroupName) + //! @endcond + public: /** * @brief Constructs a new RibbonGroup which is a child of the parent. @@ -97,10 +101,14 @@ namespace Nedrysoft { namespace Ribbon { auto event(QEvent *event) -> bool override; private: - QString m_groupName; //! Group name that is displayed - QFont m_font; //! Font used to draw the group name - QFontMetrics m_fontMetrics; //! The font metrics of the selected font - QRect m_textRect; //! The rectangle of the group name in the selected font + //! @cond + + QString m_groupName; + QFont m_font; + QFontMetrics m_fontMetrics; + QRect m_textRect; + + //! @endcond }; }} diff --git a/src/RibbonGroupPlugin.h b/src/RibbonGroupPlugin.h index 3964918..4b22b63 100644 --- a/src/RibbonGroupPlugin.h +++ b/src/RibbonGroupPlugin.h @@ -124,7 +124,11 @@ class RibbonGroupPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONGROUPPLUGIN_H diff --git a/src/RibbonLineEdit.h b/src/RibbonLineEdit.h index 4f1a8a1..12bf607 100644 --- a/src/RibbonLineEdit.h +++ b/src/RibbonLineEdit.h @@ -58,7 +58,7 @@ namespace Nedrysoft { namespace Ribbon { /** * @brief Reimplements QWidget::setMinimumHeight(int minimumHeight) * - * @note This hides the superclasses implemention as the ribbon line edit has a fixed height and + * @note This hides the superclasses implementation as the ribbon line edit has a fixed height and * we ignore any attempts to set it. * * @param[in] minimumHeight the minimum height for the widget. @@ -68,10 +68,10 @@ namespace Nedrysoft { namespace Ribbon { /** * @brief Reimplements QWidget::setMaximumHeight(int maximumHeight) * - * @note This hides the superclasses implemention as the ribbon line edit has a fixed height and + * @note This hides the superclasses implementation as the ribbon line edit has a fixed height and * we ignore any attempts to set it. * - * @param[in] minimumHeight the maximum height for the widget. + * @param[in] maximumHeight the maximum height for the widget. */ void setMaximumHeight(int maximumHeight); @@ -109,7 +109,7 @@ namespace Nedrysoft { namespace Ribbon { * * @note Used to discard enter + return keys. * - * @param[in[ event the event information. + * @param[in] event the event information. * * @returns true if event handled; otherwise false. */ @@ -132,7 +132,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonLineEditPlugin.h b/src/RibbonLineEditPlugin.h index 1a6a44e..c68a480 100644 --- a/src/RibbonLineEditPlugin.h +++ b/src/RibbonLineEditPlugin.h @@ -125,7 +125,11 @@ class RibbonLineEditPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONLINEDITPLUGIN_H diff --git a/src/RibbonPushButton.h b/src/RibbonPushButton.h index 220d2e3..b9e165e 100644 --- a/src/RibbonPushButton.h +++ b/src/RibbonPushButton.h @@ -48,10 +48,14 @@ namespace Nedrysoft { namespace Ribbon { private: Q_OBJECT + //! @cond + Q_PROPERTY(QIcon icon READ icon WRITE setIcon) Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) Q_PROPERTY(QString text READ text WRITE setText) + //! @endcond + public: /** * @brief Constructs a new RibbonPushButton instance which is a child of the parent. @@ -139,11 +143,15 @@ namespace Nedrysoft { namespace Ribbon { auto eventFilter(QObject *object, QEvent *event) -> bool override; private: - QVBoxLayout *m_layout; //! the layout for this widget - QPushButton *m_mainButton; //! the main button - QLabel *m_buttonLabel; //! the main button label - QSize m_iconSize; //! the size of the icon - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! an instance of theme support + //! @cond + + QVBoxLayout *m_layout; + QPushButton *m_mainButton; + QLabel *m_buttonLabel; + QSize m_iconSize; + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonPushButtonPlugin.h b/src/RibbonPushButtonPlugin.h index c915246..a84665d 100644 --- a/src/RibbonPushButtonPlugin.h +++ b/src/RibbonPushButtonPlugin.h @@ -125,7 +125,11 @@ class RibbonPushButtonPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONPUSHBUTTONPLUGIN_H diff --git a/src/RibbonSlider.h b/src/RibbonSlider.h index 5f720f4..68151c8 100644 --- a/src/RibbonSlider.h +++ b/src/RibbonSlider.h @@ -63,7 +63,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonSliderPlugin.h b/src/RibbonSliderPlugin.h index bb9c4f2..c24d525 100644 --- a/src/RibbonSliderPlugin.h +++ b/src/RibbonSliderPlugin.h @@ -125,7 +125,11 @@ class RibbonSliderPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONSLIDERPLUGIN_H diff --git a/src/RibbonTabBar.h b/src/RibbonTabBar.h index e05c4f8..80ac322 100644 --- a/src/RibbonTabBar.h +++ b/src/RibbonTabBar.h @@ -94,11 +94,15 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - QFont m_selectedFont; //! font to use on selected tab - QFont m_normalFont; //! font to use on deselected tabs - bool m_mouseInWidget; //! tracks whether the mouse is tracked inside the widget + //! @cond - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! theme support instance + QFont m_selectedFont; + QFont m_normalFont; + bool m_mouseInWidget; + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonToolButton.h b/src/RibbonToolButton.h index a4a97aa..df9a93b 100644 --- a/src/RibbonToolButton.h +++ b/src/RibbonToolButton.h @@ -63,7 +63,11 @@ namespace Nedrysoft { namespace Ribbon { auto updateStyleSheet(bool isDarkMode) -> void; private: - Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; //! an instance of theme support + //! @cond + + Nedrysoft::ThemeSupport::ThemeSupport *m_themeSupport; + + //! @endcond }; }} diff --git a/src/RibbonToolButtonPlugin.h b/src/RibbonToolButtonPlugin.h index 20dc08e..5b7c00f 100644 --- a/src/RibbonToolButtonPlugin.h +++ b/src/RibbonToolButtonPlugin.h @@ -125,7 +125,11 @@ class RibbonToolButtonPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONTOOLBUTTONPLUGIN_H diff --git a/src/RibbonWidget.h b/src/RibbonWidget.h index ba7155d..c7c5f9a 100644 --- a/src/RibbonWidget.h +++ b/src/RibbonWidget.h @@ -105,17 +105,17 @@ namespace Nedrysoft { namespace Ribbon { */ #if defined(Q_OS_MACOS) - static constexpr int TabBarHeight = 34; //! Height of the tab bar portion of the control - static constexpr int DefaultFontSize = 12; //! Default text size for macOS + static constexpr int TabBarHeight = 34; + static constexpr int DefaultFontSize = 12; #else - static constexpr int TabBarHeight = 28; //! Height of the tab bar portion of the control - static constexpr int DefaultFontSize = 10; //! Default text size for targets other than macOS + static constexpr int TabBarHeight = 28; + static constexpr int DefaultFontSize = 10; #endif - static constexpr int RibbonBarHeight = 100; //! Height of the entire control - static constexpr int TabHighlightHeight = 3; //! Height of the highlight mark on the selected page - static constexpr int GroupDividerMargin = 2; //! Width of the group divider + static constexpr int RibbonBarHeight = 100; + static constexpr int TabHighlightHeight = 3; + static constexpr int GroupDividerMargin = 2; - static constexpr int RibbonBarDefaultWidth = 200; //! Default width of the control used by designer plugins + static constexpr int RibbonBarDefaultWidth = 200; /** * @brief The RibbonWidget widget provides the main Ribbon container. @@ -150,7 +150,11 @@ namespace Nedrysoft { namespace Ribbon { auto paintEvent(QPaintEvent *event) -> void override; private: - Nedrysoft::Ribbon::RibbonTabBar *m_tabBar; //! The tab bar associated with this ribbon + //! @cond + + Nedrysoft::Ribbon::RibbonTabBar *m_tabBar; + + //! @endcond }; }} diff --git a/src/RibbonWidgetPlugin.h b/src/RibbonWidgetPlugin.h index 435581a..7183af6 100644 --- a/src/RibbonWidgetPlugin.h +++ b/src/RibbonWidgetPlugin.h @@ -122,7 +122,11 @@ class RibbonWidgetPlugin : void initialize(QDesignerFormEditorInterface *core) override; private: - bool m_initialized = false; //! holds whether designer has initialised the factory yet + //! @cond + + bool m_initialized = false; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONWIDGETPLUGIN_H diff --git a/src/RibbonWidgetsCollection.h b/src/RibbonWidgetsCollection.h index 955d942..8992a1e 100644 --- a/src/RibbonWidgetsCollection.h +++ b/src/RibbonWidgetsCollection.h @@ -56,7 +56,11 @@ class RibbonWidgetsCollection : QList customWidgets() const override; private: - QList m_widgets; //! the list of provided widgets + //! @cond + + QList m_widgets; + + //! @endcond }; #endif // NEDRYSOFT_RIBBONWIDGETSCOLLECTION_H