MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / event

Method event

ElaWidgetTools/ElaScrollBar.cpp:85–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 parent->installEventFilter(this);
84
85 d->_originScrollBar = originScrollBar;
86 d->_initAllConfig();
87
88 connect(d->_originScrollBar, &QScrollBar::valueChanged, this, [=](int value) {
89 d->_handleScrollBarValueChanged(this, value);
90 });
91 connect(this, &QScrollBar::valueChanged, this, [=](int value) {
92 d->_handleScrollBarValueChanged(d->_originScrollBar, value);
93 });
94 connect(d->_originScrollBar, &QScrollBar::rangeChanged, this, [=](int min, int max) {
95 d->_handleScrollBarRangeChanged(min, max);
96 });
97}
98
99ElaScrollBar::~ElaScrollBar() = default;
100
101void ElaScrollBar::setScrollBarWidth(int scrollBarWidth)
102{
103 Q_D(ElaScrollBar);
104 scrollBarWidth = qMax(6, scrollBarWidth);
105 if (d->_pScrollBarWidth == scrollBarWidth)
106 {
107 return;
108 }
109 d->_pScrollBarWidth = scrollBarWidth;
110 d->_scrollBarStyle->startExpandAnimation(d->_isExpand);
111 updateGeometry();
112 if (d->_originScrollArea)
113 {
114 d->_handleScrollBarGeometry();
115 }
116 update();
117 Q_EMIT pScrollBarWidthChanged();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected