QGIS API Documentation
3.14.0-Pi (9f7028fd23)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
n
o
p
q
r
s
t
u
w
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
gui
layout
qgslayoutviewtooltemporarykeypan.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutviewtooltemporarykeypan.cpp
3
------------------------------------
4
Date : July 2017
5
Copyright : (C) 2017 Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgslayoutviewtooltemporarykeypan.h
"
17
#include "
qgslayoutviewmouseevent.h
"
18
#include "
qgslayoutview.h
"
19
#include <QScrollBar>
20
21
QgsLayoutViewToolTemporaryKeyPan::QgsLayoutViewToolTemporaryKeyPan
(
QgsLayoutView
*view )
22
:
QgsLayoutViewTool
( view, tr(
"Pan"
) )
23
{
24
setCursor
( Qt::ClosedHandCursor );
25
}
26
27
void
QgsLayoutViewToolTemporaryKeyPan::layoutMoveEvent
(
QgsLayoutViewMouseEvent
*event )
28
{
29
view
()->horizontalScrollBar()->setValue(
view
()->horizontalScrollBar()->value() - ( event->x() - mLastMousePos.x() ) );
30
view
()->verticalScrollBar()->setValue(
view
()->verticalScrollBar()->value() - ( event->y() - mLastMousePos.y() ) );
31
mLastMousePos =
event
->pos();
32
view
()->
viewChanged
();
33
}
34
35
void
QgsLayoutViewToolTemporaryKeyPan::keyReleaseEvent
( QKeyEvent *event )
36
{
37
if
( event->key() == Qt::Key_Space && !event->isAutoRepeat() )
38
{
39
view
()->
setTool
( mPreviousViewTool );
40
}
41
}
42
43
void
QgsLayoutViewToolTemporaryKeyPan::activate
()
44
{
45
mLastMousePos =
view
()->mapFromGlobal( QCursor::pos() );
46
mPreviousViewTool =
view
()->
tool
();
47
QgsLayoutViewTool::activate
();
48
}
qgslayoutview.h
qgslayoutviewmouseevent.h
QgsLayoutViewToolTemporaryKeyPan::activate
void activate() override
Called when tool is set as the currently active layout tool.
Definition:
qgslayoutviewtooltemporarykeypan.cpp:43
qgslayoutviewtooltemporarykeypan.h
QgsLayoutViewToolTemporaryKeyPan::QgsLayoutViewToolTemporaryKeyPan
QgsLayoutViewToolTemporaryKeyPan(QgsLayoutView *view)
Constructor for QgsLayoutViewToolTemporaryKeyPan.
Definition:
qgslayoutviewtooltemporarykeypan.cpp:21
QgsLayoutViewTool::view
QgsLayoutView * view() const
Returns the view associated with the tool.
Definition:
qgslayoutviewtool.cpp:38
QgsLayoutView::setTool
void setTool(QgsLayoutViewTool *tool)
Sets the tool currently being used in the view.
Definition:
qgslayoutview.cpp:132
QgsLayoutView::tool
QgsLayoutViewTool tool
Definition:
qgslayoutview.h:64
QgsLayoutView::viewChanged
void viewChanged()
Updates associated rulers and other widgets after view extent or zoom has changed.
Definition:
qgslayoutview.cpp:1171
QgsLayoutViewToolTemporaryKeyPan::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *event) override
Key release event for overriding.
Definition:
qgslayoutviewtooltemporarykeypan.cpp:35
QgsLayoutViewTool
Definition:
qgslayoutviewtool.h:46
QgsLayoutView
Definition:
qgslayoutview.h:49
QgsLayoutViewToolTemporaryKeyPan::layoutMoveEvent
void layoutMoveEvent(QgsLayoutViewMouseEvent *event) override
Mouse move event for overriding.
Definition:
qgslayoutviewtooltemporarykeypan.cpp:27
QgsLayoutViewTool::setCursor
void setCursor(const QCursor &cursor)
Sets a user defined cursor for use when the tool is active.
Definition:
qgslayoutviewtool.cpp:115
QgsLayoutViewTool::activate
virtual void activate()
Called when tool is set as the currently active layout tool.
Definition:
qgslayoutviewtool.cpp:120
QgsLayoutViewMouseEvent
Definition:
qgslayoutviewmouseevent.h:35
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17