QGIS API Documentation 3.39.0-Master (bca3cdb6021)
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
62 bool setNewItem( QgsLayoutItem *item ) override;
63
64 private slots:
65
66 void setGuiElementValues();
67 void updateItemLayers();
68 void layoutAtlasToggled( bool atlasEnabled );
69 void atlasLayerChanged( QgsVectorLayer *layer );
70
71 private:
72
73 int mBlockChanges = 0;
74
75 QgsLayoutDesignerInterface *mInterface = nullptr;
76
77 QPointer< QgsLayoutItemElevationProfile > mProfile = nullptr;
78
79 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
80
81 std::unique_ptr< QgsLayerTree > mLayerTree;
82 QgsLayerTreeRegistryBridge *mLayerTreeBridge = nullptr;
83 QgsElevationProfileLayerTreeView *mLayerTreeView = nullptr;
84 QMenu *mCopyFromDockMenu = nullptr;
85};
86
87#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.