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
qgsmaptip.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaptip.h - Query a layer and show a maptip on the canvas
3
---------------------
4
begin : October 2007
5
copyright : (C) 2007 by Gary Sherman
6
email : sherman @ mrcc 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
#ifndef QGSMAPTIP_H
16
#define QGSMAPTIP_H
17
18
class
QgsMapLayer
;
19
class
QgsMapCanvas
;
20
class
QPoint;
21
class
QString;
22
class
QgsPointXY
;
23
class
QgsVectorLayer
;
24
class
QgsWebView
;
25
26
#include <QWidget>
27
#include <QUrl>
28
#include "
qgsfeature.h
"
29
#include "qgis_gui.h"
30
51
class
GUI_EXPORT
QgsMapTip
:
public
QWidget
52
{
53
Q_OBJECT
54
public
:
55
59
QgsMapTip
();
60
71
void
showMapTip(
QgsMapLayer
*thepLayer,
72
QgsPointXY
&mapPosition,
73
QPoint &pixelPosition,
74
QgsMapCanvas
*mpMapCanvas );
75
80
void
clear(
QgsMapCanvas
*mpMapCanvas =
nullptr
);
81
85
void
applyFontSettings();
86
87
private
slots:
88
void
onLinkClicked(
const
QUrl &url );
89
void
resizeContent();
90
91
private
:
92
// Fetch the feature to use for the maptip text.
93
// Only the first feature in the search radius is used
94
QString fetchFeature(
QgsMapLayer
*thepLayer,
95
QgsPointXY
&mapPosition,
96
QgsMapCanvas
*mapCanvas );
97
98
QString replaceText(
99
QString displayText,
QgsVectorLayer
*layer,
QgsFeature
&feat );
100
101
// Flag to indicate if a maptip is currently being displayed
102
bool
mMapTipVisible;
103
104
QWidget *mWidget =
nullptr
;
105
QgsWebView
*mWebView =
nullptr
;
106
107
QString mFontFamily;
108
int
mFontSize = 8;
109
110
const
int
MARGIN_VALUE = 5;
111
};
112
#endif // QGSMAPTIP_H
QgsMapCanvas
Definition:
qgsmapcanvas.h:83
qgsfeature.h
QgsMapTip
Definition:
qgsmaptip.h:51
QgsPointXY
Definition:
qgspointxy.h:43
QgsVectorLayer
Definition:
qgsvectorlayer.h:385
QgsMapLayer
Definition:
qgsmaplayer.h:81
QgsFeature
Definition:
qgsfeature.h:55
QgsWebView
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition:
qgswebview.h:65
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17