2016-05-01 19:56:39 +00:00
|
|
|
#ifndef SLIDER_P_H
|
|
|
|
#define SLIDER_P_H
|
|
|
|
|
2016-05-01 21:10:31 +00:00
|
|
|
#include <QPainter>
|
2016-05-12 08:39:17 +00:00
|
|
|
#include <QApplication>
|
2016-05-02 20:35:04 +00:00
|
|
|
#include "lib/style.h"
|
2016-05-12 08:39:17 +00:00
|
|
|
#include "slider.h"
|
2016-05-29 09:17:06 +00:00
|
|
|
#include "slider_internal.h"
|
2016-05-01 19:56:39 +00:00
|
|
|
|
|
|
|
class SliderPrivate
|
|
|
|
{
|
|
|
|
Q_DISABLE_COPY(SliderPrivate)
|
|
|
|
Q_DECLARE_PUBLIC(Slider)
|
|
|
|
|
|
|
|
public:
|
2016-05-17 12:39:20 +00:00
|
|
|
SliderPrivate(Slider *q)
|
|
|
|
: q_ptr(q),
|
|
|
|
hoverTrack(false),
|
|
|
|
hoverThumb(false),
|
|
|
|
hover(false),
|
|
|
|
step(false),
|
|
|
|
pageStepMode(true),
|
|
|
|
stepTo(0),
|
|
|
|
oldValue(0),
|
|
|
|
trackWidth(2)
|
|
|
|
{}
|
|
|
|
|
|
|
|
void init();
|
2016-05-01 19:56:39 +00:00
|
|
|
|
2016-05-12 09:19:00 +00:00
|
|
|
QRectF trackBoundingRect() const;
|
|
|
|
QRectF thumbBoundingRect() const;
|
2016-05-09 20:32:16 +00:00
|
|
|
|
2016-05-10 14:17:51 +00:00
|
|
|
int valueFromPosition(const QPoint &pos) const;
|
2016-05-09 20:32:16 +00:00
|
|
|
|
2016-05-12 08:39:17 +00:00
|
|
|
void setHovered(bool status);
|
2016-05-12 06:37:30 +00:00
|
|
|
|
2016-05-17 12:39:20 +00:00
|
|
|
Slider *const q_ptr;
|
|
|
|
SliderThumb *thumb;
|
|
|
|
SliderTrack *track;
|
|
|
|
SliderStateMachine *machine;
|
2016-05-10 14:17:51 +00:00
|
|
|
bool hoverTrack;
|
|
|
|
bool hoverThumb;
|
2016-05-12 06:37:30 +00:00
|
|
|
bool hover;
|
2016-05-10 14:17:51 +00:00
|
|
|
bool step;
|
|
|
|
bool pageStepMode;
|
|
|
|
int stepTo;
|
|
|
|
int oldValue;
|
2016-05-11 17:26:19 +00:00
|
|
|
int trackWidth;
|
2016-05-10 14:17:51 +00:00
|
|
|
};
|
2016-05-09 20:32:16 +00:00
|
|
|
|
2016-05-13 14:35:04 +00:00
|
|
|
#endif // SLIDER_P_H
|