QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
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
3
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
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
_
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
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
c
l
s
t
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
x
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 <QTimer>
29
#include "
qgsfeature.h
"
30
#include "qgis_gui.h"
31
52
class
GUI_EXPORT
QgsMapTip
:
public
QWidget
53
{
54
Q_OBJECT
55
public
:
56
60
QgsMapTip
();
61
72
void
showMapTip(
QgsMapLayer
*thepLayer,
73
QgsPointXY
&mapPosition,
74
QPoint &pixelPosition,
75
QgsMapCanvas
*mpMapCanvas );
76
82
void
clear(
QgsMapCanvas
*mpMapCanvas =
nullptr
,
int
msDelay = 0 );
83
87
void
applyFontSettings();
88
89
private
slots:
90
void
onLinkClicked(
const
QUrl &url );
91
void
resizeContent();
92
93
private
:
94
// Fetch the feature to use for the maptip text.
95
// Only the first feature in the search radius is used
96
QString fetchFeature(
QgsMapLayer
*thepLayer,
97
QgsPointXY
&mapPosition,
98
QgsMapCanvas
*mapCanvas );
99
100
QString replaceText(
101
QString displayText,
QgsVectorLayer
*layer,
QgsFeature
&feat );
102
103
// Flag to indicate if a maptip is currently being displayed
104
bool
mMapTipVisible;
105
106
QWidget *mWidget =
nullptr
;
107
QgsWebView
*mWebView =
nullptr
;
108
109
QString mFontFamily;
110
int
mFontSize = 8;
111
112
const
int
MARGIN_VALUE = 5;
113
114
QTimer mDelayedClearTimer;
115
};
116
#endif // QGSMAPTIP_H
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition:
qgsmapcanvas.h:89
qgsfeature.h
QgsMapTip
A maptip is a class to display a tip on a map canvas when a mouse is hovered over a feature.
Definition:
qgsmaptip.h:52
QgsPointXY
A class to represent a 2D point.
Definition:
qgspointxy.h:58
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:391
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition:
qgsmaplayer.h:72
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
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 Sun Sep 11 2022 00:03:17 for QGIS API Documentation by
1.8.17