42#include "moc_qgslayoutelevationprofilewidget.cpp"
57 mCopyFromDockMenu =
new QMenu(
this );
58 connect( mCopyFromDockMenu, &QMenu::aboutToShow,
this, [
this] {
62 connect( mActionRefresh, &QAction::triggered,
this, [
this] {
67 mProfile->invalidateCache();
71 QToolButton *copyFromDockButton =
new QToolButton();
72 copyFromDockButton->setAutoRaise(
true );
73 copyFromDockButton->setToolTip( tr(
"Copy From Profile" ) );
74 copyFromDockButton->setMenu( mCopyFromDockMenu );
75 copyFromDockButton->setPopupMode( QToolButton::InstantPopup );
78 mDockToolbar->addWidget( copyFromDockButton );
82 mainLayout->addWidget( mItemPropertiesWidget );
87 mSpinTolerance->setClearValue( 0 );
88 connect( mSpinTolerance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
89 if ( !mProfile || mBlockChanges )
93 mProfile->setTolerance( value );
94 mProfile->invalidateCache();
96 mProfile->endCommand();
99 connect( mCheckControlledByAtlas, &QCheckBox::toggled,
this, [
this] {
100 if ( !mProfile || mBlockChanges )
103 mProfile->beginCommand( tr(
"Change Profile Atlas Control" ) );
104 mProfile->setAtlasDriven( mCheckControlledByAtlas->isChecked() );
105 mProfile->invalidateCache();
107 mProfile->endCommand();
113 if ( !mProfile || mBlockChanges )
117 mProfile->setSubsectionsSymbol( mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() );
118 mProfile->invalidateCache();
120 mProfile->endCommand();
124 connect( mSubsectionsActivateCheck, &QGroupBox::toggled,
this, [
this] {
125 if ( !mProfile || mBlockChanges )
128 const bool subsectionsActivated = mSubsectionsActivateCheck->isChecked();
130 std::unique_ptr<QgsLineSymbol> subSectionsSymbol( subsectionsActivated ? mSubsectionsSymbolButton->clonedSymbol<
QgsLineSymbol>() :
nullptr );
131 mProfile->setSubsectionsSymbol( subSectionsSymbol.release() );
133 mProfile->invalidateCache();
135 mProfile->endCommand();
138 mSpinMinDistance->setClearValue( 0 );
139 connect( mSpinMinDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
140 if ( !mProfile || mBlockChanges )
144 mProfile->plot()->setXMinimum( value );
145 mProfile->invalidateCache();
147 mProfile->endCommand();
150 connect( mSpinMaxDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
151 if ( !mProfile || mBlockChanges )
155 mProfile->plot()->setXMaximum( value );
156 mProfile->invalidateCache();
158 mProfile->endCommand();
161 mSpinMinElevation->setClearValue( 0 );
162 connect( mSpinMinElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
163 if ( !mProfile || mBlockChanges )
167 mProfile->plot()->setYMinimum( value );
168 mProfile->invalidateCache();
170 mProfile->endCommand();
173 connect( mSpinMaxElevation, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
174 if ( !mProfile || mBlockChanges )
178 mProfile->plot()->setYMaximum( value );
179 mProfile->invalidateCache();
181 mProfile->endCommand();
186 if ( !mProfile || mBlockChanges )
190 mProfile->plot()->xAxis().setGridMajorSymbol( mDistanceAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
191 mProfile->invalidateCache();
193 mProfile->endCommand();
199 if ( !mProfile || mBlockChanges )
203 mProfile->plot()->xAxis().setGridMinorSymbol( mDistanceAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
204 mProfile->invalidateCache();
206 mProfile->endCommand();
210 connect( mDistanceAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
211 if ( !mProfile || mBlockChanges )
215 mProfile->plot()->xAxis().setGridIntervalMajor( value );
216 mProfile->invalidateCache();
218 mProfile->endCommand();
221 connect( mDistanceAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
222 if ( !mProfile || mBlockChanges )
226 mProfile->plot()->xAxis().setGridIntervalMinor( value );
227 mProfile->invalidateCache();
229 mProfile->endCommand();
232 connect( mDistanceAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
233 if ( !mProfile || mBlockChanges )
237 mProfile->plot()->xAxis().setLabelInterval( value );
238 mProfile->invalidateCache();
240 mProfile->endCommand();
245 if ( !mProfile || mBlockChanges )
249 mProfile->plot()->yAxis().setGridMajorSymbol( mElevationAxisMajorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
250 mProfile->invalidateCache();
252 mProfile->endCommand();
258 if ( !mProfile || mBlockChanges )
262 mProfile->plot()->yAxis().setGridMinorSymbol( mElevationAxisMinorLinesSymbolButton->clonedSymbol<
QgsLineSymbol>() );
263 mProfile->invalidateCache();
265 mProfile->endCommand();
269 connect( mElevationAxisLabelIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
270 if ( !mProfile || mBlockChanges )
274 mProfile->plot()->yAxis().setLabelInterval( value );
275 mProfile->invalidateCache();
277 mProfile->endCommand();
280 connect( mElevationAxisMajorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
281 if ( !mProfile || mBlockChanges )
285 mProfile->plot()->yAxis().setGridIntervalMajor( value );
286 mProfile->invalidateCache();
288 mProfile->endCommand();
291 connect( mElevationAxisMinorIntervalSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
292 if ( !mProfile || mBlockChanges )
296 mProfile->plot()->yAxis().setGridIntervalMinor( value );
297 mProfile->invalidateCache();
299 mProfile->endCommand();
304 if ( !mProfile || mBlockChanges )
308 mProfile->plot()->setChartBackgroundSymbol( mChartBackgroundSymbolButton->clonedSymbol<
QgsFillSymbol>() );
309 mProfile->invalidateCache();
311 mProfile->endCommand();
317 if ( !mProfile || mBlockChanges )
321 mProfile->plot()->setChartBorderSymbol( mChartBorderSymbolButton->clonedSymbol<
QgsFillSymbol>() );
322 mProfile->invalidateCache();
324 mProfile->endCommand();
328 connect( mDistanceAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
329 if ( !mProfile || mBlockChanges )
334 widget->
setFormat( mProfile->plot()->xAxis().numericFormat() );
337 mProfile->plot()->xAxis().setNumericFormat( widget->
format() );
338 mProfile->invalidateCache();
339 mProfile->endCommand();
345 connect( mElevationAxisLabelFormatButton, &QPushButton::clicked,
this, [
this] {
346 if ( !mProfile || mBlockChanges )
351 widget->
setFormat( mProfile->plot()->yAxis().numericFormat() );
354 mProfile->plot()->yAxis().setNumericFormat( widget->
format() );
355 mProfile->invalidateCache();
356 mProfile->endCommand();
362 mDistanceAxisLabelFontButton->setDialogTitle( tr(
"Distance Label Font" ) );
363 mElevationAxisLabelFontButton->setDialogTitle( tr(
"Elevation Label Font" ) );
368 if ( !mProfile || mBlockChanges )
372 mProfile->plot()->xAxis().setTextFormat( mDistanceAxisLabelFontButton->textFormat() );
373 mProfile->invalidateCache();
374 mProfile->endCommand();
379 if ( !mProfile || mBlockChanges )
383 mProfile->plot()->yAxis().setTextFormat( mElevationAxisLabelFontButton->textFormat() );
384 mProfile->invalidateCache();
385 mProfile->endCommand();
389 mSpinLeftMargin->setClearValue( 0 );
390 connect( mSpinLeftMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
391 if ( !mProfile || mBlockChanges )
395 QgsMargins margins = mProfile->plot()->margins();
397 mProfile->plot()->setMargins( margins );
398 mProfile->invalidateCache();
400 mProfile->endCommand();
403 mSpinRightMargin->setClearValue( 0 );
404 connect( mSpinRightMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
405 if ( !mProfile || mBlockChanges )
409 QgsMargins margins = mProfile->plot()->margins();
411 mProfile->plot()->setMargins( margins );
412 mProfile->invalidateCache();
414 mProfile->endCommand();
417 mSpinTopMargin->setClearValue( 0 );
418 connect( mSpinTopMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
419 if ( !mProfile || mBlockChanges )
423 QgsMargins margins = mProfile->plot()->margins();
425 mProfile->plot()->setMargins( margins );
426 mProfile->invalidateCache();
428 mProfile->endCommand();
431 mSpinBottomMargin->setClearValue( 0 );
432 connect( mSpinBottomMargin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [
this](
double value ) {
433 if ( !mProfile || mBlockChanges )
437 QgsMargins margins = mProfile->plot()->margins();
439 mProfile->plot()->setMargins( margins );
440 mProfile->invalidateCache();
442 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>( QStringLiteral(
"plot" ) );
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()
881 mCheckControlledByAtlas->setEnabled(
true );
885 mCheckControlledByAtlas->setEnabled(
false );
886 mCheckControlledByAtlas->setChecked(
false );
890void QgsLayoutElevationProfileWidget::atlasLayerChanged(
QgsVectorLayer *layer )
895 mCheckControlledByAtlas->setChecked(
false );
896 mCheckControlledByAtlas->setEnabled(
false );
901 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.