QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgslayoutelevationprofilewidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutelevationprofilewidget.cpp
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
20#include "qgslayoutitemwidget.h"
22#include "qgsplot.h"
23#include "qgsfillsymbol.h"
24#include "qgslinesymbol.h"
25#include "qgsvectorlayer.h"
27#include "qgslayout.h"
28#include "qgslayertree.h"
32#include "qgscurve.h"
33#include "qgslayoutatlas.h"
35#include "qgsgui.h"
36#include <QMenu>
37
39
41 : QgsLayoutItemBaseWidget( nullptr, profile )
42 , mProfile( profile )
43 , mLayerTree( new QgsLayerTree() )
44 , mLayerTreeBridge( new QgsLayerTreeRegistryBridge( mLayerTree.get(), mProfile->layout() ? mProfile->layout()->project() : QgsProject::instance(), this ) )
45{
46 Q_ASSERT( mProfile );
47
48 setupUi( this );
49 setPanelTitle( tr( "Elevation Profile Properties" ) );
50
51 mCopyFromDockMenu = new QMenu( this );
52 connect( mCopyFromDockMenu, &QMenu::aboutToShow, this, [ = ]
53 {
54 sBuildCopyMenuFunction( this, mCopyFromDockMenu );
55 } );
56
57 connect( mActionRefresh, &QAction::triggered, this, [ = ]
58 {
59 if ( !mProfile )
60 {
61 return;
62 }
63 mProfile->invalidateCache();
64 mProfile->refresh();
65 } );
66
67 QToolButton *copyFromDockButton = new QToolButton();
68 copyFromDockButton->setAutoRaise( true );
69 copyFromDockButton->setToolTip( tr( "Copy From Profile" ) );
70 copyFromDockButton->setMenu( mCopyFromDockMenu );
71 copyFromDockButton->setPopupMode( QToolButton::InstantPopup );
72 copyFromDockButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCopyProfileSettings.svg" ) ) );
73
74 mDockToolbar->addWidget( copyFromDockButton );
75
76 //add widget for general composer item properties
77 mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, profile );
78 mainLayout->addWidget( mItemPropertiesWidget );
79
80 connect( mLayerTree.get(), &QgsLayerTree::layerOrderChanged, this, &QgsLayoutElevationProfileWidget::updateItemLayers );
81 connect( mLayerTree.get(), &QgsLayerTreeGroup::visibilityChanged, this, &QgsLayoutElevationProfileWidget::updateItemLayers );
82
83 mSpinTolerance->setClearValue( 0 );
84 connect( mSpinTolerance, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
85 {
86 if ( !mProfile || mBlockChanges )
87 return;
88
89 mProfile->beginCommand( tr( "Change Profile Tolerance Distance" ), QgsLayoutItem::UndoElevationProfileTolerance );
90 mProfile->setTolerance( value );
91 mProfile->invalidateCache();
92 mProfile->update();
93 mProfile->endCommand();
94 } );
95
96 connect( mCheckControlledByAtlas, &QCheckBox::toggled, this, [ = ]
97 {
98 if ( !mProfile || mBlockChanges )
99 return;
100
101 mProfile->beginCommand( tr( "Change Profile Atlas Control" ) );
102 mProfile->setAtlasDriven( mCheckControlledByAtlas->isChecked() );
103 mProfile->invalidateCache();
104 mProfile->update();
105 mProfile->endCommand();
106 } );
107
108 mSpinMinDistance->setClearValue( 0 );
109 connect( mSpinMinDistance, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
110 {
111 if ( !mProfile || mBlockChanges )
112 return;
113
114 mProfile->beginCommand( tr( "Change Profile Chart Minimum Distance" ), QgsLayoutItem::UndoElevationProfileMinimumDistance );
115 mProfile->plot()->setXMinimum( value );
116 mProfile->invalidateCache();
117 mProfile->update();
118 mProfile->endCommand();
119 } );
120
121 connect( mSpinMaxDistance, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
122 {
123 if ( !mProfile || mBlockChanges )
124 return;
125
126 mProfile->beginCommand( tr( "Change Profile Chart Maximum Distance" ), QgsLayoutItem::UndoElevationProfileMaximumDistance );
127 mProfile->plot()->setXMaximum( value );
128 mProfile->invalidateCache();
129 mProfile->update();
130 mProfile->endCommand();
131 } );
132
133 mSpinMinElevation->setClearValue( 0 );
134 connect( mSpinMinElevation, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
135 {
136 if ( !mProfile || mBlockChanges )
137 return;
138
139 mProfile->beginCommand( tr( "Change Profile Chart Minimum Elevation" ), QgsLayoutItem::UndoElevationProfileMinimumElevation );
140 mProfile->plot()->setYMinimum( value );
141 mProfile->invalidateCache();
142 mProfile->update();
143 mProfile->endCommand();
144 } );
145
146 connect( mSpinMaxElevation, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
147 {
148 if ( !mProfile || mBlockChanges )
149 return;
150
151 mProfile->beginCommand( tr( "Change Profile Chart Maximum Elevation" ), QgsLayoutItem::UndoElevationProfileMaximumElevation );
152 mProfile->plot()->setYMaximum( value );
153 mProfile->invalidateCache();
154 mProfile->update();
155 mProfile->endCommand();
156 } );
157
158 mDistanceAxisMajorLinesSymbolButton->setSymbolType( Qgis::SymbolType::Line );
159 connect( mDistanceAxisMajorLinesSymbolButton, &QgsSymbolButton::changed, this, [ = ]
160 {
161 if ( !mProfile || mBlockChanges )
162 return;
163
164 mProfile->beginCommand( tr( "Change Profile Chart Distance Major Gridlines" ), QgsLayoutItem::UndoElevationProfileDistanceMajorGridlines );
165 mProfile->plot()->xAxis().setGridMajorSymbol( mDistanceAxisMajorLinesSymbolButton->clonedSymbol<QgsLineSymbol>() );
166 mProfile->invalidateCache();
167 mProfile->update();
168 mProfile->endCommand();
169 } );
170 mDistanceAxisMajorLinesSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::axisGridMajorSymbol() );
171
172 mDistanceAxisMinorLinesSymbolButton->setSymbolType( Qgis::SymbolType::Line );
173 connect( mDistanceAxisMinorLinesSymbolButton, &QgsSymbolButton::changed, this, [ = ]
174 {
175 if ( !mProfile || mBlockChanges )
176 return;
177
178 mProfile->beginCommand( tr( "Change Profile Chart Distance Minor Gridlines" ), QgsLayoutItem::UndoElevationProfileDistanceMinorGridlines );
179 mProfile->plot()->xAxis().setGridMinorSymbol( mDistanceAxisMinorLinesSymbolButton->clonedSymbol<QgsLineSymbol>() );
180 mProfile->invalidateCache();
181 mProfile->update();
182 mProfile->endCommand();
183 } );
184 mDistanceAxisMinorLinesSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::axisGridMinorSymbol() );
185
186 connect( mDistanceAxisMajorIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
187 {
188 if ( !mProfile || mBlockChanges )
189 return;
190
191 mProfile->beginCommand( tr( "Change Profile Chart Distance Major Gridlines" ), QgsLayoutItem::UndoElevationProfileDistanceMajorGridlines );
192 mProfile->plot()->xAxis().setGridIntervalMajor( value );
193 mProfile->invalidateCache();
194 mProfile->update();
195 mProfile->endCommand();
196 } );
197
198 connect( mDistanceAxisMinorIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
199 {
200 if ( !mProfile || mBlockChanges )
201 return;
202
203 mProfile->beginCommand( tr( "Change Profile Chart Distance Minor Gridlines" ), QgsLayoutItem::UndoElevationProfileDistanceMinorGridlines );
204 mProfile->plot()->xAxis().setGridIntervalMinor( value );
205 mProfile->invalidateCache();
206 mProfile->update();
207 mProfile->endCommand();
208 } );
209
210 connect( mDistanceAxisLabelIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
211 {
212 if ( !mProfile || mBlockChanges )
213 return;
214
215 mProfile->beginCommand( tr( "Change Profile Chart Distance Label" ), QgsLayoutItem::UndoElevationProfileDistanceLabels );
216 mProfile->plot()->xAxis().setLabelInterval( value );
217 mProfile->invalidateCache();
218 mProfile->update();
219 mProfile->endCommand();
220 } );
221
222 mElevationAxisMajorLinesSymbolButton->setSymbolType( Qgis::SymbolType::Line );
223 connect( mElevationAxisMajorLinesSymbolButton, &QgsSymbolButton::changed, this, [ = ]
224 {
225 if ( !mProfile || mBlockChanges )
226 return;
227
228 mProfile->beginCommand( tr( "Change Profile Chart Elevation Major Gridlines" ), QgsLayoutItem::UndoElevationProfileElevationMajorGridlines );
229 mProfile->plot()->yAxis().setGridMajorSymbol( mElevationAxisMajorLinesSymbolButton->clonedSymbol<QgsLineSymbol>() );
230 mProfile->invalidateCache();
231 mProfile->update();
232 mProfile->endCommand();
233 } );
234 mElevationAxisMajorLinesSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::axisGridMajorSymbol() );
235
236 mElevationAxisMinorLinesSymbolButton->setSymbolType( Qgis::SymbolType::Line );
237 connect( mElevationAxisMinorLinesSymbolButton, &QgsSymbolButton::changed, this, [ = ]
238 {
239 if ( !mProfile || mBlockChanges )
240 return;
241
242 mProfile->beginCommand( tr( "Change Profile Chart Elevation Minor Gridlines" ), QgsLayoutItem::UndoElevationProfileElevationMinorGridlines );
243 mProfile->plot()->yAxis().setGridMinorSymbol( mElevationAxisMinorLinesSymbolButton->clonedSymbol<QgsLineSymbol>() );
244 mProfile->invalidateCache();
245 mProfile->update();
246 mProfile->endCommand();
247 } );
248 mElevationAxisMinorLinesSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::axisGridMinorSymbol() );
249
250 connect( mElevationAxisLabelIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
251 {
252 if ( !mProfile || mBlockChanges )
253 return;
254
255 mProfile->beginCommand( tr( "Change Profile Chart Elevation Label" ), QgsLayoutItem::UndoElevationProfileElevationLabels );
256 mProfile->plot()->yAxis().setLabelInterval( value );
257 mProfile->invalidateCache();
258 mProfile->update();
259 mProfile->endCommand();
260 } );
261
262 connect( mElevationAxisMajorIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
263 {
264 if ( !mProfile || mBlockChanges )
265 return;
266
267 mProfile->beginCommand( tr( "Change Profile Chart Elevation Major Gridlines" ), QgsLayoutItem::UndoElevationProfileElevationMajorGridlines );
268 mProfile->plot()->yAxis().setGridIntervalMajor( value );
269 mProfile->invalidateCache();
270 mProfile->update();
271 mProfile->endCommand();
272 } );
273
274 connect( mElevationAxisMinorIntervalSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
275 {
276 if ( !mProfile || mBlockChanges )
277 return;
278
279 mProfile->beginCommand( tr( "Change Profile Chart Distance Minor Gridlines" ), QgsLayoutItem::UndoElevationProfileElevationMinorGridlines );
280 mProfile->plot()->yAxis().setGridIntervalMinor( value );
281 mProfile->invalidateCache();
282 mProfile->update();
283 mProfile->endCommand();
284 } );
285
286 mChartBackgroundSymbolButton->setSymbolType( Qgis::SymbolType::Fill );
287 connect( mChartBackgroundSymbolButton, &QgsSymbolButton::changed, this, [ = ]
288 {
289 if ( !mProfile || mBlockChanges )
290 return;
291
292 mProfile->beginCommand( tr( "Change Profile Chart Background" ), QgsLayoutItem::UndoElevationProfileChartBackground );
293 mProfile->plot()->setChartBackgroundSymbol( mChartBackgroundSymbolButton->clonedSymbol<QgsFillSymbol>() );
294 mProfile->invalidateCache();
295 mProfile->update();
296 mProfile->endCommand();
297 } );
298 mChartBackgroundSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::chartBackgroundSymbol() );
299
300 mChartBorderSymbolButton->setSymbolType( Qgis::SymbolType::Fill );
301 connect( mChartBorderSymbolButton, &QgsSymbolButton::changed, this, [ = ]
302 {
303 if ( !mProfile || mBlockChanges )
304 return;
305
306 mProfile->beginCommand( tr( "Change Profile Chart Border" ), QgsLayoutItem::UndoElevationProfileChartBorder );
307 mProfile->plot()->setChartBorderSymbol( mChartBorderSymbolButton->clonedSymbol<QgsFillSymbol>() );
308 mProfile->invalidateCache();
309 mProfile->update();
310 mProfile->endCommand();
311 } );
312 mChartBorderSymbolButton->setDefaultSymbol( QgsPlotDefaultSettings::chartBorderSymbol() );
313
314 connect( mDistanceAxisLabelFormatButton, &QPushButton::clicked, this, [ = ]
315 {
316 if ( !mProfile || mBlockChanges )
317 return;
318
320 widget->setPanelTitle( tr( "Distance Number Format" ) );
321 widget->setFormat( mProfile->plot()->xAxis().numericFormat() );
322 connect( widget, &QgsNumericFormatSelectorWidget::changed, this, [ = ]
323 {
324 mProfile->beginCommand( tr( "Change Profile Chart Distance Format" ), QgsLayoutItem::UndoElevationProfileDistanceFormat );
325 mProfile->plot()->xAxis().setNumericFormat( widget->format() );
326 mProfile->invalidateCache();
327 mProfile->endCommand();
328 mProfile->update();
329 } );
330 openPanel( widget );
331 } );
332
333 connect( mElevationAxisLabelFormatButton, &QPushButton::clicked, this, [ = ]
334 {
335 if ( !mProfile || mBlockChanges )
336 return;
337
339 widget->setPanelTitle( tr( "Elevation Number Format" ) );
340 widget->setFormat( mProfile->plot()->yAxis().numericFormat() );
341 connect( widget, &QgsNumericFormatSelectorWidget::changed, this, [ = ]
342 {
343 mProfile->beginCommand( tr( "Change Profile Chart Elevation Format" ), QgsLayoutItem::UndoElevationProfileElevationFormat );
344 mProfile->plot()->yAxis().setNumericFormat( widget->format() );
345 mProfile->invalidateCache();
346 mProfile->endCommand();
347 mProfile->update();
348 } );
349 openPanel( widget );
350 } );
351
352 mDistanceAxisLabelFontButton->setDialogTitle( tr( "Distance Label Font" ) );
353 mElevationAxisLabelFontButton->setDialogTitle( tr( "Elevation Label Font" ) );
354 mDistanceAxisLabelFontButton->setMode( QgsFontButton::ModeTextRenderer );
355 mElevationAxisLabelFontButton->setMode( QgsFontButton::ModeTextRenderer );
356
357 connect( mDistanceAxisLabelFontButton, &QgsFontButton::changed, this, [ = ]
358 {
359 if ( !mProfile || mBlockChanges )
360 return;
361
362 mProfile->beginCommand( tr( "Change Profile Chart Distance Font" ), QgsLayoutItem::UndoElevationProfileDistanceFont );
363 mProfile->plot()->xAxis().setTextFormat( mDistanceAxisLabelFontButton->textFormat() );
364 mProfile->invalidateCache();
365 mProfile->endCommand();
366 mProfile->update();
367 } );
368
369 connect( mElevationAxisLabelFontButton, &QgsFontButton::changed, this, [ = ]
370 {
371 if ( !mProfile || mBlockChanges )
372 return;
373
374 mProfile->beginCommand( tr( "Change Profile Chart Elevation Font" ), QgsLayoutItem::UndoElevationProfileElevationFont );
375 mProfile->plot()->yAxis().setTextFormat( mElevationAxisLabelFontButton->textFormat() );
376 mProfile->invalidateCache();
377 mProfile->endCommand();
378 mProfile->update();
379 } );
380
381 mSpinLeftMargin->setClearValue( 0 );
382 connect( mSpinLeftMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
383 {
384 if ( !mProfile || mBlockChanges )
385 return;
386
387 mProfile->beginCommand( tr( "Change Profile Chart Left Margin" ), QgsLayoutItem::UndoMarginLeft );
388 QgsMargins margins = mProfile->plot()->margins();
389 margins.setLeft( value );
390 mProfile->plot()->setMargins( margins );
391 mProfile->invalidateCache();
392 mProfile->update();
393 mProfile->endCommand();
394 } );
395
396 mSpinRightMargin->setClearValue( 0 );
397 connect( mSpinRightMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
398 {
399 if ( !mProfile || mBlockChanges )
400 return;
401
402 mProfile->beginCommand( tr( "Change Profile Chart Right Margin" ), QgsLayoutItem::UndoMarginRight );
403 QgsMargins margins = mProfile->plot()->margins();
404 margins.setRight( value );
405 mProfile->plot()->setMargins( margins );
406 mProfile->invalidateCache();
407 mProfile->update();
408 mProfile->endCommand();
409 } );
410
411 mSpinTopMargin->setClearValue( 0 );
412 connect( mSpinTopMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
413 {
414 if ( !mProfile || mBlockChanges )
415 return;
416
417 mProfile->beginCommand( tr( "Change Profile Chart Top Margin" ), QgsLayoutItem::UndoMarginTop );
418 QgsMargins margins = mProfile->plot()->margins();
419 margins.setTop( value );
420 mProfile->plot()->setMargins( margins );
421 mProfile->invalidateCache();
422 mProfile->update();
423 mProfile->endCommand();
424 } );
425
426 mSpinBottomMargin->setClearValue( 0 );
427 connect( mSpinBottomMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ), this, [ = ]( double value )
428 {
429 if ( !mProfile || mBlockChanges )
430 return;
431
432 mProfile->beginCommand( tr( "Change Profile Chart Bottom Margin" ), QgsLayoutItem::UndoMarginBottom );
433 QgsMargins margins = mProfile->plot()->margins();
434 margins.setBottom( value );
435 mProfile->plot()->setMargins( margins );
436 mProfile->invalidateCache();
437 mProfile->update();
438 mProfile->endCommand();
439 } );
440
441 for ( Qgis::DistanceUnit unit :
442 {
453 } )
454 {
455 QString title;
457 {
459 }
460 else
461 {
462 title = QgsUnitTypes::toString( unit );
463 }
464 mDistanceUnitCombo->addItem( title, QVariant::fromValue( unit ) );
465 }
466
467 connect( mDistanceUnitCombo, qOverload< int >( &QComboBox::currentIndexChanged ), this, [ = ]( int )
468 {
469 if ( !mProfile || mBlockChanges )
470 return;
471
472 mProfile->beginCommand( tr( "Change Profile Chart Units" ) );
473 mProfile->setDistanceUnit( mDistanceUnitCombo->currentData().value< Qgis::DistanceUnit >() );
474 mProfile->invalidateCache();
475 mProfile->update();
476 mProfile->endCommand();
477 } );
478
479 mDistanceLabelsCombo->addItem( tr( "None" ), QVariant::fromValue( Qgis::PlotAxisSuffixPlacement::NoLabels ) );
480 mDistanceLabelsCombo->addItem( tr( "Every Value" ), QVariant::fromValue( Qgis::PlotAxisSuffixPlacement::EveryLabel ) );
481 mDistanceLabelsCombo->addItem( tr( "First Value" ), QVariant::fromValue( Qgis::PlotAxisSuffixPlacement::FirstLabel ) );
482 mDistanceLabelsCombo->addItem( tr( "Last Value" ), QVariant::fromValue( Qgis::PlotAxisSuffixPlacement::LastLabel ) );
483 mDistanceLabelsCombo->addItem( tr( "First and Last Values" ), QVariant::fromValue( Qgis::PlotAxisSuffixPlacement::FirstAndLastLabels ) );
484 connect( mDistanceLabelsCombo, qOverload< int >( &QComboBox::currentIndexChanged ), this, [ = ]( int )
485 {
486 if ( !mProfile || mBlockChanges )
487 return;
488
489 mProfile->beginCommand( tr( "Change Profile Chart Label Placement" ) );
490 mProfile->plot()->xAxis().setLabelSuffixPlacement( mDistanceLabelsCombo->currentData().value< Qgis::PlotAxisSuffixPlacement >() );
491 mProfile->invalidateCache();
492 mProfile->update();
493 mProfile->endCommand();
494 } );
495
496
512
513 mLayerTreeView = new QgsElevationProfileLayerTreeView( mLayerTree.get() );
514
515 QVBoxLayout *vl = new QVBoxLayout();
516 vl->setContentsMargins( 0, 0, 0, 0 );
517 vl->addWidget( mLayerTreeView );
518 mTreeViewContainer->setLayout( vl );
519
520 mBlockChanges++;
521 mLayerTreeView->populateInitialLayers( mProfile->layout() && mProfile->layout()->project() ? mProfile->layout()->project() : QgsProject::instance() );
522 mBlockChanges--;
523
524 setGuiElementValues();
525
526 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
527 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
528 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
529 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
530 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
531 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
532 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
533 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
534
535 mDistanceAxisMajorLinesSymbolButton->setLayer( coverageLayer() );
536 mDistanceAxisMinorLinesSymbolButton->setLayer( coverageLayer() );
537 mElevationAxisMajorLinesSymbolButton->setLayer( coverageLayer() );
538 mElevationAxisMinorLinesSymbolButton->setLayer( coverageLayer() );
539 mDistanceAxisLabelFontButton->setLayer( coverageLayer() );
540 mElevationAxisLabelFontButton->setLayer( coverageLayer() );
541 mChartBackgroundSymbolButton->setLayer( coverageLayer() );
542 mChartBorderSymbolButton->setLayer( coverageLayer() );
543
544 if ( mProfile->layout() )
545 {
546 connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, this, [ = ]( QgsVectorLayer * layer )
547 {
548 mDistanceAxisMajorLinesSymbolButton->setLayer( layer );
549 mDistanceAxisMinorLinesSymbolButton->setLayer( layer );
550 mElevationAxisMajorLinesSymbolButton->setLayer( layer );
551 mElevationAxisMinorLinesSymbolButton->setLayer( layer );
552 mDistanceAxisLabelFontButton->setLayer( layer );
553 mElevationAxisLabelFontButton->setLayer( layer );
554 mChartBackgroundSymbolButton->setLayer( layer );
555 mChartBorderSymbolButton->setLayer( layer );
556 } );
557
558 connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged,
559 this, &QgsLayoutElevationProfileWidget::atlasLayerChanged );
560 }
561
562 if ( QgsLayoutAtlas *atlas = layoutAtlas() )
563 {
564 connect( atlas, &QgsLayoutAtlas::toggled, this, &QgsLayoutElevationProfileWidget::layoutAtlasToggled );
565 layoutAtlasToggled( atlas->enabled() );
566 }
567}
568
570
572{
573 if ( mItemPropertiesWidget )
574 mItemPropertiesWidget->setMasterLayout( masterLayout );
575}
576
578{
579 return mProfile->createExpressionContext();
580}
581
587
589{
590 mCheckControlledByAtlas->setText( tr( "Controlled by %1" ).arg( string == tr( "atlas" ) ? tr( "Atlas" ) : tr( "Report" ) ) );
591}
592
594{
595 mBlockChanges++;
596
597 mProfile->setCrs( canvas->crs() );
598
599 mSpinTolerance->setValue( canvas->tolerance() );
600 mProfile->setTolerance( canvas->tolerance() );
601
602 mProfile->setDistanceUnit( canvas->distanceUnit() );
603 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( canvas->distanceUnit() ) ) );
604
605 mProfile->plot()->xAxis().setLabelSuffixPlacement( canvas->plot().xAxis().labelSuffixPlacement() );
606 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( canvas->plot().xAxis().labelSuffixPlacement() ) ) );
607
608 if ( const QgsCurve *curve = canvas->profileCurve() )
609 mProfile->setProfileCurve( curve->clone() );
610
611 mSpinMinDistance->setValue( canvas->plot().xMinimum() );
612 mSpinMinDistance->setClearValue( canvas->plot().xMinimum() );
613 mProfile->plot()->setXMinimum( canvas->plot().xMinimum() );
614
615 mSpinMaxDistance->setValue( canvas->plot().xMaximum() );
616 mSpinMaxDistance->setClearValue( canvas->plot().xMaximum() );
617 mProfile->plot()->setXMaximum( canvas->plot().xMaximum() );
618
619 mDistanceAxisMajorIntervalSpin->setValue( canvas->plot().xAxis().gridIntervalMajor() );
620 mDistanceAxisMajorIntervalSpin->setClearValue( canvas->plot().xAxis().gridIntervalMajor() );
621 mProfile->plot()->xAxis().setGridIntervalMajor( canvas->plot().xAxis().gridIntervalMajor() );
622
623 mDistanceAxisMinorIntervalSpin->setValue( canvas->plot().xAxis().gridIntervalMinor() );
624 mDistanceAxisMinorIntervalSpin->setClearValue( canvas->plot().xAxis().gridIntervalMinor() );
625 mProfile->plot()->xAxis().setGridIntervalMinor( canvas->plot().xAxis().gridIntervalMinor() );
626
627 mDistanceAxisLabelIntervalSpin->setValue( canvas->plot().xAxis().labelInterval() );
628 mDistanceAxisLabelIntervalSpin->setClearValue( canvas->plot().xAxis().labelInterval() );
629 mProfile->plot()->xAxis().setLabelInterval( canvas->plot().xAxis().labelInterval() );
630
631 mSpinMinElevation->setValue( canvas->plot().xMinimum() );
632 mSpinMinElevation->setClearValue( canvas->plot().yMinimum() );
633 mProfile->plot()->setYMinimum( canvas->plot().yMinimum() );
634
635 mSpinMaxElevation->setValue( canvas->plot().yMaximum() );
636 mSpinMaxElevation->setClearValue( canvas->plot().yMaximum() );
637 mProfile->plot()->setYMaximum( canvas->plot().yMaximum() );
638
639 mElevationAxisMajorIntervalSpin->setValue( canvas->plot().yAxis().gridIntervalMajor() );
640 mElevationAxisMajorIntervalSpin->setClearValue( canvas->plot().yAxis().gridIntervalMajor() );
641 mProfile->plot()->yAxis().setGridIntervalMajor( canvas->plot().yAxis().gridIntervalMajor() );
642
643 mElevationAxisMinorIntervalSpin->setValue( canvas->plot().yAxis().gridIntervalMinor() );
644 mElevationAxisMinorIntervalSpin->setClearValue( canvas->plot().yAxis().gridIntervalMinor() );
645 mProfile->plot()->yAxis().setGridIntervalMinor( canvas->plot().yAxis().gridIntervalMinor() );
646
647 mElevationAxisLabelIntervalSpin->setValue( canvas->plot().yAxis().labelInterval() );
648 mElevationAxisLabelIntervalSpin->setClearValue( canvas->plot().yAxis().labelInterval() );
649 mProfile->plot()->yAxis().setLabelInterval( canvas->plot().yAxis().labelInterval() );
650
651 QList<QgsMapLayer *> canvasLayers = canvas->layers();
652 // canvas layers are in opposite direction to what the layout item requires
653 std::reverse( canvasLayers.begin(), canvasLayers.end() );
654 mProfile->setLayers( canvasLayers );
655 const QList<QgsLayerTreeLayer *> layers = mLayerTree->findLayers();
656 for ( QgsLayerTreeLayer *layer : layers )
657 {
658 layer->setItemVisibilityChecked( mProfile->layers().contains( layer->layer() ) );
659 }
660 mLayerTree->reorderGroupLayers( mProfile->layers() );
661
662 mProfile->invalidateCache();
663 mProfile->update();
664 mBlockChanges--;
665}
666
668{
670 return false;
671
672 if ( mProfile )
673 {
674 disconnect( mProfile, &QgsLayoutObject::changed, this, &QgsLayoutElevationProfileWidget::setGuiElementValues );
675 }
676
677 mProfile = qobject_cast< QgsLayoutItemElevationProfile * >( item );
678 mItemPropertiesWidget->setItem( mProfile );
679
680 if ( mProfile )
681 {
682 connect( mProfile, &QgsLayoutObject::changed, this, &QgsLayoutElevationProfileWidget::setGuiElementValues );
683 mDistanceAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
684 mDistanceAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
685 mElevationAxisMajorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
686 mElevationAxisMinorLinesSymbolButton->registerExpressionContextGenerator( mProfile );
687 mDistanceAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
688 mElevationAxisLabelFontButton->registerExpressionContextGenerator( mProfile );
689 mChartBackgroundSymbolButton->registerExpressionContextGenerator( mProfile );
690 mChartBorderSymbolButton->registerExpressionContextGenerator( mProfile );
691 }
692
693 setGuiElementValues();
694
695 return true;
696}
697
698void QgsLayoutElevationProfileWidget::setGuiElementValues()
699{
700 mBlockChanges++;
701
702 mSpinTolerance->setValue( mProfile->tolerance() );
703 mCheckControlledByAtlas->setChecked( mProfile->atlasDriven() );
704
705 mSpinMinDistance->setValue( mProfile->plot()->xMinimum() );
706 mSpinMaxDistance->setValue( mProfile->plot()->xMaximum() );
707 mSpinMinElevation->setValue( mProfile->plot()->yMinimum() );
708 mSpinMaxElevation->setValue( mProfile->plot()->yMaximum() );
709
710 if ( mProfile->plot()->xAxis().gridMajorSymbol() )
711 mDistanceAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMajorSymbol()->clone() );
712 if ( mProfile->plot()->xAxis().gridMinorSymbol() )
713 mDistanceAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->xAxis().gridMinorSymbol()->clone() );
714 if ( mProfile->plot()->yAxis().gridMajorSymbol() )
715 mElevationAxisMajorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMajorSymbol()->clone() );
716 if ( mProfile->plot()->yAxis().gridMajorSymbol() )
717 mElevationAxisMinorLinesSymbolButton->setSymbol( mProfile->plot()->yAxis().gridMinorSymbol()->clone() );
718
719 mDistanceAxisLabelFontButton->setTextFormat( mProfile->plot()->xAxis().textFormat() );
720 mElevationAxisLabelFontButton->setTextFormat( mProfile->plot()->yAxis().textFormat() );
721
722 mDistanceUnitCombo->setCurrentIndex( mDistanceUnitCombo->findData( QVariant::fromValue( mProfile->distanceUnit() ) ) );
723 mDistanceLabelsCombo->setCurrentIndex( mDistanceLabelsCombo->findData( QVariant::fromValue( mProfile->plot()->xAxis().labelSuffixPlacement() ) ) );
724
725 mDistanceAxisMajorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMajor() );
726 mDistanceAxisMinorIntervalSpin->setValue( mProfile->plot()->xAxis().gridIntervalMinor() );
727 mDistanceAxisLabelIntervalSpin->setValue( mProfile->plot()->xAxis().labelInterval() );
728
729 mElevationAxisMajorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMajor() );
730 mElevationAxisMinorIntervalSpin->setValue( mProfile->plot()->yAxis().gridIntervalMinor() );
731 mElevationAxisLabelIntervalSpin->setValue( mProfile->plot()->yAxis().labelInterval() );
732
733 if ( mProfile->plot()->chartBackgroundSymbol() )
734 mChartBackgroundSymbolButton->setSymbol( mProfile->plot()->chartBackgroundSymbol()->clone() );
735 if ( mProfile->plot()->chartBorderSymbol() )
736 mChartBorderSymbolButton->setSymbol( mProfile->plot()->chartBorderSymbol()->clone() );
737
738 mSpinLeftMargin->setValue( mProfile->plot()->margins().left() );
739 mSpinRightMargin->setValue( mProfile->plot()->margins().right() );
740 mSpinTopMargin->setValue( mProfile->plot()->margins().top() );
741 mSpinBottomMargin->setValue( mProfile->plot()->margins().bottom() );
742
743 const QList<QgsLayerTreeLayer *> layers = mLayerTree->findLayers();
744 for ( QgsLayerTreeLayer *layer : layers )
745 {
746 layer->setItemVisibilityChecked( mProfile->layers().contains( layer->layer() ) );
747 }
748 mLayerTree->reorderGroupLayers( mProfile->layers() );
749
750 updateDataDefinedButton( mDDBtnTolerance );
751 updateDataDefinedButton( mDDBtnMinDistance );
752 updateDataDefinedButton( mDDBtnMaxDistance );
753 updateDataDefinedButton( mDDBtnMinElevation );
754 updateDataDefinedButton( mDDBtnMaxElevation );
755 updateDataDefinedButton( mDDBtnDistanceMajorInterval );
756 updateDataDefinedButton( mDDBtnDistanceMinorInterval );
757 updateDataDefinedButton( mDDBtnDistanceLabelInterval );
758 updateDataDefinedButton( mDDBtnElevationMajorInterval );
759 updateDataDefinedButton( mDDBtnElevationMinorInterval );
760 updateDataDefinedButton( mDDBtnElevationLabelInterval );
761 updateDataDefinedButton( mDDBtnLeftMargin );
762 updateDataDefinedButton( mDDBtnRightMargin );
763 updateDataDefinedButton( mDDBtnTopMargin );
764 updateDataDefinedButton( mDDBtnBottomMargin );
765
766 mBlockChanges--;
767}
768
769void QgsLayoutElevationProfileWidget::updateItemLayers()
770{
771 if ( mBlockChanges )
772 return;
773
774 QList<QgsMapLayer *> layers;
775 const QList< QgsMapLayer * > layerOrder = mLayerTree->layerOrder();
776 layers.reserve( layerOrder.size() );
777 for ( QgsMapLayer *layer : layerOrder )
778 {
779 if ( mLayerTree->findLayer( layer )->isVisible() )
780 layers << layer;
781 }
782
783 mProfile->setLayers( layers );
784 mProfile->update();
785}
786
787void QgsLayoutElevationProfileWidget::layoutAtlasToggled( bool atlasEnabled )
788{
789 if ( atlasEnabled &&
790 mProfile && mProfile->layout() && mProfile->layout()->reportContext().layer()
791 && mProfile->layout()->reportContext().layer()->geometryType() == Qgis::GeometryType::Line )
792 {
793 mCheckControlledByAtlas->setEnabled( true );
794 }
795 else
796 {
797 mCheckControlledByAtlas->setEnabled( false );
798 mCheckControlledByAtlas->setChecked( false );
799 }
800}
801
802void QgsLayoutElevationProfileWidget::atlasLayerChanged( QgsVectorLayer *layer )
803{
804 if ( !layer || layer->geometryType() != Qgis::GeometryType::Line )
805 {
806 //non-line layer, disable atlas control
807 mCheckControlledByAtlas->setChecked( false );
808 mCheckControlledByAtlas->setEnabled( false );
809 return;
810 }
811 else
812 {
813 mCheckControlledByAtlas->setEnabled( true );
814 }
815}
PlotAxisSuffixPlacement
Placement options for suffixes in the labels for axis of plots.
Definition qgis.h:2448
@ 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.
Definition qgis.h:3496
@ Feet
Imperial feet.
@ Centimeters
Centimeters.
@ Millimeters
Millimeters.
@ Miles
Terrestrial miles.
@ Yards
Imperial yards.
@ Degrees
Degrees, for planar geographic CRS distance measurements.
@ Inches
Inches (since QGIS 3.32)
@ NauticalMiles
Nautical miles.
@ Kilometers
Kilometers.
@ TitleCase
Simple title case conversion - does not fully grammatically parse the text and uses simple rules only...
@ Line
Line symbol.
@ Fill
Fill symbol.
double yMaximum() const
Returns the maximum value of the y axis.
Definition qgsplot.h:390
QgsPlotAxis & xAxis()
Returns a reference to the plot's x axis.
Definition qgsplot.h:404
double xMaximum() const
Returns the maximum value of the x axis.
Definition qgsplot.h:376
double xMinimum() const
Returns the minimum value of the x axis.
Definition qgsplot.h:348
QgsPlotAxis & yAxis()
Returns a reference to the plot's y axis.
Definition qgsplot.h:418
double yMinimum() const
Returns the minimum value of the y axis.
Definition qgsplot.h:362
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Abstract base class for curved geometry type.
Definition qgscurve.h:36
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.
QList< QgsMapLayer * > layers() const
Returns the list of layers included in the profile.
const Qgs2DPlot & plot() const
Returns a reference to the 2D plot used by the widget.
Qgis::DistanceUnit distanceUnit() const
Returns the distance unit used by the canvas.
double tolerance() const
Returns the tolerance of the profile (in crs() units).
A layer tree view for elevation profiles.
void populateInitialLayers(QgsProject *project)
Initially populates the tree view using layers from a project.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
@ ModeTextRenderer
Configure font settings for use with QgsTextRenderer.
void changed()
Emitted when the widget's text format settings are changed.
@ HigDialogTitleIsTitleCase
Dialog titles should be title case.
Definition qgsgui.h:256
static QgsGui::HigFlags higFlags()
Returns the platform's HIG flags.
Definition qgsgui.cpp:218
Layer tree node points to a map layer.
void visibilityChanged(QgsLayerTreeNode *node)
Emitted when check state of a node within the tree has been changed.
Listens to the updates in map layer registry and does changes in layer tree.
Namespace with helper functions for layer tree operations.
void layerOrderChanged()
Emitted when the layer order has changed.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
void toggled(bool)
Emitted when atlas is enabled or disabled.
A common interface for layout designer dialogs and widgets.
A widget for layout elevation profile item settings.
void setReportTypeString(const QString &string) override
Sets the string to use to describe the current report type (e.g.
static std::function< void(QgsLayoutElevationProfileWidget *, QMenu *) > sBuildCopyMenuFunction
void copySettingsFromProfileCanvas(QgsElevationProfileCanvas *canvas)
Copies selected settings from a elevation profile canvas.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void setMasterLayout(QgsMasterLayoutInterface *masterLayout) override
Sets the master layout associated with the item.
bool setNewItem(QgsLayoutItem *item) override
Attempts to update the widget to show the properties for the specified item.
QgsLayoutElevationProfileWidget(QgsLayoutItemElevationProfile *profile)
constructor
void setDesignerInterface(QgsLayoutDesignerInterface *iface) override
Sets the the layout designer interface in which the widget is being shown.
A base class for property widgets for layout items.
void updateDataDefinedButton(QgsPropertyOverrideButton *button)
Updates a previously registered data defined button to reflect the item's current properties.
QgsVectorLayer * coverageLayer() const
Returns the current layout context coverage layer (if set).
void registerDataDefinedButton(QgsPropertyOverrideButton *button, QgsLayoutObject::DataDefinedProperty property)
Registers a data defined button, setting up its initial value, connections and description.
virtual void setDesignerInterface(QgsLayoutDesignerInterface *iface)
Sets the the layout designer interface in which the widget is being shown.
QgsLayoutAtlas * layoutAtlas() const
Returns the atlas for the layout (if available)
A layout item subclass for elevation profile plots.
A widget for controlling the common properties of layout items (e.g.
void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
void setItem(QgsLayoutItem *item)
Sets the layout item.
@ LayoutElevationProfile
Elevation profile item (since QGIS 3.30)
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 (since QGIS 3.30)
@ UndoElevationProfileChartBorder
Change elevation profile chart border.
@ UndoElevationProfileMaximumElevation
Change elevation profile maximum elevation.
@ UndoMarginLeft
Left margin (since QGIS 3.30)
@ UndoMarginRight
Right margin (since QGIS 3.30)
@ 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 (since QGIS 3.30)
@ 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.
int type() const override
Returns a unique graphics item type identifier.
void changed()
Emitted when the object's properties change.
@ ElevationProfileTolerance
Tolerance distance for elevation profiles (since QGIS 3.30)
@ ElevationProfileElevationLabelInterval
Label interval for elevation profile elevation axis (since QGIS 3.30)
@ ElevationProfileDistanceMajorInterval
Major grid line interval for elevation profile distance axis (since QGIS 3.30)
@ MarginTop
Top margin (since QGIS 3.30)
@ ElevationProfileDistanceLabelInterval
Label interval for elevation profile distance axis (since QGIS 3.30)
@ ElevationProfileElevationMinorInterval
Minor grid line interval for elevation profile elevation axis (since QGIS 3.30)
@ MarginLeft
Left margin (since QGIS 3.30)
@ ElevationProfileMaximumDistance
Maximum distance value for elevation profile (since QGIS 3.30)
@ MarginRight
Right margin (since QGIS 3.30)
@ ElevationProfileMinimumElevation
Minimum elevation value for elevation profile (since QGIS 3.30)
@ ElevationProfileElevationMajorInterval
Major grid line interval for elevation profile elevation axis (since QGIS 3.30)
@ ElevationProfileMinimumDistance
Minimum distance value for elevation profile (since QGIS 3.30)
@ MarginBottom
Bottom margin (since QGIS 3.30)
@ ElevationProfileDistanceMinorInterval
Minor grid line interval for elevation profile distance axis (since QGIS 3.30)
@ ElevationProfileMaximumElevation
Maximum elevation value for elevation profile (since QGIS 3.30)
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
A line symbol type, for rendering LineString and MultiLineString geometries.
Base class for all map layer types.
Definition qgsmaplayer.h:74
The QgsMargins class defines the four margins of a rectangle.
Definition qgsmargins.h:38
void setBottom(double bottom)
Sets the bottom margin to bottom.
Definition qgsmargins.h:114
void setLeft(double left)
Sets the left margin to left.
Definition qgsmargins.h:96
void setRight(double right)
Sets the right margin to right.
Definition qgsmargins.h:108
void setTop(double top)
Sets the top margin to top.
Definition qgsmargins.h:102
Interface for master layout type objects, such as print layouts and reports.
A widget which allows choice of numeric formats and the properties of them.
QgsNumericFormat * format() const
Returns a new format object representing the settings currently configured in the widget.
void changed()
Emitted whenever the format configured55 in the widget is changed.
void setFormat(const QgsNumericFormat *format)
Sets the format to show in the widget.
void openPanel(QgsPanelWidget *panel)
Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the ...
void setPanelTitle(const QString &panelTitle)
Set the title of the panel when shown in the interface.
double gridIntervalMinor() const
Returns the interval of minor grid lines for the axis.
Definition qgsplot.h:104
double gridIntervalMajor() const
Returns the interval of major grid lines for the axis.
Definition qgsplot.h:118
double labelInterval() const
Returns the interval of labels for the axis.
Definition qgsplot.h:132
Qgis::PlotAxisSuffixPlacement labelSuffixPlacement() const
Returns the placement for the axis label suffixes.
Definition qgsplot.cpp:124
static QgsFillSymbol * chartBorderSymbol()
Returns the default fill symbol to use for the chart area border.
Definition qgsplot.cpp:793
static QgsLineSymbol * axisGridMinorSymbol()
Returns the default line symbol to use for axis minor grid lines.
Definition qgsplot.cpp:780
static QgsFillSymbol * chartBackgroundSymbol()
Returns the default fill symbol to use for the chart area background fill.
Definition qgsplot.cpp:787
static QgsLineSymbol * axisGridMajorSymbol()
Returns the default line symbol to use for axis major grid lines.
Definition qgsplot.cpp:773
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
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.
void changed()
Emitted when the symbol's settings are changed.
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 data sets.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.