QGIS provides a large set of items to layout a map. They can be of map, legend, scale bar, picture, table, north arrow, image type… They however share some common options and behavior that are exposed below.
Items can be created using different tools, either from scratch or based on existing items.
To create a layout item from scratch:
Select the corresponding tool either from the Toolbox bar.
menu or theThen:
Click on the page and fill the size and placement information requested in the New Item Properties dialog that pops up (for details, see Position and Size);
New Item properties dialog
Or click-and-drag to define the initial size and placement of the item. You can rely on grids and guides snapping for a better position.
Note
Because they can have particular shapes, drawing node or arrow items does not work with one-click nor click-and-drag methods; you need to click and place each node of the item. See Les formes basées sur des nœuds for more details.
You can also:
Select an existing item with the Select/Move item button from
the Toolbox toolbar
Use the contextual menu or the
menu tools to copy/cut the item and paste it at the mouse position as a new item.You can also use the Paste in Place (Ctrl+Shift+V
) command
to duplicate an item from one page to another and place it in the new page at
the same coordinates as the original.
Moreover, you can create items using a print layout template (for details, see The Layout Manager) through the command.
Astuce
Add layout items using the file browser
From your file browser or using the Browser panel, drag-and-drop a
print layout template (.qpt
file) onto a print layout dialog and QGIS
automatically adds all items from that template to the layout.
Each item inside the print layout can be moved and resized to create a perfect
layout. For both operations the first step is to activate the
Select/Move item tool and click on the item.
You can select multiple items with the Select/Move item button:
click and drag over the items or hold the
Shift
button and click on each
of the items you want.
To deselect an item, click on it holding the Shift
button.
Each time there’s a selection, count of selected items is displayed on the status bar. Inside the
menu, you can find actions to select all the items, clear all selections, invert the current selection and more…Unless Shift
will maintain the aspect ratio. Holding Alt
will
resize from the item center.
To move a layout item, select it with the mouse and move while holding the left
button. If you need to constrain the movements to the horizontal or vertical
axis, just hold the Shift
button on the keyboard while moving the mouse.
You can also move a selected item using the Arrow keys
on the keyboard;
if the movement is too slow, you can speed it up by holding Shift
.
If you need better precision, use the Position and size properties,
or grid/guides snapping as explained above for item’s creation.
Resizing or moving several items at once is made the same way as for a single item. QGIS however provides some advanced tools to automatically resize a selection of items following different rules:
Likewise, automated tools are available to organize multiple items position by distributing equidistantly:
Grouping items allows you to manipulate a set of items like a single one: you can easily resize, move, delete, copy the items as a whole.
To create a group of items, select more than one and press the
Group button on the menu or the
Actions toolbar or from the right-click menu. A row named
Group
is added to the panel and can be locked or hidden like
any other Items panel’s object.
Grouped items are not individually selectable on the canvas; use the Items panel
for direct selection and access the item’s properties panel.
Once you have found the correct position for an item, you can lock it by using
the Lock selected items button in the
menu or the Actions toolbar or ticking the box next
to the item in the panel. Locked items are not
selectable on the canvas.
Les éléments verrouillés peuvent être déverrouillés en sélectionnant l’élément dans l’onglet
et décochés dans la case à cocher, ou vous pouvez utiliser les boutons dans la barre d’outils.Raising or lowering the visual hierarchy for elements are inside the
Raise selected items pull-down menu. Choose an element on the print layout
canvas and select the matching functionality to raise or lower the selected
element compared to the other elements. This order is
shown in the panel. You can also raise or lower objects
in the panel by clicking and dragging an object’s label
in this list.
Alignment helper lines in the print layout
There are several alignment options available within the
Align selected items pull-down menu (see figure_layout_common_align).
To use an alignment function, you first select the elements and then click on
one of the alignment icons:
All selected elements will then be aligned to their common bounding box. When moving items on the layout canvas, alignment helper lines appear when borders, centers or corners are aligned.
Layout items have a set of common properties you will find at the bottom of the Item Properties panel: Position and size, Rotation, Frame, Background, Item ID, Variables and Rendering (See figure_layout_common).
Common Item Properties groups
Note
The Data defined override icon next to most of the
options means that you can associate that property with a layer, features
attributes, geometry or with any other layout item’s property, using
expressions or variables. For more information see Valeurs définies par des données.
Extending the features of the New Item Properties dialog with data-defined capabilities, this group allows you to place the items accurately.
New Item properties dialog
QGIS allows advanced rendering for layout items just like vector and raster layers.
Mode de rendu
The Variables lists all the variables available at the layout item’s level (which includes all global, project and composition’s variables). Map items also include Map settings variables that provide easy access to values like the map’s scale, extent, and so on.
Sous la section guilabel:Variables, il est aussi possible de gérer les variables liées à l’élément. Cliquez sur le bouton afin d’ajouter une variable personnalisée. De même, sélectionnez n’importe quelle variable personnalisée associée à l’élément en cours et cliquez sur le bouton
pour le supprimer.
More information on variables usage in the Storing values in Variables section.