43#include "moc_qgslayoutelevationprofilewidget.cpp"
45using namespace Qt::StringLiterals;
60 mCopyFromDockMenu =
new QMenu(
this );
61 connect( mCopyFromDockMenu, &QMenu::aboutToShow,
this, [
this] {
65 connect( mActionRefresh, &QAction::triggered,
this, [
this] {
70 mProfile->invalidateCache();
74 QToolButton *copyFromDockButton =
new QToolButton();
75 copyFromDockButton->setAutoRaise(
true );
76 copyFromDockButton->setToolTip( tr(
"Copy From Profile" ) );
77 copyFromDockButton->setMenu( mCopyFromDockMenu );
78 copyFromDockButton->setPopupMode( QToolButton::InstantPopup );
81 mDockToolbar->addWidget( copyFromDockButton );
85 mainLayout->addWidget( mItemPropertiesWidget );
90 mSpinTolerance->setClearValue( 0 );
91 connect( mSpinTolerance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
92 if ( !mProfile || mBlockChanges )
96 mProfile->setTolerance( value );
97 mProfile->invalidateCache();
99 mProfile->endCommand();
102 connect( mCheckControlledByAtlas, &QCheckBox::toggled,
this, [
this] {
103 if ( !mProfile || mBlockChanges )
106 mProfile->beginCommand( tr(
"Change Profile Atlas Control" ) );
107 mProfile->setAtlasDriven( mCheckControlledByAtlas->isChecked() );
108 mProfile->invalidateCache();
110 mProfile->endCommand();
116 if ( !mProfile || mBlockChanges )
120 mProfile->setSubsectionsSymbol( mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() );
121 mProfile->invalidateCache();
123 mProfile->endCommand();
127 connect( mSubsectionsActivateCheck, &QGroupBox::toggled,
this, [
this] {
128 if ( !mProfile || mBlockChanges )
131 const bool subsectionsActivated = mSubsectionsActivateCheck->isChecked();
133 std::unique_ptr<QgsLineSymbol> subSectionsSymbol( subsectionsActivated ? mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() :
nullptr );
134 mProfile->setSubsectionsSymbol( subSectionsSymbol.release() );
136 mProfile->invalidateCache();
138 mProfile->endCommand();
141 mSpinMinDistance->setClearValue( 0 );
142 connect( mSpinMinDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
143 if ( !mProfile || mBlockChanges )
147 mProfile->plot()->setXMinimum( value );
148 mProfile->invalidateCache();
150 mProfile->endCommand();
153 connect( mSpinMaxDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
154 if ( !mProfile || mBlockChanges )
158 mProfile->plot()->setXMaximum( value );
159 mProfile->invalidateCache();
161 mProfile->endCommand();
164 mSpinMinElevation->setClearValue( 0 );
165 connect( mSpinMinElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
166 if ( !mProfile || mBlockChanges )
170 mProfile->plot()->setYMinimum( value );
171 mProfile->invalidateCache();
173 mProfile->endCommand();
176 connect( mSpinMaxElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
177 if ( !mProfile || mBlockChanges )
181 mProfile->plot()->setYMaximum( value );
182 mProfile->invalidateCache();
184 mProfile->endCommand();
189 if ( !mProfile || mBlockChanges )
193 mProfile->plot()->xAxis().setGridMajorSymbol( mDistanceAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
194 mProfile->invalidateCache();
196 mProfile->endCommand();
202 if ( !mProfile || mBlockChanges )
206 mProfile->plot()->xAxis().setGridMinorSymbol( mDistanceAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
207 mProfile->invalidateCache();
209 mProfile->endCommand();
213 connect( mDistanceAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
214 if ( !mProfile || mBlockChanges )
218 mProfile->plot()->xAxis().setGridIntervalMajor( value );
219 mProfile->invalidateCache();
221 mProfile->endCommand();
224 connect( mDistanceAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
225 if ( !mProfile || mBlockChanges )
229 mProfile->plot()->xAxis().setGridIntervalMinor( value );
230 mProfile->invalidateCache();
232 mProfile->endCommand();
235 connect( mDistanceAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
236 if ( !mProfile || mBlockChanges )
240 mProfile->plot()->xAxis().setLabelInterval( value );
241 mProfile->invalidateCache();
243 mProfile->endCommand();
248 if ( !mProfile || mBlockChanges )
252 mProfile->plot()->yAxis().setGridMajorSymbol( mElevationAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
253 mProfile->invalidateCache();
255 mProfile->endCommand();
261 if ( !mProfile || mBlockChanges )
265 mProfile->plot()->yAxis().setGridMinorSymbol( mElevationAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
266 mProfile->invalidateCache();
268 mProfile->endCommand();
272 connect( mElevationAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
273 if ( !mProfile || mBlockChanges )
277 mProfile->plot()->yAxis().setLabelInterval( value );
278 mProfile->invalidateCache();
280 mProfile->endCommand();
283 connect( mElevationAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
284 if ( !mProfile || mBlockChanges )
288 mProfile->plot()->yAxis().setGridIntervalMajor( value );
289 mProfile->invalidateCache();
291 mProfile->endCommand();
294 connect( mElevationAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
295 if ( !mProfile || mBlockChanges )
299 mProfile->plot()->yAxis().setGridIntervalMinor( value );
300 mProfile->invalidateCache();
302 mProfile->endCommand();
307 if ( !mProfile || mBlockChanges )
311 mProfile->plot()->setChartBackgroundSymbol( mChartBackgroundSymbolButton->clonedSymbol<
QgsFillSymbol>() );
312 mProfile->invalidateCache();
314 mProfile->endCommand();
320 if ( !mProfile || mBlockChanges )
324 mProfile->plot()->setChartBorderSymbol( mChartBorderSymbolButton->clonedSymbol<
QgsFillSymbol>() );
325 mProfile->invalidateCache();
327 mProfile->endCommand();
331 connect( mDistanceAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
332 if ( !mProfile || mBlockChanges )
337 widget->
setFormat( mProfile->plot()->xAxis().numericFormat() );
340 mProfile->plot()->xAxis().setNumericFormat( widget->
format() );
341 mProfile->invalidateCache();
342 mProfile->endCommand();
348 connect( mElevationAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
349 if ( !mProfile || mBlockChanges )
354 widget->
setFormat( mProfile->plot()->yAxis().numericFormat() );
357 mProfile->plot()->yAxis().setNumericFormat( widget->
format() );
358 mProfile->invalidateCache();
359 mProfile->endCommand();
365 mDistanceAxisLabelFontButton->setDialogTitle( tr(
"Distance Label Font" ) );
366 mElevationAxisLabelFontButton->setDialogTitle( tr(
"Elevation Label Font" ) );
371 if ( !mProfile || mBlockChanges )
375 mProfile->plot()->xAxis().setTextFormat( mDistanceAxisLabelFontButton->textFormat() );
376 mProfile->invalidateCache();
377 mProfile->endCommand();
382 if ( !mProfile || mBlockChanges )
386 mProfile->plot()->yAxis().setTextFormat( mElevationAxisLabelFontButton->textFormat() );
387 mProfile->invalidateCache();
388 mProfile->endCommand();
392 mSpinLeftMargin->setClearValue( 0 );
393 connect( mSpinLeftMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
394 if ( !mProfile || mBlockChanges )
398 QgsMargins margins = mProfile->plot()->margins();
400 mProfile->plot()->setMargins( margins );
401 mProfile->invalidateCache();
403 mProfile->endCommand();
406 mSpinRightMargin->setClearValue( 0 );
407 connect( mSpinRightMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
408 if ( !mProfile || mBlockChanges )
412 QgsMargins margins = mProfile->plot()->margins();
414 mProfile->plot()->setMargins( margins );
415 mProfile->invalidateCache();
417 mProfile->endCommand();
420 mSpinTopMargin->setClearValue( 0 );
421 connect( mSpinTopMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
422 if ( !mProfile || mBlockChanges )
426 QgsMargins margins = mProfile->plot()->margins();
428 mProfile->plot()->setMargins( margins );
429 mProfile->invalidateCache();
431 mProfile->endCommand();
434 mSpinBottomMargin->setClearValue( 0 );
435 connect( mSpinBottomMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
436 if ( !mProfile || mBlockChanges )
440 QgsMargins margins = mProfile->plot()->margins();
442 mProfile->plot()->setMargins( margins );
443 mProfile->invalidateCache();
445 mProfile->endCommand();
471 mDistanceUnitCombo->addItem( title, QVariant::fromValue( unit ) );
474 connect( mDistanceUnitCombo, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [
this](
int ) {
475 if ( !mProfile || mBlockChanges )
478 mProfile->beginCommand( tr(
"Change Profile Chart Units" ) );
479 mProfile->setDistanceUnit( mDistanceUnitCombo->currentData().value<
Qgis::DistanceUnit>() );
480 mProfile->invalidateCache();
482 mProfile->endCommand();
490 connect( mDistanceLabelsCombo, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [
this](
int ) {
491 if ( !mProfile || mBlockChanges )
494 mProfile->beginCommand( tr(
"Change Profile Chart Label Placement" ) );
496 mProfile->invalidateCache();
498 mProfile->endCommand();
520 QVBoxLayout *vl =
new QVBoxLayout();
521 vl->setContentsMargins( 0, 0, 0, 0 );
522 vl->addWidget( mLayerTreeView );
523 mTreeViewContainer->setLayout( vl );
526 mLayerTreeView->populateInitialSources( mProfile->layout() && mProfile->layout()->project() ? mProfile->layout()->project() :
QgsProject::instance() );
529 setGuiElementValues();
531 mSubsectionsSymbolButton->registerExpressionContextGenerator( mProfile );
532 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
533 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
534 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
535 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
536 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
537 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
538 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
539 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
542 mDistanceAxisMajorLinesSymbolButton->setLayer(
coverageLayer() );
543 mDistanceAxisMinorLinesSymbolButton->setLayer(
coverageLayer() );
544 mElevationAxisMajorLinesSymbolButton->setLayer(
coverageLayer() );
545 mElevationAxisMinorLinesSymbolButton->setLayer(
coverageLayer() );
551 if ( mProfile->layout() )
554 mSubsectionsSymbolButton->setLayer( layer );
555 mDistanceAxisMajorLinesSymbolButton->setLayer( layer );
556 mDistanceAxisMinorLinesSymbolButton->setLayer( layer );
557 mElevationAxisMajorLinesSymbolButton->setLayer( layer );
558 mElevationAxisMinorLinesSymbolButton->setLayer( layer );
559 mDistanceAxisLabelFontButton->setLayer( layer );
560 mElevationAxisLabelFontButton->setLayer( layer );
561 mChartBackgroundSymbolButton->setLayer( layer );
562 mChartBorderSymbolButton->setLayer( layer );
571 layoutAtlasToggled( atlas->enabled() );
579 if ( mItemPropertiesWidget )
580 mItemPropertiesWidget->setMasterLayout( masterLayout );
587 auto plotScope = std::make_unique<QgsExpressionContextScope>( u
"plot"_s );
603 mCheckControlledByAtlas->setText( tr(
"Controlled by %1" ).arg(
string == tr(
"atlas" ) ? tr(
"Atlas" ) : tr(
"Report" ) ) );
610 mProfile->setCrs( canvas->
crs() );
612 mSpinTolerance->setValue( canvas->
tolerance() );
613 mProfile->setTolerance( canvas->
tolerance() );
616 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( canvas->
distanceUnit() ) ) );
619 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( canvas->
plot().
xAxis().
labelSuffixPlacement() ) ) );
622 mProfile->setProfileCurve( curve->clone() );
624 mSpinMinDistance->setValue( canvas->
plot().
xMinimum() );
625 mSpinMinDistance->setClearValue( canvas->
plot().
xMinimum() );
626 mProfile->plot()->setXMinimum( canvas->
plot().
xMinimum() );
628 mSpinMaxDistance->setValue( canvas->
plot().
xMaximum() );
629 mSpinMaxDistance->setClearValue( canvas->
plot().
xMaximum() );
630 mProfile->plot()->setXMaximum( canvas->
plot().
xMaximum() );
644 mSpinMinElevation->setValue( canvas->
plot().
yMinimum() );
645 mSpinMinElevation->setClearValue( canvas->
plot().
yMinimum() );
646 mProfile->plot()->setYMinimum( canvas->
plot().
yMinimum() );
648 mSpinMaxElevation->setValue( canvas->
plot().
yMaximum() );
649 mSpinMaxElevation->setClearValue( canvas->
plot().
yMaximum() );
650 mProfile->plot()->setYMaximum( canvas->
plot().
yMaximum() );
665 const bool subSectionsEnabled =
static_cast< bool >( subSectionsSymbol );
666 mSubsectionsActivateCheck->setChecked( subSectionsEnabled );
667 if ( subSectionsSymbol )
669 mSubsectionsSymbolButton->setSymbol( subSectionsSymbol->
clone() );
670 mProfile->setSubsectionsSymbol( subSectionsSymbol->
clone() );
673 QList<QgsMapLayer *> canvasLayers = canvas->
layers();
674 mProfile->setLayers( canvasLayers );
676 QList<QgsAbstractProfileSource *> canvasSources = canvas->
sources();
677 mProfile->setSources( canvasSources );
679 syncLayerTreeAndProfileItemSources();
681 mProfile->invalidateCache();
686void QgsLayoutElevationProfileWidget::syncLayerTreeAndProfileItemSources()
689 const QList<QgsLayerTreeNode *> nodes = mLayerTree->findLayersAndCustomNodes();
710 node->setItemVisibilityChecked(
false );
714 node->setItemVisibilityChecked( mProfile->sources().contains( source ) );
719 QList< QgsLayerTreeNode * > orderedNodes;
720 const QList<QgsAbstractProfileSource *> profileSources = mProfile->sources();
721 for (
const QgsAbstractProfileSource *source : profileSources )
723 if ( QgsLayerTreeLayer *layerNode = mLayerTree->findLayer( source->
profileSourceId() ) )
725 orderedNodes << layerNode;
727 else if ( QgsLayerTreeCustomNode *customNode = mLayerTree->findCustomNode( source->
profileSourceId() ) )
729 orderedNodes << customNode;
732 mLayerTree->reorderGroupLayersAndCustomNodes( orderedNodes );
745 mProfile = qobject_cast<QgsLayoutItemElevationProfile *>( item );
746 mItemPropertiesWidget->setItem( mProfile );
751 mSubsectionsSymbolButton->registerExpressionContextGenerator( mProfile );
752 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
753 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
754 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
755 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
756 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
757 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
758 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
759 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
762 setGuiElementValues();
767void QgsLayoutElevationProfileWidget::setGuiElementValues()
771 mSpinTolerance->setValue( mProfile->tolerance() );
772 mCheckControlledByAtlas->setChecked( mProfile->atlasDriven() );
774 mSpinMinDistance->setValue( mProfile->plot()->xMinimum() );
775 mSpinMaxDistance->setValue( mProfile->plot()->xMaximum() );
776 mSpinMinElevation->setValue( mProfile->plot()->yMinimum() );
777 mSpinMaxElevation->setValue( mProfile->plot()->yMaximum() );
779 mSubsectionsActivateCheck->setChecked( mProfile->subsectionsSymbol() );
780 if ( mProfile->subsectionsSymbol() )
782 mSubsectionsSymbolButton->setSymbol( mProfile->subsectionsSymbol()->clone() );
785 if ( mProfile->plot()->xAxis().gridMajorSymbol() )
786 mDistanceAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMajorSymbol()->clone() );
787 if ( mProfile->plot()->xAxis().gridMinorSymbol() )
788 mDistanceAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMinorSymbol()->clone() );
789 if ( mProfile->plot()->yAxis().gridMajorSymbol() )
790 mElevationAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMajorSymbol()->clone() );
791 if ( mProfile->plot()->yAxis().gridMinorSymbol() )
792 mElevationAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMinorSymbol()->clone() );
794 mDistanceAxisLabelFontButton->setTextFormat( mProfile->plot()->xAxis().textFormat() );
795 mElevationAxisLabelFontButton->setTextFormat( mProfile->plot()->yAxis().textFormat() );
797 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( mProfile->distanceUnit() ) ) );
798 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( mProfile->plot()->xAxis().labelSuffixPlacement() ) ) );
800 mDistanceAxisMajorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMajor() );
801 mDistanceAxisMinorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMinor() );
802 mDistanceAxisLabelIntervalSpin->setValue( mProfile->plot()->xAxis().labelInterval() );
804 mElevationAxisMajorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMajor() );
805 mElevationAxisMinorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMinor() );
806 mElevationAxisLabelIntervalSpin->setValue( mProfile->plot()->yAxis().labelInterval() );
808 if ( mProfile->plot()->chartBackgroundSymbol() )
809 mChartBackgroundSymbolButton->setSymbol( mProfile->plot()->chartBackgroundSymbol()->clone() );
810 if ( mProfile->plot()->chartBorderSymbol() )
811 mChartBorderSymbolButton->setSymbol( mProfile->plot()->chartBorderSymbol()->clone() );
813 mSpinLeftMargin->setValue( mProfile->plot()->margins().left() );
814 mSpinRightMargin->setValue( mProfile->plot()->margins().right() );
815 mSpinTopMargin->setValue( mProfile->plot()->margins().top() );
816 mSpinBottomMargin->setValue( mProfile->plot()->margins().bottom() );
818 syncLayerTreeAndProfileItemSources();
839void QgsLayoutElevationProfileWidget::updateItemSources()
844 QList<QgsMapLayer *> layers;
845 QList<QgsAbstractProfileSource *> sources;
846 const QList<QgsLayerTreeNode *> layerAndCustomNodeOrder = mLayerTree->layerAndCustomNodeOrder();
847 for ( QgsLayerTreeNode *node : layerAndCustomNodeOrder )
852 if ( mLayerTree->findLayer( layer )->isVisible() )
855 sources << layer->profileSource();
861 if ( mLayerTree->findCustomNode( customNode->
nodeId() )->isVisible() )
865 sources << customSource;
872 std::reverse( layers.begin(), layers.end() );
873 mProfile->setLayers( layers );
875 mProfile->setSources( sources );
879void QgsLayoutElevationProfileWidget::layoutAtlasToggled(
bool atlasEnabled )
881 if ( atlasEnabled && mProfile && mProfile->layout() && mProfile->layout()->reportContext().layer()
884 mCheckControlledByAtlas->setEnabled(
true );
888 mCheckControlledByAtlas->setEnabled(
false );
889 mCheckControlledByAtlas->setChecked(
false );
893void QgsLayoutElevationProfileWidget::atlasLayerChanged(
QgsVectorLayer *layer )
898 mCheckControlledByAtlas->setChecked(
false );
899 mCheckControlledByAtlas->setEnabled(
false );
904 mCheckControlledByAtlas->setEnabled(
true );
PlotAxisSuffixPlacement
Placement options for suffixes in the labels for axis of plots.
@ FirstAndLastLabels
Place suffix after the first and last label values only.
@ EveryLabel
Place suffix after every value label.
@ FirstLabel
Place suffix after the first label value only.
@ LastLabel
Place suffix after the last label value only.
@ NoLabels
Do not place suffixes.
DistanceUnit
Units of distance.
@ Centimeters
Centimeters.
@ Millimeters
Millimeters.
@ Miles
Terrestrial miles.
@ Degrees
Degrees, for planar geographic CRS distance measurements.
@ NauticalMiles
Nautical miles.
@ TitleCase
Simple title case conversion - does not fully grammatically parse the text and uses simple rules only...
double yMaximum() const
Returns the maximum value of the y axis.
double xMinimum() const
Returns the minimum value of the x axis.
QgsPlotAxis & yAxis()
Returns a reference to the plot's y axis.
QgsPlotAxis & xAxis()
Returns a reference to the plot's x axis.
double yMinimum() const
Returns the minimum value of the y axis.
double xMaximum() const
Returns the maximum value of the x axis.
Interface for classes which can generate elevation profiles.
virtual QString profileSourceId() const
Returns a unique identifier for this profile source.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QgsProfileSourceRegistry * profileSourceRegistry()
Returns registry of available profile source implementations.
Abstract base class for curved geometry type.
A canvas for elevation profiles.
QgsCurve * profileCurve() const
Returns the profile curve.
QgsCoordinateReferenceSystem crs() const override
Returns the coordinate reference system (CRS) for map coordinates used by the canvas.
const Qgs2DXyPlot & plot() const
Returns a reference to the 2D plot used by the widget.
QList< QgsMapLayer * > layers() const
Returns the list of layers included in the profile.
Qgis::DistanceUnit distanceUnit() const
Returns the distance unit used by the canvas.
double tolerance() const
Returns the tolerance of the profile (in crs() units).
QList< QgsAbstractProfileSource * > sources() const
Returns the list of sources included in the profile.
QgsLineSymbol * subsectionsSymbol()
Returns the symbol used to draw the subsections.
A layer tree view for elevation profiles.
static const QString CUSTOM_NODE_ELEVATION_PROFILE_SOURCE
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
@ HigDialogTitleIsTitleCase
Dialog titles should be title case.
static QgsGui::HigFlags higFlags()
Returns the platform's HIG flags.
QString nodeId() const
Returns the node's unique identifier.
Layer tree node points to a map layer.
QgsMapLayer * layer() const
Returns the map layer associated with this node.
Base class for nodes in a layer tree.
void visibilityChanged(QgsLayerTreeNode *node)
Emitted when check state of a node within the tree has been changed.
Listens to layer changes from a QgsProject and applies changes to a QgsLayerTree.
Namespace with helper functions for layer tree operations.
static QgsLayerTreeLayer * toLayer(QgsLayerTreeNode *node)
Cast node to a layer.
static bool isLayer(const QgsLayerTreeNode *node)
Check whether the node is a valid layer node.
void layerOrderChanged()
Emitted when the layer order has changed.
static bool isCustomNode(const QgsLayerTreeNode *node)
Check whether the node is a valid custom node.
static QgsLayerTreeCustomNode * toCustomNode(QgsLayerTreeNode *node)
Cast node to a custom node.
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
void toggled(bool enabled)
Emitted when atlas is enabled or disabled.
A common interface for layout designer dialogs and widgets.
A layout item subclass for elevation profile plots.
@ LayoutElevationProfile
Elevation profile item.
Base class for graphical items within a QgsLayout.
@ UndoElevationProfileElevationMajorGridlines
Change elevation profile elevation axis major gridlines.
@ UndoElevationProfileMaximumDistance
Change elevation profile maximum distance.
@ UndoElevationProfileChartBackground
Change elevation profile chart background.
@ UndoElevationProfileDistanceMinorGridlines
Change elevation profile distance axis minor gridlines.
@ UndoMarginTop
Top margin.
@ UndoElevationProfileChartBorder
Change elevation profile chart border.
@ UndoElevationProfileMaximumElevation
Change elevation profile maximum elevation.
@ UndoMarginLeft
Left margin.
@ UndoMarginRight
Right margin.
@ UndoElevationProfileTolerance
Change elevation profile distance tolerance.
@ UndoElevationProfileElevationFormat
Change elevation profile elevation axis number format.
@ UndoElevationProfileMinimumElevation
Change elevation profile minimum elevation.
@ UndoElevationProfileDistanceLabels
Change elevation profile distance axis label interval.
@ UndoMarginBottom
Bottom margin.
@ UndoElevationProfileElevationFont
Change elevation profile elevation axis number font.
@ UndoElevationProfileDistanceFormat
Change elevation profile distance axis number format.
@ UndoElevationProfileElevationMinorGridlines
Change elevation profile elevation axis minor gridlines.
@ UndoElevationProfileDistanceFont
Change elevation profile distance axis number font.
@ UndoElevationProfileElevationLabels
Change elevation profile elevation axis label interval.
@ UndoElevationProfileDistanceMajorGridlines
Change elevation profile distance axis major gridlines.
@ UndoElevationProfileMinimumDistance
Change elevation profile minimum distance.
@ UndoElevationProfileSubsectionLines
Change elevation profile subsection indicator symbol.
int type() const override
Returns a unique graphics item type identifier.
void changed()
Emitted when the object's properties change.
@ ElevationProfileMaximumDistance
Maximum distance value for elevation profile.
@ MarginBottom
Bottom margin.
@ ElevationProfileElevationMinorInterval
Minor grid line interval for elevation profile elevation axis.
@ ElevationProfileDistanceMinorInterval
Minor grid line interval for elevation profile distance axis.
@ ElevationProfileMinimumDistance
Minimum distance value for elevation profile.
@ ElevationProfileMaximumElevation
Maximum elevation value for elevation profile.
@ ElevationProfileDistanceLabelInterval
Label interval for elevation profile distance axis.
@ ElevationProfileTolerance
Tolerance distance for elevation profiles.
@ ElevationProfileMinimumElevation
Minimum elevation value for elevation profile.
@ MarginRight
Right margin.
@ ElevationProfileElevationLabelInterval
Label interval for elevation profile elevation axis.
@ ElevationProfileDistanceMajorInterval
Major grid line interval for elevation profile distance axis.
@ ElevationProfileElevationMajorInterval
Major grid line interval for elevation profile elevation axis.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
A line symbol type, for rendering LineString and MultiLineString geometries.
QgsLineSymbol * clone() const override
Returns a deep copy of this symbol.
Base class for all map layer types.
virtual QgsAbstractProfileSource * profileSource()
Returns the layer's profile source if it has profile capabilities.
Defines the four margins of a rectangle.
void setBottom(double bottom)
Sets the bottom margin to bottom.
void setLeft(double left)
Sets the left margin to left.
void setRight(double right)
Sets the right margin to right.
void setTop(double top)
Sets the top margin to top.
Interface for master layout type objects, such as print layouts and reports.
double gridIntervalMinor() const
Returns the interval of minor grid lines for the axis.
double gridIntervalMajor() const
Returns the interval of major grid lines for the axis.
double labelInterval() const
Returns the interval of labels for the axis.
Qgis::PlotAxisSuffixPlacement labelSuffixPlacement() const
Returns the placement for the axis label suffixes.
static QgsFillSymbol * chartBorderSymbol()
Returns the default fill symbol to use for the chart area border.
static QgsLineSymbol * axisGridMinorSymbol()
Returns the default line symbol to use for axis minor grid lines.
static QgsFillSymbol * chartBackgroundSymbol()
Returns the default fill symbol to use for the chart area background fill.
static QgsLineSymbol * axisGridMajorSymbol()
Returns the default line symbol to use for axis major grid lines.
static std::unique_ptr< QgsLineSymbol > defaultSubSectionsSymbol()
Returns the default line symbol to use for subsections lines.
QgsAbstractProfileSource * findSourceById(const QString &sourceId) const
Finds a registered profile source by id.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
static QgsProject * instance()
Returns the QgsProject singleton instance.
static QString capitalize(const QString &string, Qgis::Capitalization capitalization)
Converts a string by applying capitalization rules to the string.
static Q_INVOKABLE QString toString(Qgis::DistanceUnit unit)
Returns a translated string representing a distance unit.
Represents a vector layer which manages a vector based dataset.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.
Single variable definition for use within a QgsExpressionContextScope.