2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef FLICKABLE_H
|
|
|
|
#define FLICKABLE_H
|
|
|
|
|
2020-06-05 14:07:07 +00:00
|
|
|
#include <QWidget>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
class FlickableTicker;
|
|
|
|
class FlickablePrivate;
|
|
|
|
|
|
|
|
class Flickable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Flickable();
|
|
|
|
virtual ~Flickable();
|
|
|
|
|
|
|
|
void setThreshold(int threshold);
|
|
|
|
int threshold() const;
|
|
|
|
|
|
|
|
void setAcceptMouseClick(QWidget *target);
|
|
|
|
|
|
|
|
void handleMousePress(QMouseEvent *event);
|
|
|
|
void handleMouseMove(QMouseEvent *event);
|
|
|
|
void handleMouseRelease(QMouseEvent *event);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual QPoint scrollOffset() const = 0;
|
|
|
|
virtual void setScrollOffset(const QPoint &offset) = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void tick();
|
|
|
|
|
|
|
|
private:
|
|
|
|
FlickablePrivate *d;
|
|
|
|
friend class FlickableTicker;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FLICKABLE_H
|