feat: 添加ElaWidgetTool库

This commit is contained in:
sleepwithoutbz
2025-09-19 22:40:52 +08:00
parent 5f93e8caf6
commit 4eef5c7fd5
407 changed files with 36325 additions and 7 deletions

View File

@@ -0,0 +1,41 @@
#ifndef ELASCROLLBARPRIVATE_H
#define ELASCROLLBARPRIVATE_H
#include <QAbstractScrollArea>
#include <QObject>
#include <QScrollBar>
#include "ElaProperty.h"
class QTimer;
class QPropertyAnimation;
class ElaScrollBar;
class ElaScrollBarPrivate : public QObject
{
Q_OBJECT
Q_D_CREATE(ElaScrollBar)
Q_PROPERTY_CREATE_D(bool, IsAnimation)
Q_PROPERTY_CREATE_D(qreal, SpeedLimit)
Q_PROPERTY_CREATE(int, TargetMaximum)
public:
explicit ElaScrollBarPrivate(QObject* parent = nullptr);
~ElaScrollBarPrivate();
Q_SLOT void onRangeChanged(int min, int max);
private:
QScrollBar* _originScrollBar{nullptr};
QAbstractScrollArea* _originScrollArea{nullptr};
QTimer* _expandTimer{nullptr};
bool _isExpand{false};
QPropertyAnimation* _slideSmoothAnimation{nullptr};
int _scrollValue{-1};
void _scroll(Qt::KeyboardModifiers modifiers, int value);
int _pixelPosToRangeValue(int pos) const;
// 映射处理函数
void _initAllConfig();
void _handleScrollBarValueChanged(QScrollBar* scrollBar, int value);
void _handleScrollBarRangeChanged(int min, int max);
void _handleScrollBarGeometry();
};
#endif // ELASCROLLBARPRIVATE_H