File indexing completed on 2024-04-28 04:21:26
0001 // SPDX-FileCopyrightText: 2006-2022 Ricardo Villalba <rvm@escomposlinux.org> 0002 // 0003 // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Trolltech-FreeQtFoundation-Accepted-LGPL 0004 0005 #pragma once 0006 0007 #include <QSlider> 0008 0009 class Slider : public QSlider 0010 { 0011 Q_OBJECT 0012 public: 0013 Slider(QWidget *parent = nullptr); 0014 0015 Q_SIGNALS: 0016 void onEnter(); 0017 void onLeave(); 0018 void onHover(const QPoint &pos, int value); 0019 0020 private: 0021 void enterEvent(QEvent *event) override; 0022 void leaveEvent(QEvent *e) override; 0023 void mouseMoveEvent(QMouseEvent *event) override; 0024 void mousePressEvent(QMouseEvent *event) override; 0025 int pick(const QPoint &pt) const; 0026 int pixelPosToRangeValue(int pos) const; 0027 void initStyleOption_Qt430(QStyleOptionSlider *option) const; 0028 };