QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgslayoutelevationprofilewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutelevationprofilewidget.h
3 ----------------------
4 begin : January 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSLAYOUTELEVATIONPROFILEWIDGET_H
19#define QGSLAYOUTELEVATIONPROFILEWIDGET_H
20
21// We don't want to expose this in the public API
22#define SIP_NO_FILE
23
24#include "qgis_gui.h"
25#include "ui_qgslayoutelevationprofilewidgetbase.h"
26#include "qgslayoutitemwidget.h"
28#include <functional>
29#include <QPointer>
30
33
41class GUI_EXPORT QgsLayoutElevationProfileWidget : public QgsLayoutItemBaseWidget, public QgsExpressionContextGenerator, private Ui::QgsLayoutElevationProfileWidgetBase
42{
43 Q_OBJECT
44 public:
48 void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
51 void setReportTypeString( const QString &string ) override;
52
56 void copySettingsFromProfileCanvas( QgsElevationProfileCanvas *canvas );
57
58 static std::function<void( QgsLayoutElevationProfileWidget *, QMenu * )> sBuildCopyMenuFunction;
59
60 protected:
61 bool setNewItem( QgsLayoutItem *item ) override;
62
63 private slots:
64
65 void setGuiElementValues();
66 void updateItemLayers();
67 void layoutAtlasToggled( bool atlasEnabled );
68 void atlasLayerChanged( QgsVectorLayer *layer );
69
70 private:
71 int mBlockChanges = 0;
72
73 QgsLayoutDesignerInterface *mInterface = nullptr;
74
75 QPointer<QgsLayoutItemElevationProfile> mProfile = nullptr;
76
77 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
78
79 std::unique_ptr<QgsLayerTree> mLayerTree;
80 QgsLayerTreeRegistryBridge *mLayerTreeBridge = nullptr;
81 QgsElevationProfileLayerTreeView *mLayerTreeView = nullptr;
82 QMenu *mCopyFromDockMenu = nullptr;
83};
84
85#endif //QGSLAYOUTELEVATIONPROFILEWIDGET_H
A canvas for elevation profiles.
A layer tree view for elevation profiles.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Listens to the updates in map layer registry and does changes in layer tree.
A common interface for layout designer dialogs and widgets.
A widget for layout elevation profile item settings.
A base class for property widgets for layout items.
virtual bool setNewItem(QgsLayoutItem *item)
Attempts to update the widget to show the properties for the specified item.
virtual void setDesignerInterface(QgsLayoutDesignerInterface *iface)
Sets the the layout designer interface in which the widget is being shown.
virtual void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
virtual void setReportTypeString(const QString &string)
Sets the string to use to describe the current report type (e.g.
A layout item subclass for elevation profile plots.
A widget for controlling the common properties of layout items (e.g.
Base class for graphical items within a QgsLayout.
Interface for master layout type objects, such as print layouts and reports.
Represents a vector layer which manages a vector based data sets.