chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -8,15 +8,14 @@
#include <QVector>
#include "ElaDef.h"
class ElaSuggestion : public QObject
{
class ElaSuggestion : public QObject {
Q_OBJECT
Q_PROPERTY_CREATE(ElaIconType::IconName, ElaIcon)
Q_PROPERTY_CREATE(QString, SuggestText)
Q_PROPERTY_CREATE(QString, SuggestKey)
Q_PROPERTY_CREATE(QVariantMap, SuggestData)
public:
explicit ElaSuggestion(QObject* parent = nullptr);
explicit ElaSuggestion(QObject *parent = nullptr);
~ElaSuggestion() override;
};
@@ -28,36 +27,35 @@ class ElaBaseListView;
class ElaSuggestDelegate;
class ElaSuggestBox;
class ElaSuggestBoxSearchViewContainer;
class ElaSuggestBoxPrivate : public QObject
{
class ElaSuggestBoxPrivate : public QObject {
Q_OBJECT
Q_D_CREATE(ElaSuggestBox)
Q_PROPERTY_CREATE_D(int, BorderRadius)
Q_PROPERTY_CREATE_D(Qt::CaseSensitivity, CaseSensitivity)
public:
explicit ElaSuggestBoxPrivate(QObject* parent = nullptr);
explicit ElaSuggestBoxPrivate(QObject *parent = nullptr);
~ElaSuggestBoxPrivate();
Q_SLOT void onThemeModeChanged(ElaThemeType::ThemeMode themeMode);
Q_SLOT void onSearchEditTextEdit(const QString& searchText);
Q_SLOT void onSearchViewClicked(const QModelIndex& index);
Q_SLOT void onSearchEditTextEdit(const QString &searchText);
Q_SLOT void onSearchViewClicked(const QModelIndex &index);
private:
ElaThemeType::ThemeMode _themeMode;
QAction* _lightSearchAction{nullptr};
QAction* _darkSearchAction{nullptr};
QVector<ElaSuggestion*> _suggestionVector;
ElaSuggestBoxSearchViewContainer* _searchViewBaseWidget{nullptr};
ElaLineEdit* _searchEdit{nullptr};
ElaSuggestModel* _searchModel{nullptr};
ElaBaseListView* _searchView{nullptr};
ElaSuggestDelegate* _searchDelegate{nullptr};
QVBoxLayout* _shadowLayout{nullptr};
QSize _lastSize;
bool _isExpandAnimationFinished{true};
bool _isCloseAnimationFinished{true};
void _startSizeAnimation(QSize oldSize, QSize newSize);
void _startExpandAnimation();
void _startCloseAnimation();
ElaThemeType::ThemeMode _themeMode;
QAction *_lightSearchAction{nullptr};
QAction *_darkSearchAction{nullptr};
QVector<ElaSuggestion *> _suggestionVector;
ElaSuggestBoxSearchViewContainer *_searchViewBaseWidget{nullptr};
ElaLineEdit *_searchEdit{nullptr};
ElaSuggestModel *_searchModel{nullptr};
ElaBaseListView *_searchView{nullptr};
ElaSuggestDelegate *_searchDelegate{nullptr};
QVBoxLayout *_shadowLayout{nullptr};
QSize _lastSize;
bool _isExpandAnimationFinished{true};
bool _isCloseAnimationFinished{true};
void _startSizeAnimation(QSize oldSize, QSize newSize);
void _startExpandAnimation();
void _startCloseAnimation();
};
#endif // ELASUGGESTBOXPRIVATE_H