| 188 | break; |
| 189 | } |
| 190 | } |
| 191 | return QScrollBar::event(event); |
| 192 | } |
| 193 | |
| 194 | bool ElaScrollBar::eventFilter(QObject* watched, QEvent* event) |
| 195 | { |
| 196 | Q_D(ElaScrollBar); |
| 197 | switch (event->type()) |
| 198 | { |
| 199 | case QEvent::Show: |
| 200 | case QEvent::Resize: |
| 201 | case QEvent::LayoutRequest: |
| 202 | { |
| 203 | d->_handleScrollBarGeometry(); |
| 204 | break; |
| 205 | } |
| 206 | default: |
| 207 | { |
| 208 | break; |
| 209 | } |
| 210 | } |
| 211 | return QScrollBar::eventFilter(watched, event); |
| 212 | } |
| 213 | |
| 214 | void ElaScrollBar::mousePressEvent(QMouseEvent* event) |
| 215 | { |
| 216 | Q_D(ElaScrollBar); |
| 217 | d->_scrollAnimation->stop(); |
| 218 | d->_expandTimer->stop(); |
| 219 | d->_isExpand = true; |
| 220 | d->_scrollBarStyle->startExpandAnimation(true); |
| 221 | QScrollBar::mousePressEvent(event); |
| 222 | } |
| 223 | |
| 224 | void ElaScrollBar::mouseReleaseEvent(QMouseEvent* event) |
| 225 | { |
| 226 | Q_D(ElaScrollBar); |
| 227 | QScrollBar::mouseReleaseEvent(event); |
| 228 | if (!underMouse()) |
| 229 | { |
| 230 | d->_expandTimer->start(500); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | void ElaScrollBar::mouseMoveEvent(QMouseEvent* event) |
| 235 | { |
| 236 | Q_D(ElaScrollBar); |
| 237 | if (isSliderDown()) |
| 238 | { |
| 239 | d->_scrollAnimation->stop(); |
| 240 | } |
| 241 | QScrollBar::mouseMoveEvent(event); |
| 242 | } |
| 243 | |
| 244 | void ElaScrollBar::wheelEvent(QWheelEvent* event) |
| 245 | { |
| 246 | Q_D(ElaScrollBar); |
| 247 | if (!d->_isSmoothScroll) |
nothing calls this directly
no test coverage detected