API Documentation
Loading...
Searching...
No Matches
ScrollGesture.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------------------------
2
Copyright (c) 2019, NDEVR LLC
3
tyler.parke@ndevr.org
4
__ __ ____ _____ __ __ _______
5
| \ | | | __ \ | ___|\ \ / / | __ \
6
| \ | | | | \ \ | |___ \ \ / / | |__) |
7
| . \| | | |__/ / | |___ \ V / | _ /
8
| |\ |_|_____/__|_____|___\_/____| | \ \
9
|__| \__________________________________| \__\
10
11
Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12
Licensee a limited, non-exclusive, non-transferable, royalty-free license
13
(without the right to sublicense) to use the API solely for the purpose of
14
Licensee's internal development efforts to develop applications for which
15
the API was provided.
16
17
The above copyright notice and this permission notice shall be included in all
18
copies or substantial portions of the Software.
19
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
DEALINGS IN THE SOFTWARE.
26
27
Library: Widgets
28
File: ScrollGesture
29
Included in API: True
30
Author(s): Tyler Parke
31
*-----------------------------------------------------------------------------------------**/
32
#pragma once
33
#include "
DLLInfo.h
"
34
#include <QObject>
35
class
QMouseEvent;
36
class
QPoint;
37
class
QAbstractScrollArea;
38
39
namespace
NDEVR
40
{
41
class
FlickableTicker;
42
class
ScrollGesturePrivate;
43
/**--------------------------------------------------------------------------------------------------
44
\brief Handles scrolling or flicking within the application.
45
**/
46
class
NDEVR_WIDGETS_API
ScrollGesture
:
public
QObject
47
{
48
public
:
49
50
ScrollGesture
(QAbstractScrollArea* target);
51
virtual
~ScrollGesture
();
52
53
bool
eventFilter
(QObject *, QEvent *)
override
;
54
void
setThreshold
(
int
threshold);
55
int
threshold
()
const
;
56
57
void
setAcceptMouseClick
(QWidget *target);
58
59
bool
handleMousePress
(QEvent* event, QPoint location);
60
bool
handleMouseMove
(QEvent* event, QPoint location);
61
bool
handleMouseRelease
(QEvent* event, QPoint location);
62
void
setScrollOffset
(QPoint point);
63
private
:
64
void
tick();
65
66
private
:
67
ScrollGesturePrivate *d;
68
QAbstractScrollArea* m_widget;
69
friend
class
FlickableTicker;
70
};
71
}
DLLInfo.h
NDEVR_WIDGETS_API
#define NDEVR_WIDGETS_API
Definition
DLLInfo.h:59
NDEVR::ScrollGesture
Handles scrolling or flicking within the application.
Definition
ScrollGesture.h:47
NDEVR::ScrollGesture::setThreshold
void setThreshold(int threshold)
NDEVR::ScrollGesture::handleMouseMove
bool handleMouseMove(QEvent *event, QPoint location)
NDEVR::ScrollGesture::threshold
int threshold() const
NDEVR::ScrollGesture::setScrollOffset
void setScrollOffset(QPoint point)
NDEVR::ScrollGesture::eventFilter
bool eventFilter(QObject *, QEvent *) override
NDEVR::ScrollGesture::ScrollGesture
ScrollGesture(QAbstractScrollArea *target)
NDEVR::ScrollGesture::setAcceptMouseClick
void setAcceptMouseClick(QWidget *target)
NDEVR::ScrollGesture::~ScrollGesture
virtual ~ScrollGesture()
NDEVR::ScrollGesture::handleMouseRelease
bool handleMouseRelease(QEvent *event, QPoint location)
NDEVR::ScrollGesture::handleMousePress
bool handleMousePress(QEvent *event, QPoint location)
NDEVR
Definition
ACIColor.h:37
Widgets
Headers
ScrollGesture.h