• core »
  • Class: QgsHtmlAnnotation

Class: QgsHtmlAnnotation ¶

Bases: QgsAnnotation

Constructor for QgsHtmlAnnotation.

An annotation item that embeds HTML content.

QgsHtmlAnnotation

Copies common annotation properties to the targe annotation. Can be used within QgsAnnotation.clone() implementations to assist with creating copies.

Returns a new QgsHtmlAnnotation object.

itemElem ( QDomElement ) –

context ( QgsReadWriteContext ) –

context ( QgsRenderContext ) –

size ( QSizeF ) –

feature ( QgsFeature ) –

Sets the file path for the source HTML file.

sourceFile()

htmlFile ( str ) –

Returns the file path for the source HTML file.

setSourceFile()

elem ( QDomElement ) –

doc ( QDomDocument ) –

PyQGIS samples

qgis html annotation

qgis-sample-QgsHtmlAnnotationItem.py
  • QGIS User Guide
  • 7. QGIS GUI
  • Edit on GitHub

7. QGIS GUI 

The QGIS graphical user interface (GUI) is shown in the figure below (the numbers 1 through 5 in yellow circles indicate important elements of the QGIS GUI, and are discussed below).

../../../_images/startup.png

Fig. 7.1 QGIS GUI with Alaska sample data 

Your window decorations (title bar, etc.) may appear different depending on your operating system and window manager.

The main QGIS GUI ( Fig. 7.1 ) consists of five components / component types:

Scroll down for detailed explanations of these.

7.1. Menu Bar 

The Menu bar provides access to QGIS functions using standard hierarchical menus. The Menus, their options, associated icons and keyboard shortcuts are described below. The keyboard shortcuts can be reconfigured ( Settings ► Keyboard Shortcuts ).

Most menu options have a corresponding tool and vice-versa. However, the Menus are not organized exactly like the toolbars. The locations of menu options in the toolbars are indicated below in the table. Plugins may add new options to Menus. For more information about tools and toolbars, see Toolbars .

QGIS is a cross-platform application. Tools are generally available on all platforms, but they may be placed in different menus, depending on the operating systems. The lists below show the most common locations, including known variations.

7.1.1. Project 

The Project menu provides access and exit points for project files . It provides tools to:

Create a New project file from scratch or use another project file as a template (see Project files options for template configuration)

Open… a project from a file, a GeoPackage, PostgreSQL or Oracle database

Close a project or revert it to its last saved state

Save a project in .qgs or .qgz file format, either as a file or within a GeoPackage, PostgreSQL or Oracle database

Export the map canvas to different formats or use a print layout for more complex output

Set project properties and snapping options for geometry editing.

osx

7.1.2. Edit 

toggleEditing

Tools that depend on the selected layer geometry type i.e. point, polyline or polygon, are activated accordingly:

7.1.3. View 

The map is rendered in map views. You can interact with these views using the View tools. For example, you can:

Create new 2D or 3D map views next to the main map canvas

Zoom or pan to any place

Query the attributes or geometry of the displayed features

Enhance the map view with preview modes, annotations or decorations

Access any panel or toolbar

The menu also allows you to reorganize the QGIS interface itself using actions like:

Toggle Full Screen Mode : covers the whole screen while hiding the title bar

Toggle Panel Visibility : shows or hides enabled panels - useful when digitizing features (for maximum canvas visibility) as well as for (projected/recorded) presentations using QGIS main canvas

Toggle Map Only : hides panels, toolbars, menus and status bar and only shows the map canvas. Combined with the full screen option, it makes your screen display only the map

kde

7.1.4. Layer 

The Layer menu provides a large set of tools to create new data sources, add them to a project or save modifications to them. Using the same data sources, you can also:

Duplicate a layer to generate a copy where you can modify the name, style (symbology, labels, …), joins, … The copy uses the same data source as the original.

Copy and Paste layers or groups from one project to another as a new instance whose properties can be modified independently. As for Duplicate , the layers are still based on the same data source.

or Embed Layers and Groups… from another project, as read-only copies which you cannot modify (see Embedding layers from external projects )

The Layer menu also contains tools to configure, copy or paste layer properties (style, scale, CRS…).

7.1.5. Settings 

7.1.6. plugins .

When starting QGIS for the first time not all core plugins are loaded.

7.1.7. Vector 

This is what the Vector menu looks like if all core plugins are enabled.

By default, QGIS adds Processing algorithms to the Vector menu, grouped by sub-menus. This provides shortcuts for many common vector-based GIS tasks from different providers. If not all these sub-menus are available, enable the Processing plugin in Plugins ► Manage and Install Plugins… .

Note that the list of algorithms and their menu can be modified/extended with any Processing algorithms (read Configuring the Processing Framework ) or some external plugins .

7.1.8. Raster 

This is what the Raster menu looks like if all core plugins are enabled.

By default, QGIS adds Processing algorithms to the Raster menu, grouped by sub-menus. This provides a shortcut for many common raster-based GIS tasks from different providers. If not all these sub-menus are available, enable the Processing plugin in Plugins ► Manage and Install Plugins… .

7.1.9. Database 

This is what the Database menu looks like if all the core plugins are enabled. If no database plugins are enabled, there will be no Database menu.

7.1.10. Web 

This is what the Web menu looks like if all the core plugins are enabled. If no web plugins are enabled, there will be no Web menu.

7.1.11. Mesh 

The Mesh menu provides tools needed to manipulate mesh layers . Third-party plugins can add items to this menu.

7.1.12. Processing 

7.1.13. help , 7.1.14. qgis .

Preferences corresponds to Settings ► Options , About QGIS corresponds to Help ► About and Quit QGIS corresponds to Project ► Exit QGIS for other platforms.

7.2. Panels and Toolbars 

7.2.1. toolbars .

The toolbars provide access to most of the functions in the menus, plus additional tools for interacting with the map. Each toolbar item has pop-up help available. Hover your mouse over the item and a short description of the tool’s purpose will be displayed.

Available toolbars are:

Third-party plugins can extend the default toolbar with their own tools or provide their own toolbar.

Restoring toolbars

7.2.2. Panels 

QGIS provides many panels. Panels are special widgets that you can interact with (selecting options, checking boxes, filling values…) to perform more complex tasks.

Below is a list of the default panels provided by QGIS:

7.3. Status Bar 

The status bar provides you with general information about the map view and processed or available actions, and offers you tools to manage the map view.

7.3.1. Locator bar 

On the left side of the status bar, the locator bar, a quick search widget, helps you find and run any feature or options in QGIS:

Click in the text widget to activate the locator search bar or press Ctrl + K .

Type a text associated with the item you are looking for (name, tag, keyword, …). By default, results are returned for the enabled locator filters, but you can limit the search to a certain scope by prefixing your text with the locator filters prefix, ie. typing l cad will return only the layers whose name contains cad .

The filter can also be selected with a double-click in the menu that shows when accessing the locator widget.

Click on a result to execute the corresponding action, depending on the type of item.

Limit the lookup to particular field(s) of the active layer

By default, a search with the “active layer features” filter ( f ) runs through the whole attribute table of the layer. You can limit the search to a particular field using the @ prefix. E.g., f @name sal or @name sal returns only the features whose “name” attribute contains ‘sal’. Text autocompletion is active when writing and the suggestion can be applied using Tab key.

A more advanced control on the queried fields is possible from the layer Fields tab. Read Fields Properties for details.

Searching is handled using threads, so that results always become available as quickly as possible, even if slow search filters are installed. They also appear as soon as they are encountered by a filter, which means that e.g. a file search filter will show results one by one as the file tree is scanned. This ensures that the UI is always responsive, even if a very slow search filter is present (e.g. one which uses an online service).

The Nominatim locator tool may behave differently (no autocompletion search, delay of fetching results, …) with respect to the OpenStreetMap Nominatim usage policy .

Quick access to the locator’s configurations

search

7.3.2. Reporting actions 

In the area next to the locator bar, a summary of actions you’ve carried out will be shown when needed (such as selecting features in a layer, removing layer, pan distance and direction) or a long description of the tool you are hovering over (not available for all tools).

In case of lengthy operations, such as gathering of statistics in raster layers, executing Processing algorithms or rendering several layers in the map view, a progress bar is displayed in the status bar.

7.3.3. Control the map canvas 

tracking

Next to the coordinate display you will find the Scale display. It shows the scale of the map view. There is a scale selector, which allows you to choose between predefined and custom scales .

lockedGray

To the right of the magnifier tool you can define a current clockwise rotation for your map view in degrees.

checkbox

Calculating the Correct Scale of Your Map Canvas

Note that CRS choice on startup can be set in Settings ► Options ► CRS Handling .

7.3.4. Messaging 

messageLog

An annotation item can be either placed either on screen corrdinates or on map coordinates. More...

#include < qgsannotationitem.h >

Inheritance graph

Detailed Description

An annotation item can be either placed either on screen corrdinates or on map coordinates.

It may reference a feature and displays that associatiation with a balloon like appearance

Definition at line 35 of file qgsannotationitem.h .

Member Enumeration Documentation

◆  mousemoveaction.

Definition at line 38 of file qgsannotationitem.h .

Constructor & Destructor Documentation

◆  qgsannotationitem().

Definition at line 26 of file qgsannotationitem.cpp .

◆  ~QgsAnnotationItem()

Definition at line 41 of file qgsannotationitem.cpp .

Member Function Documentation

◆  _readxml().

Definition at line 444 of file qgsannotationitem.cpp .

◆  _writeXML()

Definition at line 408 of file qgsannotationitem.cpp .

◆  boundingRect()

default implementation for canvas items

Reimplemented from QgsMapCanvasItem .

Definition at line 116 of file qgsannotationitem.cpp .

◆  cursorShapeForAction()

Returns suitable cursor shape for mouse move action.

Definition at line 366 of file qgsannotationitem.cpp .

◆  drawFrame()

Draws the annotation frame to a destination painter.

Definition at line 200 of file qgsannotationitem.cpp .

◆  drawMarkerSymbol()

Draws the map position marker symbol to a destination painter.

Definition at line 234 of file qgsannotationitem.cpp .

◆  drawSelectionBoxes()

Draws selection handles around the item.

Definition at line 255 of file qgsannotationitem.cpp .

◆  frameBackgroundColor()

Definition at line 104 of file qgsannotationitem.h .

◆  frameBorderWidth()

Definition at line 98 of file qgsannotationitem.h .

◆  frameColor()

Definition at line 101 of file qgsannotationitem.h .

◆  frameSize()

Definition at line 88 of file qgsannotationitem.h .

◆  mapPosition()

Returns the map position of the annotation, if it is attached to a fixed map position.

Reimplemented from QgsAnnotation .

Definition at line 73 of file qgsannotationitem.h .

◆  mapPositionCrs()

Returns the CRS of the map position.

Definition at line 85 of file qgsannotationitem.h .

◆  mapPositionFixed()

Returns true if the annotation is attached to a fixed map position, or false if the annotation uses a position relative to the current map extent.

Implements QgsAnnotation .

Definition at line 70 of file qgsannotationitem.h .

◆  markerSymbol()

Definition at line 95 of file qgsannotationitem.h .

◆  minimumFrameSize()

Reimplemented in QgsHtmlAnnotationItem , and QgsFormAnnotationItem .

Definition at line 121 of file qgsannotationitem.cpp .

◆  moveActionForPosition()

Returns the mouse move behaviour for a given position.

Definition at line 307 of file qgsannotationitem.cpp .

◆  offsetFromReferencePoint()

Definition at line 91 of file qgsannotationitem.h .

◆  paint() [1/2]

Paint the annotation to a destination painter.

Definition at line 498 of file qgsannotationitem.cpp .

◆  paint() [2/2]

function to be implemented by derived classes

Implements QgsMapCanvasItem .

Reimplemented in QgsTextAnnotationItem , QgsHtmlAnnotationItem , QgsSvgAnnotationItem , and QgsFormAnnotationItem .

Definition at line 504 of file qgsannotationitem.cpp .

◆  pointOnLineWithDistance()

Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point.

Definition at line 298 of file qgsannotationitem.cpp .

◆  readXML()

Implemented in QgsHtmlAnnotationItem , QgsFormAnnotationItem , QgsTextAnnotationItem , and QgsSvgAnnotationItem .

◆  relativePosition()

Returns the relative position of the annotation, if it is not attached to a fixed map position.

The coordinates in the return point should be between 0 and 1, and represent the relative percentage for the position compared to the map width and height.

Definition at line 60 of file qgsannotationitem.cpp .

◆  scaledSymbolSize()

Returns the symbol size scaled in (mapcanvas) pixels.

Used for the counding rect calculation

Definition at line 392 of file qgsannotationitem.cpp .

◆  scaleFactor()

Returns a scaling factor which should be applied to painters before rendering the item.

Definition at line 67 of file qgsannotationitem.cpp .

◆  segment()

Returns frame width in painter units.

Gets the frame line (0 is the top line, 1 right, 2 bottom, 3 left)

Definition at line 277 of file qgsannotationitem.cpp .

◆  setFrameBackgroundColor()

Definition at line 103 of file qgsannotationitem.h .

◆  setFrameBorderWidth()

Definition at line 97 of file qgsannotationitem.h .

◆  setFrameColor()

Definition at line 100 of file qgsannotationitem.h .

◆  setFrameSize()

Definition at line 226 of file qgsannotationitem.cpp .

◆  setItemData()

deprecated - do not use

Definition at line 493 of file qgsannotationitem.cpp .

◆  setMapPosition()

Definition at line 53 of file qgsannotationitem.cpp .

◆  setMapPositionCrs()

Sets the CRS of the map position.

Definition at line 72 of file qgsannotationitem.cpp .

◆  setMapPositionFixed()

Definition at line 84 of file qgsannotationitem.cpp .

◆  setMarkerSymbol()

Set symbol that is drawn on map position.

Takes ownership

Definition at line 46 of file qgsannotationitem.cpp .

◆  setOffsetFromReferencePoint()

Definition at line 77 of file qgsannotationitem.cpp .

◆  showItem()

Returns true if the annotation should be shown.

Definition at line 79 of file qgsannotationitem.h .

◆  updateBalloon()

Check where to attach the balloon connection between frame and map point.

Definition at line 142 of file qgsannotationitem.cpp .

◆  updateBoundingRect()

Definition at line 126 of file qgsannotationitem.cpp .

◆  updatePosition()

called on changed extent or resize event to update position of the item

Definition at line 103 of file qgsannotationitem.cpp .

◆  writeXML()

Member data documentation, ◆  mballoonsegment.

Segment number where the connection to the map point is attached.

-1 if no balloon needed (e.g. if point is contained in frame)

Definition at line 143 of file qgsannotationitem.h .

◆  mBalloonSegmentPoint1

First segment point for drawing the connection (ccw direction)

Definition at line 145 of file qgsannotationitem.h .

◆  mBalloonSegmentPoint2

Second segment point for drawing the balloon connection (ccw direction)

Definition at line 147 of file qgsannotationitem.h .

◆  mBoundingRect

Bounding rect (including item frame and balloon)

Definition at line 132 of file qgsannotationitem.h .

◆  mFrameBackgroundColor

Definition at line 140 of file qgsannotationitem.h .

◆  mFrameBorderWidth

Width of the frame.

Definition at line 137 of file qgsannotationitem.h .

◆  mFrameColor

Frame / balloon color.

Definition at line 139 of file qgsannotationitem.h .

◆  mFrameSize

Size of the frame (without balloon)

Definition at line 130 of file qgsannotationitem.h .

◆  mMapPosition

Map position (in case mMapPositionFixed is true)

Definition at line 122 of file qgsannotationitem.h .

◆  mMapPositionCrs

CRS of the map position.

Definition at line 124 of file qgsannotationitem.h .

◆  mMapPositionFixed

True: the item stays at the same map position, False: the item stays on same screen position.

Definition at line 120 of file qgsannotationitem.h .

◆  mMarkerSymbol

Point symbol that is to be drawn at the map reference location.

Definition at line 135 of file qgsannotationitem.h .

◆  mOffsetFromReferencePoint

Describes the shift of the item content box to the reference point.

Definition at line 127 of file qgsannotationitem.h .

  • /tmp/buildd/qgis-2.18.21+99unstable/src/gui/ qgsannotationitem.h
  • /tmp/buildd/qgis-2.18.21+99unstable/src/gui/ qgsannotationitem.cpp

doxygen

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

qgshtmlannotation.cpp

Latest commit, file metadata and controls.

  • About plugins
  • QGIS Layer Definition File
  • New Plugins
  • Updated Plugins
  • Experimental
  • Top downloads
  • QGIS Server plugins

Plugin Tags

Qgis python plugins repository, version: [1659] ors tools 1.8.2, version management, sustaining members.

qgis html annotation

Gold Sponsor

qgis html annotation

Silver Sponsors

Sustaining member logos

IMAGES

  1. GIS: QGIS html annotation relative paths (2 Solutions!!)

    qgis html annotation

  2. Introducing Annotation Layers in QGIS 3.22!

    qgis html annotation

  3. How to create annotation layers (advanced labeling) in QGIS

    qgis html annotation

  4. 11. Outils généraux

    qgis html annotation

  5. QGIS Tutorials 027 create annotation layers (advanced labels) 💬📐

    qgis html annotation

  6. Introducing Annotation Layers in QGIS 3.22!

    qgis html annotation

VIDEO

  1. QGIS plagin Annotation Manager moduli

  2. XYZto3D QGIS Plugin

  3. Categorized Symbolisation in QGIS

  4. Annotation Manager QGIS

  5. How to Download QGIS

  6. How to Reascript: 10) Chunks

COMMENTS

  1. Automatically create Text/HTML annotations in QGIS on a Point Layer

    Note that the HTML annotation tool doesn't take the full HTML spec, it's a pseudo-HTML processor but it comes really close. No doubt there's a way to write a script for QGIS that would take the list of points and, if there are coords for each, automatically place all the HTML annotation objects. That would get you a lot closer.

  2. Introducing Annotation Layers in QGIS 3.22!

    You can do this through the " View " - " Toolbars " menu by checking the " Annotations Toolbar " option. This will show a new toolbar, full of useful actions for creating and working with annotation layers: Annotation layers can contain a whole mix of different annotation types. In QGIS 3.22 this includes markers, lines, polygons ...

  3. 11. General Tools

    Text Annotation for custom formatted text. HTML Annotation to place the content of an html file. SVG Annotation to add an SVG symbol. Form Annotation: useful to display attributes of a vector layer in a customized ui file (see Fig. 11.17). This is similar to the custom attribute forms, but displayed in an annotation item.

  4. 11.1. 2D Map View

    Text Annotation for custom formatted text. HTML Annotation to place the content of an html file. SVG Annotation to add an SVG symbol. Form Annotation: useful to display attributes of a vector layer in a customized ui file (see Fig. 11.14). This is similar to the custom attribute forms, but displayed in an annotation item.

  5. 14.3. Setting a label

    The CSS formatting rules vertical-align: super or vertical-align: sub are also available in any other HTML element (annotation, layout label or HTML items, …).. In order to use the HTML formatting, you need to provide the HTML code in the Value field. The expression is parsed and any supported HTML tag overrides its corresponding setting in the labels properties.

  6. How to create annotation layers (advanced labeling) in QGIS

    A tutorial on how to create annotation layers (advanced labeling) in QGIS

  7. Class: QgsHtmlAnnotation

    Copies common annotation properties to the targe annotation. Can be used within QgsAnnotation.clone() implementations to assist with creating copies. Returns a new QgsHtmlAnnotation object. Sets the file path for the source HTML file. Returns the file path for the source HTML file. Last updated on 03:33 Jul 21, 2021.

  8. QGIS API Documentation: QgsTextAnnotation Class Reference

    Returns the size (in millimeters) of the annotation's frame (the main area in which the annotation's content is drawn). More... bool hasFixedMapPosition const Returns true if the annotation is attached to a fixed map position, or false if the annotation uses a position relative to the current map extent. More... bool isVisible const

  9. QGIS API Documentation: QgsHtmlAnnotation Class Reference

    Clones the annotation, returning a new copy of the annotation reflecting the annotation's current state. QString htmlSource const Returns html source text. QSizeF minimumFrameSize const override Returns the minimum frame size for the annotation. void readXml (const QDomElement &itemElem, const QgsReadWriteContext &context) override

  10. QGIS API Documentation: QgsAnnotationLayer Class Reference

    Returns a list of the IDs of all annotation items within the specified bounds (in layer CRS), when rendered using the given render context.. The optional feedback argument can be used to cancel the search early.. Since QGIS 3.22 . Definition at line 249 of file qgsannotationlayer.cpp. paintEffect()

  11. QGIS API Documentation: QgsHtmlAnnotationItem Class Reference

    An annotation item that embedds a designer form showing the feature attribute. More... #include <qgshtmlannotationitem.h>

  12. QgsHtmlAnnotationItem

    qgis-sample-QgsHtmlAnnotationItem.py # coding: utf-8 from PyQt4.QtCore import QSizeF from PyQt4.QtGui import QColor from qgis.core import QgsPoint from qgis.gui import QgsHtmlAnnotationItem from qgis.utils import iface layer = iface.activeLayer() canvas = iface.mapCanvas() html_annotation_item = QgsHtmlAnnotationItem( canvas, layer ) X, Y = float(3), float(45) point = QgsPoint(X, Y) html ...

  13. 7. QGIS GUI

    QGIS GUI — QGIS Documentation documentation. 7. QGIS GUI. The QGIS graphical user interface (GUI) is shown in the figure below (the numbers 1 through 5 in yellow circles indicate important elements of the QGIS GUI, and are discussed below). Fig. 7.1 QGIS GUI with Alaska sample data.

  14. QGIS API Documentation: QgsAnnotationItem Class Reference

    Returns true if the annotation is attached to a fixed map position, or false if the annotation uses a position relative to the current map extent. See also mapPosition() relativePositon() Implements QgsAnnotation. Definition at line 70 of file qgsannotationitem.h.

  15. QGIS API Documentation: QgsHtmlAnnotation Class Reference

    Clones the annotation, returning a new copy of the annotation reflecting the annotation's current state. More... QSizeF minimumFrameSize const override Returns the minimum frame size for the annotation. More... void readXml (const QDomElement &itemElem, const QgsReadWriteContext &context) override Restores the annotation's state from a DOM element.

  16. QGIS/src/core/annotations/qgshtmlannotation.cpp at master

    QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS) - qgis/QGIS

  17. Working with annotations in QGIS 2.0

    This screencast shows how annotations work and the new annotation features in QGIS 2.0.Please note: In the form annotations part I forgot to show how the for...

  18. ORS Tools 1.8.2

    Fixed. - remove structural pattern matching for compatibility with python<3.10. 2024/05/17 v1.8.0. Added. - Add support for decimal ranges with isochrones. - Add hint for joining with `Layer ID Field`. - Add option to export order of optimization route points. - Add `extra_info` parameter to directions processing algorithms. Changed.

  19. Datum Target symbol not visible in model annotation for ISO ...

    Ask the Assistant. Datum target symbol not showing in model annotation with ISO standard in Inventor. It does show when using ANSI standard. Possible corruption in Datum Target style. How to address a possibly corrupt drawing style in Inventor.