From a8647ea67af051c49a6eb8bd7509442322c149d2 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Fri, 15 Jul 2022 13:54:20 +0800 Subject: [PATCH] fix(q_ptr): use q_ptr --- components/qtmaterialautocomplete.cpp | 13 +++++++------ components/qtmaterialautocomplete_p.h | 3 ++- components/qtmaterialcheckbox.cpp | 1 + components/qtmaterialcheckbox_p.h | 2 ++ components/qtmaterialcircularprogress.cpp | 4 ++-- components/qtmaterialfab.cpp | 1 + components/qtmaterialfab_p.h | 2 ++ components/qtmaterialradiobutton.cpp | 3 ++- components/qtmaterialradiobutton_p.h | 2 +- components/qtmaterialraisedbutton.cpp | 1 + components/qtmaterialraisedbutton_p.h | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/components/qtmaterialautocomplete.cpp b/components/qtmaterialautocomplete.cpp index 248fe7d..bf58f13 100644 --- a/components/qtmaterialautocomplete.cpp +++ b/components/qtmaterialautocomplete.cpp @@ -10,25 +10,26 @@ #include /*! - * \class QtMaterialAutoCompletePrivate - * \internal + * @class QtMaterialAutoCompletePrivate + * @internal */ /*! - * \internal + * @internal */ QtMaterialAutoCompletePrivate::QtMaterialAutoCompletePrivate(QtMaterialAutoComplete *q) : QtMaterialTextFieldPrivate(q) + , q_ptr(q) { } /*! - * \internal + * @internal */ QtMaterialAutoCompletePrivate::~QtMaterialAutoCompletePrivate() {} /*! - * \internal + * @internal */ void QtMaterialAutoCompletePrivate::init() { @@ -66,7 +67,7 @@ void QtMaterialAutoCompletePrivate::init() } /*! - * \class QtMaterialAutoComplete + * @class QtMaterialAutoComplete */ QtMaterialAutoComplete::QtMaterialAutoComplete(QWidget *parent) diff --git a/components/qtmaterialautocomplete_p.h b/components/qtmaterialautocomplete_p.h index 1cc0513..4e99d7c 100644 --- a/components/qtmaterialautocomplete_p.h +++ b/components/qtmaterialautocomplete_p.h @@ -7,7 +7,7 @@ class QWidget; class QVBoxLayout; class QtMaterialAutoCompleteOverlay; class QtMaterialAutoCompleteStateMachine; - +class QtMaterialAutoComplete; class QtMaterialAutoCompletePrivate : public QtMaterialTextFieldPrivate { Q_DISABLE_COPY(QtMaterialAutoCompletePrivate) @@ -19,6 +19,7 @@ public: void init(); + QtMaterialAutoComplete *const q_ptr; QWidget *menu; QWidget *frame; QtMaterialAutoCompleteStateMachine *stateMachine; diff --git a/components/qtmaterialcheckbox.cpp b/components/qtmaterialcheckbox.cpp index 6108f60..c0af52c 100644 --- a/components/qtmaterialcheckbox.cpp +++ b/components/qtmaterialcheckbox.cpp @@ -15,6 +15,7 @@ */ QtMaterialCheckBoxPrivate::QtMaterialCheckBoxPrivate(QtMaterialCheckBox *q) : QtMaterialCheckablePrivate(q) + , q_ptr(q) { } diff --git a/components/qtmaterialcheckbox_p.h b/components/qtmaterialcheckbox_p.h index 6ad3925..a26c1d8 100644 --- a/components/qtmaterialcheckbox_p.h +++ b/components/qtmaterialcheckbox_p.h @@ -14,6 +14,8 @@ public: QtMaterialCheckBoxPrivate(QtMaterialCheckBox *q); ~QtMaterialCheckBoxPrivate(); + QtMaterialCheckBox *const q_ptr; + void init(); }; diff --git a/components/qtmaterialcircularprogress.cpp b/components/qtmaterialcircularprogress.cpp index aee067d..c893014 100644 --- a/components/qtmaterialcircularprogress.cpp +++ b/components/qtmaterialcircularprogress.cpp @@ -8,8 +8,8 @@ #include /*! - * \class QtMaterialCircularProgressPrivate - * \internal + * @class QtMaterialCircularProgressPrivate + * @internal */ QtMaterialCircularProgressPrivate::QtMaterialCircularProgressPrivate(QtMaterialCircularProgress *q) diff --git a/components/qtmaterialfab.cpp b/components/qtmaterialfab.cpp index 0a8e4c4..140122f 100644 --- a/components/qtmaterialfab.cpp +++ b/components/qtmaterialfab.cpp @@ -16,6 +16,7 @@ */ QtMaterialFloatingActionButtonPrivate::QtMaterialFloatingActionButtonPrivate(QtMaterialFloatingActionButton *q) : QtMaterialRaisedButtonPrivate(q) + , q_ptr(q) { } diff --git a/components/qtmaterialfab_p.h b/components/qtmaterialfab_p.h index 57eecdd..e1671fe 100644 --- a/components/qtmaterialfab_p.h +++ b/components/qtmaterialfab_p.h @@ -19,6 +19,8 @@ public: ~QtMaterialFloatingActionButtonPrivate(); void init(); + + QtMaterialFloatingActionButton *const q_ptr; QRect fabGeometry() const; void setupProperties(); diff --git a/components/qtmaterialradiobutton.cpp b/components/qtmaterialradiobutton.cpp index ae6efba..fdd561e 100644 --- a/components/qtmaterialradiobutton.cpp +++ b/components/qtmaterialradiobutton.cpp @@ -15,6 +15,7 @@ QtMaterialRadioButtonPrivate::QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q) : QtMaterialCheckablePrivate(q) + , q_ptr(q) { } @@ -22,7 +23,7 @@ QtMaterialRadioButtonPrivate::~QtMaterialRadioButtonPrivate() {} void QtMaterialRadioButtonPrivate::init() { - // get the public button + // get the public button Q_Q(QtMaterialRadioButton); q->setAutoExclusive(true); diff --git a/components/qtmaterialradiobutton_p.h b/components/qtmaterialradiobutton_p.h index ea2c8de..9673b63 100644 --- a/components/qtmaterialradiobutton_p.h +++ b/components/qtmaterialradiobutton_p.h @@ -13,7 +13,7 @@ class QtMaterialRadioButtonPrivate : public QtMaterialCheckablePrivate public: QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q); ~QtMaterialRadioButtonPrivate(); - + QtMaterialRadioButton *const q_ptr; void init(); }; diff --git a/components/qtmaterialraisedbutton.cpp b/components/qtmaterialraisedbutton.cpp index 95aed59..23d1495 100644 --- a/components/qtmaterialraisedbutton.cpp +++ b/components/qtmaterialraisedbutton.cpp @@ -15,6 +15,7 @@ */ QtMaterialRaisedButtonPrivate::QtMaterialRaisedButtonPrivate(QtMaterialRaisedButton *q) : QtMaterialFlatButtonPrivate(q) + , q_ptr(q) { } diff --git a/components/qtmaterialraisedbutton_p.h b/components/qtmaterialraisedbutton_p.h index 37c9548..319e83a 100644 --- a/components/qtmaterialraisedbutton_p.h +++ b/components/qtmaterialraisedbutton_p.h @@ -18,7 +18,8 @@ public: ~QtMaterialRaisedButtonPrivate(); void init(); - + + QtMaterialRaisedButton *const q_ptr; QStateMachine *shadowStateMachine; QState *normalState; QState *pressedState;