NDEVR
API Documentation
ScrollGesture.h
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;
48
class
NDEVR_WIDGETS_API
ScrollGesture
:
public
QObject
49
{
50
public
:
55
ScrollGesture
(QAbstractScrollArea* target);
56
virtual
~ScrollGesture
();
63
bool
eventFilter
(QObject *, QEvent *)
override
;
68
void
setThreshold
(
int
threshold
);
73
int
threshold
()
const
;
78
void
setAcceptMouseClick
(QWidget *target);
85
bool
handleMousePress
(QEvent* event, QPoint location);
92
bool
handleMouseMove
(QEvent* event, QPoint location);
99
bool
handleMouseRelease
(QEvent* event, QPoint location);
104
void
setScrollOffset
(QPoint point);
105
private
:
109
void
tick();
110
111
private
:
112
ScrollGesturePrivate *d;
113
QAbstractScrollArea* m_widget;
114
friend
class
FlickableTicker;
115
};
116
}
ScrollGesture::ScrollGesture
ScrollGesture(QAbstractScrollArea *target)
Constructs a ScrollGesture attached to the given scroll area.
ScrollGesture::threshold
int threshold() const
Returns the minimum pixel distance required before a drag is recognized as a scroll gesture.
ScrollGesture::handleMouseMove
bool handleMouseMove(QEvent *event, QPoint location)
Handles the mouse move event to continue tracking a scroll gesture.
ScrollGesture::eventFilter
bool eventFilter(QObject *, QEvent *) override
Filters events for the target object to intercept mouse gestures for scrolling.
ScrollGesture::setScrollOffset
void setScrollOffset(QPoint point)
Sets the current scroll offset of the target scroll area.
ScrollGesture::handleMousePress
bool handleMousePress(QEvent *event, QPoint location)
Handles the mouse press event to begin tracking a potential scroll gesture.
ScrollGesture::handleMouseRelease
bool handleMouseRelease(QEvent *event, QPoint location)
Handles the mouse release event to finalize a scroll gesture and apply flick momentum.
ScrollGesture::setAcceptMouseClick
void setAcceptMouseClick(QWidget *target)
Configures a widget to accept mouse click events that originate from the scroll gesture.
ScrollGesture::setThreshold
void setThreshold(int threshold)
Sets the minimum pixel distance required before a drag is recognized as a scroll gesture.
NDEVR
The primary namespace for the NDEVR SDK.
Definition
ArialTileFetcherModule.h:35
Widgets
Headers
ScrollGesture.h
NDEVR.org