2017-06-07 16:16:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmaptip.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
2009-04-13 12:29:59 +00:00
|
|
|
|
2017-06-07 16:16:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
class QgsMapTip : QWidget
|
2009-04-13 12:29:59 +00:00
|
|
|
{
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
A maptip is a class to display a tip on a map canvas
|
|
|
|
when a mouse is hovered over a feature.
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Since QGIS 2.16 a maptip can show full html.
|
|
|
|
QgsMapTip is a QgsWebView, so you can load full HTML/JS/CSS in it.
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The code found in the map tips tab is inserted in a inline-block div
|
|
|
|
so the frame can be resized based on the content size.
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
If no element in the html has a width attribute, the frame will squeeze down
|
|
|
|
to the widest word. To avoid this you can wrap your HTML in a
|
|
|
|
div style="width:300px" or similar.
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
JS can be included using the script tag as usual, while CSS files must be
|
|
|
|
linked using link rel="stylesheet" href="URL.css" the html specs
|
|
|
|
discourages link rel="stylesheet" in the body, but all browsers allow it.
|
|
|
|
see https://jakearchibald.com/2016/link-in-body
|
2009-04-13 12:29:59 +00:00
|
|
|
%End
|
|
|
|
|
2017-06-07 16:16:21 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaptip.h"
|
|
|
|
%End
|
2009-04-13 12:29:59 +00:00
|
|
|
public:
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2009-04-13 12:29:59 +00:00
|
|
|
QgsMapTip();
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Default constructor
|
2017-06-07 16:16:21 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void showMapTip( QgsMapLayer *thepLayer,
|
|
|
|
QgsPointXY &mapPosition,
|
|
|
|
QPoint &pixelPosition,
|
2009-04-13 12:29:59 +00:00
|
|
|
QgsMapCanvas *mpMapCanvas );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Show a maptip at a given point on the map canvas
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param thepLayer: a qgis vector map layer pointer that will
|
2018-05-24 21:21:14 +10:00
|
|
|
be used to provide the attribute data for the map tip.
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mapPosition: a reference to the position of the cursor
|
2018-05-24 21:21:14 +10:00
|
|
|
in map coordinatess.
|
2017-12-15 10:36:55 -04:00
|
|
|
:param pixelPosition: a reference to the position of the cursor
|
2018-05-24 21:21:14 +10:00
|
|
|
in pixel coordinates.
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mpMapCanvas: a map canvas on which the tip is drawn
|
2017-06-07 16:16:21 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void clear( QgsMapCanvas *mpMapCanvas = 0 );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Clear the current maptip if it exists
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mpMapCanvas: the canvas from which the tip should be cleared.
|
2017-06-07 16:16:21 +02:00
|
|
|
%End
|
2009-04-13 12:29:59 +00:00
|
|
|
};
|
2017-06-07 16:16:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmaptip.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|