43#include "moc_qgslayoutelevationprofilewidget.cpp"
45using namespace Qt::StringLiterals;
60 mCopyFromDockMenu =
new QMenu(
this );
61 connect( mCopyFromDockMenu, &QMenu::aboutToShow,
this, [
this] {
sBuildCopyMenuFunction(
this, mCopyFromDockMenu ); } );
63 connect( mActionRefresh, &QAction::triggered,
this, [
this] {
68 mProfile->invalidateCache();
72 QToolButton *copyFromDockButton =
new QToolButton();
73 copyFromDockButton->setAutoRaise(
true );
74 copyFromDockButton->setToolTip( tr(
"Copy From Profile" ) );
75 copyFromDockButton->setMenu( mCopyFromDockMenu );
76 copyFromDockButton->setPopupMode( QToolButton::InstantPopup );
79 mDockToolbar->addWidget( copyFromDockButton );
83 mainLayout->addWidget( mItemPropertiesWidget );
88 mSpinTolerance->setClearValue( 0 );
89 connect( mSpinTolerance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
90 if ( !mProfile || mBlockChanges )
94 mProfile->setTolerance( value );
95 mProfile->invalidateCache();
97 mProfile->endCommand();
100 connect( mCheckControlledByAtlas, &QCheckBox::toggled,
this, [
this] {
101 if ( !mProfile || mBlockChanges )
104 mProfile->beginCommand( tr(
"Change Profile Atlas Control" ) );
105 mProfile->setAtlasDriven( mCheckControlledByAtlas->isChecked() );
106 mProfile->invalidateCache();
108 mProfile->endCommand();
114 if ( !mProfile || mBlockChanges )
118 mProfile->setSubsectionsSymbol( mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() );
119 mProfile->invalidateCache();
121 mProfile->endCommand();
125 connect( mSubsectionsActivateCheck, &QGroupBox::toggled,
this, [
this] {
126 if ( !mProfile || mBlockChanges )
129 const bool subsectionsActivated = mSubsectionsActivateCheck->isChecked();
131 std::unique_ptr<QgsLineSymbol> subSectionsSymbol( subsectionsActivated ? mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() :
nullptr );
132 mProfile->setSubsectionsSymbol( subSectionsSymbol.release() );
134 mProfile->invalidateCache();
136 mProfile->endCommand();
139 mSpinMinDistance->setClearValue( 0 );
140 connect( mSpinMinDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
141 if ( !mProfile || mBlockChanges )
145 mProfile->plot()->setXMinimum( value );
146 mProfile->invalidateCache();
148 mProfile->endCommand();
151 connect( mSpinMaxDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
152 if ( !mProfile || mBlockChanges )
156 mProfile->plot()->setXMaximum( value );
157 mProfile->invalidateCache();
159 mProfile->endCommand();
162 mSpinMinElevation->setClearValue( 0 );
163 connect( mSpinMinElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
164 if ( !mProfile || mBlockChanges )
168 mProfile->plot()->setYMinimum( value );
169 mProfile->invalidateCache();
171 mProfile->endCommand();
174 connect( mSpinMaxElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
175 if ( !mProfile || mBlockChanges )
179 mProfile->plot()->setYMaximum( value );
180 mProfile->invalidateCache();
182 mProfile->endCommand();
187 if ( !mProfile || mBlockChanges )
191 mProfile->plot()->xAxis().setGridMajorSymbol( mDistanceAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
192 mProfile->invalidateCache();
194 mProfile->endCommand();
200 if ( !mProfile || mBlockChanges )
204 mProfile->plot()->xAxis().setGridMinorSymbol( mDistanceAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
205 mProfile->invalidateCache();
207 mProfile->endCommand();
211 connect( mDistanceAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
212 if ( !mProfile || mBlockChanges )
216 mProfile->plot()->xAxis().setGridIntervalMajor( value );
217 mProfile->invalidateCache();
219 mProfile->endCommand();
222 connect( mDistanceAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
223 if ( !mProfile || mBlockChanges )
227 mProfile->plot()->xAxis().setGridIntervalMinor( value );
228 mProfile->invalidateCache();
230 mProfile->endCommand();
233 connect( mDistanceAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
234 if ( !mProfile || mBlockChanges )
238 mProfile->plot()->xAxis().setLabelInterval( value );
239 mProfile->invalidateCache();
241 mProfile->endCommand();
246 if ( !mProfile || mBlockChanges )
250 mProfile->plot()->yAxis().setGridMajorSymbol( mElevationAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
251 mProfile->invalidateCache();
253 mProfile->endCommand();
259 if ( !mProfile || mBlockChanges )
263 mProfile->plot()->yAxis().setGridMinorSymbol( mElevationAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
264 mProfile->invalidateCache();
266 mProfile->endCommand();
270 connect( mElevationAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
271 if ( !mProfile || mBlockChanges )
275 mProfile->plot()->yAxis().setLabelInterval( value );
276 mProfile->invalidateCache();
278 mProfile->endCommand();
281 connect( mElevationAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
282 if ( !mProfile || mBlockChanges )
286 mProfile->plot()->yAxis().setGridIntervalMajor( value );
287 mProfile->invalidateCache();
289 mProfile->endCommand();
292 connect( mElevationAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
293 if ( !mProfile || mBlockChanges )
297 mProfile->plot()->yAxis().setGridIntervalMinor( value );
298 mProfile->invalidateCache();
300 mProfile->endCommand();
305 if ( !mProfile || mBlockChanges )
309 mProfile->plot()->setChartBackgroundSymbol( mChartBackgroundSymbolButton->clonedSymbol<
QgsFillSymbol>() );
310 mProfile->invalidateCache();
312 mProfile->endCommand();
318 if ( !mProfile || mBlockChanges )
322 mProfile->plot()->setChartBorderSymbol( mChartBorderSymbolButton->clonedSymbol<
QgsFillSymbol>() );
323 mProfile->invalidateCache();
325 mProfile->endCommand();
329 connect( mDistanceAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
330 if ( !mProfile || mBlockChanges )
335 widget->
setFormat( mProfile->plot()->xAxis().numericFormat() );
338 mProfile->plot()->xAxis().setNumericFormat( widget->
format() );
339 mProfile->invalidateCache();
340 mProfile->endCommand();
346 connect( mElevationAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
347 if ( !mProfile || mBlockChanges )
352 widget->
setFormat( mProfile->plot()->yAxis().numericFormat() );
355 mProfile->plot()->yAxis().setNumericFormat( widget->
format() );
356 mProfile->invalidateCache();
357 mProfile->endCommand();
363 mDistanceAxisLabelFontButton->setDialogTitle( tr(
"Distance Label Font" ) );
364 mElevationAxisLabelFontButton->setDialogTitle( tr(
"Elevation Label Font" ) );
369 if ( !mProfile || mBlockChanges )
373 mProfile->plot()->xAxis().setTextFormat( mDistanceAxisLabelFontButton->textFormat() );
374 mProfile->invalidateCache();
375 mProfile->endCommand();
380 if ( !mProfile || mBlockChanges )
384 mProfile->plot()->yAxis().setTextFormat( mElevationAxisLabelFontButton->textFormat() );
385 mProfile->invalidateCache();
386 mProfile->endCommand();
390 mSpinLeftMargin->setClearValue( 0 );
391 connect( mSpinLeftMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
392 if ( !mProfile || mBlockChanges )
396 QgsMargins margins = mProfile->plot()->margins();
398 mProfile->plot()->setMargins( margins );
399 mProfile->invalidateCache();
401 mProfile->endCommand();
404 mSpinRightMargin->setClearValue( 0 );
405 connect( mSpinRightMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
406 if ( !mProfile || mBlockChanges )
410 QgsMargins margins = mProfile->plot()->margins();
412 mProfile->plot()->setMargins( margins );
413 mProfile->invalidateCache();
415 mProfile->endCommand();
418 mSpinTopMargin->setClearValue( 0 );
419 connect( mSpinTopMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
420 if ( !mProfile || mBlockChanges )
424 QgsMargins margins = mProfile->plot()->margins();
426 mProfile->plot()->setMargins( margins );
427 mProfile->invalidateCache();
429 mProfile->endCommand();
432 mSpinBottomMargin->setClearValue( 0 );
433 connect( mSpinBottomMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
434 if ( !mProfile || mBlockChanges )
438 QgsMargins margins = mProfile->plot()->margins();
440 mProfile->plot()->setMargins( margins );
441 mProfile->invalidateCache();
443 mProfile->endCommand();
468 mDistanceUnitCombo->addItem( title, QVariant::fromValue( unit ) );
471 connect( mDistanceUnitCombo, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [
this](
int ) {
472 if ( !mProfile || mBlockChanges )
475 mProfile->beginCommand( tr(
"Change Profile Chart Units" ) );
476 mProfile->setDistanceUnit( mDistanceUnitCombo->currentData().value<
Qgis::DistanceUnit>() );
477 mProfile->invalidateCache();
479 mProfile->endCommand();
487 connect( mDistanceLabelsCombo, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [
this](
int ) {
488 if ( !mProfile || mBlockChanges )
491 mProfile->beginCommand( tr(
"Change Profile Chart Label Placement" ) );
493 mProfile->invalidateCache();
495 mProfile->endCommand();
517 QVBoxLayout *vl =
new QVBoxLayout();
518 vl->setContentsMargins( 0, 0, 0, 0 );
519 vl->addWidget( mLayerTreeView );
520 mTreeViewContainer->setLayout( vl );
523 mLayerTreeView->populateInitialSources( mProfile->layout() && mProfile->layout()->project() ? mProfile->layout()->project() :
QgsProject::instance() );
526 setGuiElementValues();
528 mSubsectionsSymbolButton->registerExpressionContextGenerator( mProfile );
529 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
530 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
531 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
532 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
533 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
534 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
535 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
536 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
539 mDistanceAxisMajorLinesSymbolButton->setLayer(
coverageLayer() );
540 mDistanceAxisMinorLinesSymbolButton->setLayer(
coverageLayer() );
541 mElevationAxisMajorLinesSymbolButton->setLayer(
coverageLayer() );
542 mElevationAxisMinorLinesSymbolButton->setLayer(
coverageLayer() );
548 if ( mProfile->layout() )
551 mSubsectionsSymbolButton->setLayer( layer );
552 mDistanceAxisMajorLinesSymbolButton->setLayer( layer );
553 mDistanceAxisMinorLinesSymbolButton->setLayer( layer );
554 mElevationAxisMajorLinesSymbolButton->setLayer( layer );
555 mElevationAxisMinorLinesSymbolButton->setLayer( layer );
556 mDistanceAxisLabelFontButton->setLayer( layer );
557 mElevationAxisLabelFontButton->setLayer( layer );
558 mChartBackgroundSymbolButton->setLayer( layer );
559 mChartBorderSymbolButton->setLayer( layer );
568 layoutAtlasToggled( atlas->enabled() );
576 if ( mItemPropertiesWidget )
577 mItemPropertiesWidget->setMasterLayout( masterLayout );
584 auto plotScope = std::make_unique<QgsExpressionContextScope>( u
"plot"_s );
600 mCheckControlledByAtlas->setText( tr(
"Controlled by %1" ).arg(
string == tr(
"atlas" ) ? tr(
"Atlas" ) : tr(
"Report" ) ) );
607 mProfile->setCrs( canvas->
crs() );
609 mSpinTolerance->setValue( canvas->
tolerance() );
610 mProfile->setTolerance( canvas->
tolerance() );
613 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( canvas->
distanceUnit() ) ) );
616 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( canvas->
plot().
xAxis().
labelSuffixPlacement() ) ) );
619 mProfile->setProfileCurve( curve->clone() );
621 mSpinMinDistance->setValue( canvas->
plot().
xMinimum() );
622 mSpinMinDistance->setClearValue( canvas->
plot().
xMinimum() );
623 mProfile->plot()->setXMinimum( canvas->
plot().
xMinimum() );
625 mSpinMaxDistance->setValue( canvas->
plot().
xMaximum() );
626 mSpinMaxDistance->setClearValue( canvas->
plot().
xMaximum() );
627 mProfile->plot()->setXMaximum( canvas->
plot().
xMaximum() );
641 mSpinMinElevation->setValue( canvas->
plot().
yMinimum() );
642 mSpinMinElevation->setClearValue( canvas->
plot().
yMinimum() );
643 mProfile->plot()->setYMinimum( canvas->
plot().
yMinimum() );
645 mSpinMaxElevation->setValue( canvas->
plot().
yMaximum() );
646 mSpinMaxElevation->setClearValue( canvas->
plot().
yMaximum() );
647 mProfile->plot()->setYMaximum( canvas->
plot().
yMaximum() );
662 const bool subSectionsEnabled =
static_cast< bool >( subSectionsSymbol );
663 mSubsectionsActivateCheck->setChecked( subSectionsEnabled );
664 if ( subSectionsSymbol )
666 mSubsectionsSymbolButton->setSymbol( subSectionsSymbol->
clone() );
667 mProfile->setSubsectionsSymbol( subSectionsSymbol->
clone() );
670 QList<QgsMapLayer *> canvasLayers = canvas->
layers();
671 mProfile->setLayers( canvasLayers );
673 QList<QgsAbstractProfileSource *> canvasSources = canvas->
sources();
674 mProfile->setSources( canvasSources );
676 syncLayerTreeAndProfileItemSources();
678 mProfile->invalidateCache();
683void QgsLayoutElevationProfileWidget::syncLayerTreeAndProfileItemSources()
686 const QList<QgsLayerTreeNode *> nodes = mLayerTree->findLayersAndCustomNodes();
707 node->setItemVisibilityChecked(
false );
711 node->setItemVisibilityChecked( mProfile->sources().contains( source ) );
716 QList< QgsLayerTreeNode * > orderedNodes;
717 const QList<QgsAbstractProfileSource *> profileSources = mProfile->sources();
718 for (
const QgsAbstractProfileSource *source : profileSources )
720 if ( QgsLayerTreeLayer *layerNode = mLayerTree->findLayer( source->
profileSourceId() ) )
722 orderedNodes << layerNode;
724 else if ( QgsLayerTreeCustomNode *customNode = mLayerTree->findCustomNode( source->
profileSourceId() ) )
726 orderedNodes << customNode;
729 mLayerTree->reorderGroupLayersAndCustomNodes( orderedNodes );
742 mProfile = qobject_cast<QgsLayoutItemElevationProfile *>( item );
743 mItemPropertiesWidget->setItem( mProfile );
748 mSubsectionsSymbolButton->registerExpressionContextGenerator( mProfile );
749 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
750 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
751 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
752 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
753 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
754 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
755 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
756 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
759 setGuiElementValues();
764void QgsLayoutElevationProfileWidget::setGuiElementValues()
768 mSpinTolerance->setValue( mProfile->tolerance() );
769 mCheckControlledByAtlas->setChecked( mProfile->atlasDriven() );
771 mSpinMinDistance->setValue( mProfile->plot()->xMinimum() );
772 mSpinMaxDistance->setValue( mProfile->plot()->xMaximum() );
773 mSpinMinElevation->setValue( mProfile->plot()->yMinimum() );
774 mSpinMaxElevation->setValue( mProfile->plot()->yMaximum() );
776 mSubsectionsActivateCheck->setChecked( mProfile->subsectionsSymbol() );
777 if ( mProfile->subsectionsSymbol() )
779 mSubsectionsSymbolButton->setSymbol( mProfile->subsectionsSymbol()->clone() );
782 if ( mProfile->plot()->xAxis().gridMajorSymbol() )
783 mDistanceAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMajorSymbol()->clone() );
784 if ( mProfile->plot()->xAxis().gridMinorSymbol() )
785 mDistanceAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMinorSymbol()->clone() );
786 if ( mProfile->plot()->yAxis().gridMajorSymbol() )
787 mElevationAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMajorSymbol()->clone() );
788 if ( mProfile->plot()->yAxis().gridMinorSymbol() )
789 mElevationAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMinorSymbol()->clone() );
791 mDistanceAxisLabelFontButton->setTextFormat( mProfile->plot()->xAxis().textFormat() );
792 mElevationAxisLabelFontButton->setTextFormat( mProfile->plot()->yAxis().textFormat() );
794 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( mProfile->distanceUnit() ) ) );
795 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( mProfile->plot()->xAxis().labelSuffixPlacement() ) ) );
797 mDistanceAxisMajorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMajor() );
798 mDistanceAxisMinorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMinor() );
799 mDistanceAxisLabelIntervalSpin->setValue( mProfile->plot()->xAxis().labelInterval() );
801 mElevationAxisMajorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMajor() );
802 mElevationAxisMinorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMinor() );
803 mElevationAxisLabelIntervalSpin->setValue( mProfile->plot()->yAxis().labelInterval() );
805 if ( mProfile->plot()->chartBackgroundSymbol() )
806 mChartBackgroundSymbolButton->setSymbol( mProfile->plot()->chartBackgroundSymbol()->clone() );
807 if ( mProfile->plot()->chartBorderSymbol() )
808 mChartBorderSymbolButton->setSymbol( mProfile->plot()->chartBorderSymbol()->clone() );
810 mSpinLeftMargin->setValue( mProfile->plot()->margins().left() );
811 mSpinRightMargin->setValue( mProfile->plot()->margins().right() );
812 mSpinTopMargin->setValue( mProfile->plot()->margins().top() );
813 mSpinBottomMargin->setValue( mProfile->plot()->margins().bottom() );
815 syncLayerTreeAndProfileItemSources();
836void QgsLayoutElevationProfileWidget::updateItemSources()
841 QList<QgsMapLayer *> layers;
842 QList<QgsAbstractProfileSource *> sources;
843 const QList<QgsLayerTreeNode *> layerAndCustomNodeOrder = mLayerTree->layerAndCustomNodeOrder();
844 for ( QgsLayerTreeNode *node : layerAndCustomNodeOrder )
849 if ( mLayerTree->findLayer( layer )->isVisible() )
852 sources << layer->profileSource();
858 if ( mLayerTree->findCustomNode( customNode->
nodeId() )->isVisible() )
862 sources << customSource;
869 std::reverse( layers.begin(), layers.end() );
870 mProfile->setLayers( layers );
872 mProfile->setSources( sources );
876void QgsLayoutElevationProfileWidget::layoutAtlasToggled(
bool atlasEnabled )
878 if ( atlasEnabled && mProfile && mProfile->layout() && mProfile->layout()->reportContext().layer() && mProfile->layout()->reportContext().layer()->geometryType() ==
Qgis::GeometryType::Line )
880 mCheckControlledByAtlas->setEnabled(
true );
884 mCheckControlledByAtlas->setEnabled(
false );
885 mCheckControlledByAtlas->setChecked(
false );
889void QgsLayoutElevationProfileWidget::atlasLayerChanged(
QgsVectorLayer *layer )
894 mCheckControlledByAtlas->setChecked(
false );
895 mCheckControlledByAtlas->setEnabled(
false );
900 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.