Subgroup: Layout

Class: QgsLayoutDesignerInterface

class qgis.gui.QgsLayoutDesignerInterface(parent: QObject = None)

Bases: PyQt5.QtCore.QObject

Constructor for QgsLayoutDesignerInterface.

A common interface for layout designer dialogs and widgets.

Provides a common interface and stable API for layout designer dialogs and widgets. This interface can be used by plugins and scripts to interact with open layout designer dialogs.

Note

Layout designer dialogs are transitory. They are created only on demand (when a user opens the dialog) and are deleted as soon as the user closes the dialog. There can be multiple designer dialogs open at any one time, and each is a separate instance of the dialog and QgsLayoutDesignerInterface. Accordingly, plugins must take care to react to newly created designer dialogs and apply their customizations to all newly created dialogs. This can be done by listening for the QgisInterface.layoutDesignerOpened signal. Plugins must also listen for the QgisInterface.layoutDesignerWillBeClosed signal and gracefully cleanup any customizations before the designer dialog is deleted.

New in version 3.0: Methods

actionsToolbar Returns a reference to the designer’s “Actions” toolbar.
addDockWidget Adds a dock widget to the layout designer, in the specified dock area.
atlasMenu Returns a reference to the designer’s “Atlas” menu.
atlasPreviewEnabled Returns whether the atlas preview mode is enabled in the designer.
atlasToolbar Returns a reference to the designer’s “Atlas” toolbar.
childEvent
close Closes the layout designer.
connectNotify
customEvent
disconnectNotify
editMenu Returns a reference to the designer’s “Edit” menu.
isSignalConnected
itemsMenu Returns a reference to the designer’s “Items” menu.
layout Returns the current layout displayed in the designer.
layoutMenu Returns a reference to the designer’s “Layout” menu.
layoutToolbar Returns a reference to the designer’s “Layout” toolbar.
masterLayout Returns the master layout displayed in the designer.
messageBar Returns the designer’s message bar.
navigationToolbar Returns a reference to the designer’s “Navigation” toolbar.
receivers
removeDockWidget Removes the specified dock widget from layout designer (without deleting it).
reportMenu Returns a reference to the designer’s “Report” menu.
selectItems Selects the specified items.
sender
senderSignalIndex
setAtlasPreviewEnabled Toggles whether the atlas preview mode should be enabled in the designer.
settingsMenu Returns a reference to the designer’s “Settings” menu.
showItemOptions Shows the configuration widget for the specified layout item.
showRulers Toggles whether or not the rulers should be visible in the designer.
timerEvent
view Returns the layout view utilized by the designer.
viewMenu Returns a reference to the designer’s “View” menu.
window Returns a pointer to the designer window.

Signals

Attributes

actionsToolbar(self) → QToolBar

Returns a reference to the designer’s “Actions” toolbar.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutToolbar()

See also

atlasToolbar()

New in version 3.4.

addDockWidget(self, area: Qt.DockWidgetArea, dock: QDockWidget)

Adds a dock widget to the layout designer, in the specified dock area.

Note

See class documentation for notes regarding handling customization of designer dialogs.

New in version 3.4.

atlasMenu(self) → QMenu

Returns a reference to the designer’s “Atlas” menu.

Note that this may not exist or may be hidden if the designer is in report mode.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

editMenu()

See also

viewMenu()

See also

itemsMenu()

See also

reportMenu()

See also

settingsMenu()

New in version 3.4.

atlasPreviewEnabled(self) → bool

Returns whether the atlas preview mode is enabled in the designer.

New in version 3.4.

atlasToolbar(self) → QToolBar

Returns a reference to the designer’s “Atlas” toolbar.

Note that this toolbar may not exist or may be hidden if the designer is in report mode.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutToolbar()

See also

actionsToolbar()

New in version 3.4.

childEvent()
close(self)

Closes the layout designer.

connectNotify()
customEvent()
disconnectNotify()
editMenu(self) → QMenu

Returns a reference to the designer’s “Edit” menu.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

viewMenu()

See also

itemsMenu()

See also

atlasMenu()

See also

reportMenu()

See also

settingsMenu()

New in version 3.4.

isSignalConnected()
itemsMenu(self) → QMenu

Returns a reference to the designer’s “Items” menu.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

editMenu()

See also

viewMenu()

See also

atlasMenu()

See also

reportMenu()

See also

settingsMenu()

New in version 3.4.

layout(self) → QgsLayout

Returns the current layout displayed in the designer.

See also

view()

layoutMenu(self) → QMenu

Returns a reference to the designer’s “Layout” menu.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

editMenu()

See also

viewMenu()

See also

itemsMenu()

See also

atlasMenu()

See also

reportMenu()

See also

settingsMenu()

New in version 3.4.

layoutToolbar(self) → QToolBar

Returns a reference to the designer’s “Layout” toolbar.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

actionsToolbar()

See also

atlasToolbar()

New in version 3.4.

masterLayout(self) → QgsMasterLayoutInterface

Returns the master layout displayed in the designer.

See also

layout()

messageBar(self) → QgsMessageBar

Returns the designer’s message bar.

navigationToolbar(self) → QToolBar

Returns a reference to the designer’s “Navigation” toolbar.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutToolbar()

See also

actionsToolbar()

See also

atlasToolbar()

New in version 3.4.

receivers()
removeDockWidget(self, dock: QDockWidget)

Removes the specified dock widget from layout designer (without deleting it).

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

addDockWidget()

New in version 3.4.

reportMenu(self) → QMenu

Returns a reference to the designer’s “Report” menu.

Note that this may not exist or may be hidden if the designer is not in report mode.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

editMenu()

See also

viewMenu()

See also

itemsMenu()

See also

atlasMenu()

See also

settingsMenu()

New in version 3.4.

selectItems(self, items: Iterable[QgsLayoutItem])

Selects the specified items.

sender()
senderSignalIndex()
setAtlasPreviewEnabled(self, enabled: bool)

Toggles whether the atlas preview mode should be enabled in the designer.

New in version 3.4.

settingsMenu(self) → QMenu

Returns a reference to the designer’s “Settings” menu.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

editMenu()

See also

viewMenu()

See also

itemsMenu()

See also

atlasMenu()

See also

reportMenu()

New in version 3.4.

showItemOptions(self, item: QgsLayoutItem, bringPanelToFront: bool = True)

Shows the configuration widget for the specified layout item.

If bringPanelToFront is true, then the item properties panel will be automatically shown and raised to the top of the interface.

New in version 3.4.

showRulers(self, visible: bool)

Toggles whether or not the rulers should be visible in the designer.

New in version 3.4.

timerEvent()
view(self) → QgsLayoutView

Returns the layout view utilized by the designer.

See also

layout()

viewMenu(self) → QMenu

Returns a reference to the designer’s “View” menu.

Note

See class documentation for notes regarding handling customization of designer dialogs.

See also

layoutMenu()

See also

editMenu()

See also

itemsMenu()

See also

atlasMenu()

See also

reportMenu()

See also

settingsMenu()

New in version 3.4.

window(self) → QWidget

Returns a pointer to the designer window.

New in version 3.4.