QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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 "ui_qgslayoutelevationprofilewidgetbase.h"
25
26#include <functional>
27
28#include "qgis_gui.h"
30#include "qgslayoutitemwidget.h"
31
32#include <QPointer>
33
37
45class GUI_EXPORT QgsLayoutElevationProfileWidget : public QgsLayoutItemBaseWidget, public QgsExpressionContextGenerator, private Ui::QgsLayoutElevationProfileWidgetBase
46{
47 Q_OBJECT
48 public:
52 void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
55 void setReportTypeString( const QString &string ) override;
56
61
62 static std::function<void( QgsLayoutElevationProfileWidget *, QMenu * )> sBuildCopyMenuFunction;
63
64 protected:
65 bool setNewItem( QgsLayoutItem *item ) override;
66
67 private slots:
68
69 void setGuiElementValues();
70 void updateItemSources();
71 void layoutAtlasToggled( bool atlasEnabled );
72 void atlasLayerChanged( QgsVectorLayer *layer );
73
74 private:
75 void syncLayerTreeAndProfileItemSources();
76
77 int mBlockChanges = 0;
78
79 QgsLayoutDesignerInterface *mInterface = nullptr;
80
81 QPointer<QgsLayoutItemElevationProfile> mProfile = nullptr;
82
83 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
84
85 std::unique_ptr<QgsLayerTree> mLayerTree;
86 QgsLayerTreeRegistryBridge *mLayerTreeBridge = nullptr;
87 QgsElevationProfileLayerTreeView *mLayerTreeView = nullptr;
88 QMenu *mCopyFromDockMenu = nullptr;
89
90 friend class TestQgsLayoutGui;
91};
92
93#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 layer changes from a QgsProject and applies changes to a QgsLayerTree.
A common interface for layout designer dialogs and widgets.
void copySettingsFromProfileCanvas(QgsElevationProfileCanvas *canvas)
Copies selected settings from a elevation profile canvas.
static std::function< void(QgsLayoutElevationProfileWidget *, QMenu *)> sBuildCopyMenuFunction
QgsLayoutElevationProfileWidget(QgsLayoutItemElevationProfile *profile)
constructor
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.
QgsLayoutItemBaseWidget(QWidget *parent SIP_TRANSFERTHIS, QgsLayoutObject *layoutObject)
Constructor for QgsLayoutItemBaseWidget, linked with the specified layoutObject.
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.
Registry of profile sources used by QgsProfilePlotRenderer.
Represents a vector layer which manages a vector based dataset.