57 mGridFrameMarginSpinBox->setShowClearButton(
true );
58 mGridFrameMarginSpinBox->setClearValue( 0 );
60 mDistanceToMapFrameSpinBox->setShowClearButton(
true );
61 mDistanceToMapFrameSpinBox->setClearValue( 0 );
63 connect( mIntervalXSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished );
64 connect( mIntervalYSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished );
65 connect( mOffsetXSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged );
66 connect( mOffsetYSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged );
67 connect( mCrossWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged );
68 connect( mFrameWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged );
69 connect( mGridFrameMarginSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged );
70 connect( mFrameStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged );
71 connect( mRotatedTicksGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled );
72 connect( mRotatedTicksLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged );
73 connect( mRotatedTicksThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged );
74 connect( mRotatedTicksMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged );
75 connect( mRotatedAnnotationsGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled );
76 connect( mRotatedAnnotationsLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged );
77 connect( mRotatedAnnotationsThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged );
78 connect( mRotatedAnnotationsMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged );
79 connect( mGridFramePenSizeSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged );
80 connect( mGridFramePenColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged );
81 connect( mGridFrameFill1ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged );
82 connect( mGridFrameFill2ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged );
83 connect( mGridTypeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged );
84 connect( mMapGridUnitComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::intervalUnitChanged );
85 connect( mGridBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged );
86 connect( mCheckGridLeftSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled );
87 connect( mCheckGridRightSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridRightSide_toggled );
88 connect( mCheckGridTopSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridTopSide_toggled );
89 connect( mCheckGridBottomSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled );
90 connect( mFrameDivisionsLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged );
91 connect( mFrameDivisionsRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged );
92 connect( mFrameDivisionsTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged );
93 connect( mFrameDivisionsBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged );
94 connect( mDrawAnnotationGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled );
95 connect( mAnnotationFormatButton, &QToolButton::clicked,
this, &QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked );
96 connect( mAnnotationDisplayLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged );
97 connect( mAnnotationDisplayRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged );
98 connect( mAnnotationDisplayTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged );
99 connect( mAnnotationDisplayBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged );
100 connect( mAnnotationPositionLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged );
101 connect( mAnnotationPositionRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged );
102 connect( mAnnotationPositionTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged );
103 connect( mAnnotationPositionBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged );
104 connect( mAnnotationDirectionComboBoxLeft,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged );
105 connect( mAnnotationDirectionComboBoxRight,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged );
106 connect( mAnnotationDirectionComboBoxTop,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged );
107 connect( mAnnotationDirectionComboBoxBottom,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged );
108 connect( mAnnotationFormatComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged );
109 connect( mCoordinatePrecisionSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged );
110 connect( mDistanceToMapFrameSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged );
111 connect( mMinWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::minIntervalChanged );
112 connect( mMaxWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::maxIntervalChanged );
113 connect( mEnabledCheckBox, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::gridEnabledToggled );
117 mMapGridCrsSelector->setNotSetText( tr(
"Use Map CRS" ) );
121 blockAllSignals(
true );
133 insertFrameDisplayEntries( mFrameDivisionsLeftComboBox );
134 insertFrameDisplayEntries( mFrameDivisionsRightComboBox );
135 insertFrameDisplayEntries( mFrameDivisionsTopComboBox );
136 insertFrameDisplayEntries( mFrameDivisionsBottomComboBox );
138 insertAnnotationDisplayEntries( mAnnotationDisplayLeftComboBox );
139 insertAnnotationDisplayEntries( mAnnotationDisplayRightComboBox );
140 insertAnnotationDisplayEntries( mAnnotationDisplayTopComboBox );
141 insertAnnotationDisplayEntries( mAnnotationDisplayBottomComboBox );
143 insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
144 insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
145 insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
146 insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );
148 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
149 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
150 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
151 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );
153 mGridFramePenColorButton->setColorDialogTitle( tr(
"Select Grid Frame Color" ) );
154 mGridFramePenColorButton->setAllowOpacity(
true );
155 mGridFramePenColorButton->setContext( QStringLiteral(
"composer" ) );
156 mGridFramePenColorButton->setNoColorString( tr(
"Transparent Frame" ) );
157 mGridFramePenColorButton->setShowNoColor(
true );
159 mGridFrameFill1ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
160 mGridFrameFill1ColorButton->setAllowOpacity(
true );
161 mGridFrameFill1ColorButton->setContext( QStringLiteral(
"composer" ) );
162 mGridFrameFill1ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
163 mGridFrameFill1ColorButton->setShowNoColor(
true );
165 mGridFrameFill2ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
166 mGridFrameFill2ColorButton->setAllowOpacity(
true );
167 mGridFrameFill2ColorButton->setContext( QStringLiteral(
"composer" ) );
168 mGridFrameFill2ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
169 mGridFrameFill2ColorButton->setShowNoColor(
true );
175 toggleFrameControls(
false,
false,
false,
false );
201 blockAllSignals(
false );
202 connect( mAnnotationFontButton, &
QgsFontButton::changed,
this, &QgsLayoutMapGridWidget::annotationTextFormatChanged );
206 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
208 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
210 if ( mMap->layout() )
217 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
244 void QgsLayoutMapGridWidget::setGuiElementValues()
251 if ( !mMapGrid || !mMap )
256 blockAllSignals(
true );
259 blockAllSignals(
false );
262 void QgsLayoutMapGridWidget::blockAllSignals(
bool block )
265 mEnabledCheckBox->blockSignals( block );
266 mGridTypeComboBox->blockSignals( block );
267 mIntervalXSpinBox->blockSignals( block );
268 mIntervalYSpinBox->blockSignals( block );
269 mOffsetXSpinBox->blockSignals( block );
270 mOffsetYSpinBox->blockSignals( block );
271 mCrossWidthSpinBox->blockSignals( block );
272 mFrameStyleComboBox->blockSignals( block );
273 mFrameWidthSpinBox->blockSignals( block );
274 mGridFrameMarginSpinBox->blockSignals( block );
275 mGridLineStyleButton->blockSignals( block );
276 mMapGridUnitComboBox->blockSignals( block );
277 mGridFramePenSizeSpinBox->blockSignals( block );
278 mGridFramePenColorButton->blockSignals( block );
279 mGridFrameFill1ColorButton->blockSignals( block );
280 mGridFrameFill2ColorButton->blockSignals( block );
281 mGridBlendComboBox->blockSignals( block );
282 mCheckGridLeftSide->blockSignals( block );
283 mCheckGridRightSide->blockSignals( block );
284 mCheckGridTopSide->blockSignals( block );
285 mCheckGridBottomSide->blockSignals( block );
286 mFrameDivisionsLeftComboBox->blockSignals( block );
287 mFrameDivisionsRightComboBox->blockSignals( block );
288 mFrameDivisionsTopComboBox->blockSignals( block );
289 mFrameDivisionsBottomComboBox->blockSignals( block );
290 mGridMarkerStyleButton->blockSignals( block );
293 mDrawAnnotationGroupBox->blockSignals( block );
294 mAnnotationFormatComboBox->blockSignals( block );
295 mAnnotationDisplayLeftComboBox->blockSignals( block );
296 mAnnotationPositionLeftComboBox->blockSignals( block );
297 mAnnotationDirectionComboBoxLeft->blockSignals( block );
298 mAnnotationDisplayRightComboBox->blockSignals( block );
299 mAnnotationPositionRightComboBox->blockSignals( block );
300 mAnnotationDirectionComboBoxRight->blockSignals( block );
301 mAnnotationDisplayTopComboBox->blockSignals( block );
302 mAnnotationPositionTopComboBox->blockSignals( block );
303 mAnnotationDirectionComboBoxTop->blockSignals( block );
304 mAnnotationDisplayBottomComboBox->blockSignals( block );
305 mAnnotationPositionBottomComboBox->blockSignals( block );
306 mAnnotationDirectionComboBoxBottom->blockSignals( block );
307 mDistanceToMapFrameSpinBox->blockSignals( block );
308 mCoordinatePrecisionSpinBox->blockSignals( block );
309 mAnnotationFontButton->blockSignals( block );
310 mMinWidthSpinBox->blockSignals( block );
311 mMaxWidthSpinBox->blockSignals( block );
316 if ( !mMapGrid || !mMap )
321 mMap->beginCommand( tr(
"Change Frame Divisions" ) );
322 mMapGrid->setFrameDivisions( mode, border );
324 mMap->updateBoundingRect();
329 if ( !mMapGrid || !mMap )
334 mMap->beginCommand( tr(
"Change Annotation Format" ) );
335 mMapGrid->setAnnotationDisplay( mode, border );
336 mMap->updateBoundingRect();
341 void QgsLayoutMapGridWidget::toggleFrameControls(
bool frameEnabled,
bool frameFillEnabled,
bool frameSizeEnabled,
bool rotationEnabled )
344 mFrameWidthSpinBox->setEnabled( frameSizeEnabled );
345 mGridFrameMarginSpinBox->setEnabled( frameEnabled );
346 mGridFramePenSizeSpinBox->setEnabled( frameEnabled );
347 mGridFramePenColorButton->setEnabled( frameEnabled );
348 mGridFrameFill1ColorButton->setEnabled( frameFillEnabled );
349 mGridFrameFill2ColorButton->setEnabled( frameFillEnabled );
350 mFrameWidthLabel->setEnabled( frameSizeEnabled );
351 mFrameMarginLabel->setEnabled( frameEnabled );
352 mFramePenLabel->setEnabled( frameEnabled );
353 mFrameFillLabel->setEnabled( frameFillEnabled );
354 mCheckGridLeftSide->setEnabled( frameEnabled );
355 mCheckGridRightSide->setEnabled( frameEnabled );
356 mCheckGridTopSide->setEnabled( frameEnabled );
357 mCheckGridBottomSide->setEnabled( frameEnabled );
358 mFrameDivisionsLeftComboBox->setEnabled( frameEnabled );
359 mFrameDivisionsRightComboBox->setEnabled( frameEnabled );
360 mFrameDivisionsTopComboBox->setEnabled( frameEnabled );
361 mFrameDivisionsBottomComboBox->setEnabled( frameEnabled );
362 mLeftDivisionsLabel->setEnabled( frameEnabled );
363 mRightDivisionsLabel->setEnabled( frameEnabled );
364 mTopDivisionsLabel->setEnabled( frameEnabled );
365 mBottomDivisionsLabel->setEnabled( frameEnabled );
366 mRotatedTicksGroupBox->setEnabled( rotationEnabled );
369 void QgsLayoutMapGridWidget::insertAnnotationPositionEntries( QComboBox *
c )
375 void QgsLayoutMapGridWidget::insertAnnotationDirectionEntries( QComboBox *
c )
393 c->setCurrentIndex(
c->findData( display ) );
398 if ( !mMapGrid || !mMap )
403 mMap->beginCommand( tr(
"Change Annotation Position" ) );
404 mMapGrid->setAnnotationPosition( position, border );
406 mMap->updateBoundingRect();
413 if ( !mMapGrid || !mMap )
418 mMap->beginCommand( tr(
"Change Annotation Direction" ) );
419 mMapGrid->setAnnotationDirection( direction, border );
420 mMap->updateBoundingRect();
425 void QgsLayoutMapGridWidget::insertFrameDisplayEntries( QComboBox *
c )
432 void QgsLayoutMapGridWidget::insertAnnotationDisplayEntries( QComboBox *
c )
449 c->setCurrentIndex(
c->findText( tr(
"Inside Frame" ) ) );
453 c->setCurrentIndex(
c->findText( tr(
"Outside Frame" ) ) );
463 c->setCurrentIndex(
c->findData( dir ) );
466 bool QgsLayoutMapGridWidget::hasPredefinedScales()
const
471 if ( !hasProjectScales || scales.isEmpty() )
474 QgsSettings settings;
476 QStringList myScalesList = scalesStr.split(
',' );
477 return !myScalesList.isEmpty() && !myScalesList[0].isEmpty();
482 void QgsLayoutMapGridWidget::setGridItems()
489 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
490 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
491 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
493 mEnabledCheckBox->setChecked( mMapGrid->enabled() );
494 mIntervalXSpinBox->setValue( mMapGrid->intervalX() );
495 mIntervalYSpinBox->setValue( mMapGrid->intervalY() );
496 mOffsetXSpinBox->setValue( mMapGrid->offsetX() );
497 mOffsetYSpinBox->setValue( mMapGrid->offsetY() );
498 mCrossWidthSpinBox->setValue( mMapGrid->crossLength() );
499 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
500 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
501 mGridFramePenSizeSpinBox->setValue( mMapGrid->framePenSize() );
502 mGridFramePenColorButton->setColor( mMapGrid->framePenColor() );
503 mGridFrameFill1ColorButton->setColor( mMapGrid->frameFillColor1() );
504 mGridFrameFill2ColorButton->setColor( mMapGrid->frameFillColor2() );
507 mGridTypeComboBox->setCurrentIndex( mGridTypeComboBox->findData( gridStyle ) );
511 mCrossWidthSpinBox->setVisible(
true );
512 mCrossWidthDDBtn->setVisible(
true );
513 mCrossWidthLabel->setVisible(
true );
514 mGridLineStyleButton->setVisible(
true );
515 mLineStyleLabel->setVisible(
true );
516 mGridMarkerStyleButton->setVisible(
false );
517 mMarkerStyleLabel->setVisible(
false );
518 mGridBlendComboBox->setVisible(
true );
519 mGridBlendLabel->setVisible(
true );
522 mCrossWidthSpinBox->setVisible(
false );
523 mCrossWidthDDBtn->setVisible(
false );
524 mCrossWidthLabel->setVisible(
false );
525 mGridLineStyleButton->setVisible(
false );
526 mLineStyleLabel->setVisible(
false );
527 mGridMarkerStyleButton->setVisible(
true );
528 mMarkerStyleLabel->setVisible(
true );
529 mGridBlendComboBox->setVisible(
true );
530 mGridBlendLabel->setVisible(
true );
533 mCrossWidthSpinBox->setVisible(
false );
534 mCrossWidthDDBtn->setVisible(
false );
535 mCrossWidthLabel->setVisible(
false );
536 mGridLineStyleButton->setVisible(
true );
537 mLineStyleLabel->setVisible(
true );
538 mGridMarkerStyleButton->setVisible(
false );
539 mMarkerStyleLabel->setVisible(
false );
540 mGridBlendComboBox->setVisible(
true );
541 mGridBlendLabel->setVisible(
true );
544 mCrossWidthSpinBox->setVisible(
false );
545 mCrossWidthDDBtn->setVisible(
false );
546 mCrossWidthLabel->setVisible(
false );
547 mGridLineStyleButton->setVisible(
false );
548 mLineStyleLabel->setVisible(
false );
549 mGridMarkerStyleButton->setVisible(
false );
550 mMarkerStyleLabel->setVisible(
false );
551 mGridBlendComboBox->setVisible(
false );
552 mGridBlendLabel->setVisible(
false );
557 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
558 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
560 mFrameStyleComboBox->setCurrentIndex( mFrameStyleComboBox->findData( gridFrameStyle ) );
561 switch ( gridFrameStyle )
565 toggleFrameControls(
true,
true,
true,
false );
570 toggleFrameControls(
true,
false,
true,
true );
574 toggleFrameControls(
true,
false,
false,
false );
577 toggleFrameControls(
false,
false,
false,
false );
586 mRotatedTicksGroupBox->setChecked( mMapGrid->rotatedTicksEnabled() );
587 mRotatedTicksLengthModeComboBox->setCurrentIndex( mRotatedTicksLengthModeComboBox->findData( mMapGrid->rotatedTicksLengthMode() ) );
588 mRotatedTicksThresholdSpinBox->setValue( mMapGrid->rotatedTicksMinimumAngle() );
589 mRotatedTicksMarginToCornerSpinBox->setValue( mMapGrid->rotatedTicksMarginToCorner() );
591 mRotatedAnnotationsGroupBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
592 mRotatedAnnotationsLengthModeComboBox->setCurrentIndex( mRotatedAnnotationsLengthModeComboBox->findData( mMapGrid->rotatedAnnotationsLengthMode() ) );
593 mRotatedAnnotationsThresholdSpinBox->setValue( mMapGrid->rotatedAnnotationsMinimumAngle() );
594 mRotatedAnnotationsMarginToCornerSpinBox->setValue( mMapGrid->rotatedAnnotationsMarginToCorner() );
602 mGridLineStyleButton->setSymbol( mMapGrid->lineSymbol()->clone() );
604 mGridMarkerStyleButton->setSymbol( mMapGrid->markerSymbol()->clone() );
606 mGridBlendComboBox->setBlendMode( mMapGrid->blendMode() );
608 mDrawAnnotationGroupBox->setChecked( mMapGrid->annotationEnabled() );
609 mAnnotationDisplayLeftComboBox->setCurrentIndex( mAnnotationDisplayLeftComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Left ) ) );
610 mAnnotationDisplayRightComboBox->setCurrentIndex( mAnnotationDisplayRightComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Right ) ) );
611 mAnnotationDisplayTopComboBox->setCurrentIndex( mAnnotationDisplayTopComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Top ) ) );
612 mAnnotationDisplayBottomComboBox->setCurrentIndex( mAnnotationDisplayBottomComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Bottom ) ) );
614 mAnnotationPositionLeftComboBox->setCurrentIndex( mAnnotationPositionLeftComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Left ) ) );
615 mAnnotationPositionRightComboBox->setCurrentIndex( mAnnotationPositionRightComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Right ) ) );
616 mAnnotationPositionTopComboBox->setCurrentIndex( mAnnotationPositionTopComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Top ) ) );
617 mAnnotationPositionBottomComboBox->setCurrentIndex( mAnnotationPositionBottomComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Bottom ) ) );
621 initAnnotationDirectionBox( mAnnotationDirectionComboBoxTop, mMapGrid->annotationDirection(
QgsLayoutItemMapGrid::Top ) );
624 mAnnotationFontButton->setDialogTitle( tr(
"Grid Annotation Font" ) );
626 mAnnotationFontButton->setTextFormat( mMapGrid->annotationTextFormat() );
628 mAnnotationFormatComboBox->setCurrentIndex( mAnnotationFormatComboBox->findData( mMapGrid->annotationFormat() ) );
630 mDistanceToMapFrameSpinBox->setValue( mMapGrid->annotationFrameDistance() );
631 mCoordinatePrecisionSpinBox->setValue( mMapGrid->annotationPrecision() );
634 mMapGridUnitComboBox->setCurrentIndex( mMapGridUnitComboBox->findData( mMapGrid->units() ) );
635 switch ( mMapGrid->units() )
640 mIntervalStackedWidget->setCurrentIndex( 0 );
644 mIntervalStackedWidget->setCurrentIndex( 1 );
647 mMinWidthSpinBox->setValue( mMapGrid->minimumIntervalWidth() );
648 mMaxWidthSpinBox->setValue( mMapGrid->maximumIntervalWidth() );
650 whileBlocking( mMapGridCrsSelector )->setCrs( mMapGrid->crs() );
653 void QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished()
655 if ( !mMapGrid || !mMap )
660 mMap->beginCommand( tr(
"Change Grid Interval" ) );
661 mMapGrid->setIntervalX( mIntervalXSpinBox->value() );
662 mMap->updateBoundingRect();
667 void QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished()
669 if ( !mMapGrid || !mMap )
674 mMap->beginCommand( tr(
"Change Grid Interval" ) );
675 mMapGrid->setIntervalY( mIntervalYSpinBox->value() );
676 mMap->updateBoundingRect();
681 void QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged(
double value )
683 if ( !mMapGrid || !mMap )
688 mMap->beginCommand( tr(
"Change Grid Offset" ) );
689 mMapGrid->setOffsetX( value );
690 mMap->updateBoundingRect();
695 void QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged(
double value )
697 if ( !mMapGrid || !mMap )
702 mMap->beginCommand( tr(
"Change Grid Offset" ) );
703 mMapGrid->setOffsetY( value );
704 mMap->updateBoundingRect();
709 void QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged(
double val )
711 if ( !mMapGrid || !mMap )
716 mMap->beginCommand( tr(
"Change Cross Width" ) );
717 mMapGrid->setCrossLength( val );
722 void QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged(
double val )
724 if ( !mMapGrid || !mMap )
729 mMap->beginCommand( tr(
"Change Frame Width" ) );
730 mMapGrid->setFrameWidth( val );
731 mMap->updateBoundingRect();
736 void QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged(
double val )
738 if ( !mMapGrid || !mMap )
743 mMap->beginCommand( tr(
"Change Grid Frame Margin" ) );
744 mMapGrid->setFrameMargin( val );
745 mMap->updateBoundingRect();
750 void QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled(
bool checked )
752 if ( !mMapGrid || !mMap )
757 mMap->beginCommand( tr(
"Change Frame Left" ) );
759 mMap->updateBoundingRect();
764 void QgsLayoutMapGridWidget::mCheckGridRightSide_toggled(
bool checked )
766 if ( !mMapGrid || !mMap )
771 mMap->beginCommand( tr(
"Change Frame Right" ) );
773 mMap->updateBoundingRect();
778 void QgsLayoutMapGridWidget::mCheckGridTopSide_toggled(
bool checked )
780 if ( !mMapGrid || !mMap )
785 mMap->beginCommand( tr(
"Change Frame Top" ) );
787 mMap->updateBoundingRect();
792 void QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled(
bool checked )
794 if ( !mMapGrid || !mMap )
799 mMap->beginCommand( tr(
"Change Frame Bottom" ) );
801 mMap->updateBoundingRect();
806 void QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged(
int index )
811 void QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged(
int index )
816 void QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged(
int index )
821 void QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged(
int index )
826 void QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged(
double d )
828 if ( !mMapGrid || !mMap )
833 mMap->beginCommand( tr(
"Change Frame Thickness" ) );
834 mMapGrid->setFramePenSize( d );
835 mMap->updateBoundingRect();
840 void QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged(
const QColor &newColor )
842 if ( !mMapGrid || !mMap )
848 mMapGrid->setFramePenColor( newColor );
853 void QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged(
const QColor &newColor )
855 if ( !mMapGrid || !mMap )
861 mMapGrid->setFrameFillColor1( newColor );
866 void QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged(
const QColor &newColor )
868 if ( !mMapGrid || !mMap )
874 mMapGrid->setFrameFillColor2( newColor );
879 void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged(
int )
881 if ( !mMapGrid || !mMap )
887 mMap->beginCommand( tr(
"Change Frame Style" ) );
888 mMapGrid->setFrameStyle( style );
893 toggleFrameControls(
true,
true,
true,
false );
898 toggleFrameControls(
true,
false,
true,
true );
902 toggleFrameControls(
true,
false,
false,
false );
905 toggleFrameControls(
false,
false,
false,
false );
908 mMap->updateBoundingRect();
913 void QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled(
bool state )
915 if ( !mMapGrid || !mMap )
920 mMap->beginCommand( tr(
"Change Tick Rotation Enabled" ) );
921 mMapGrid->setRotatedTicksEnabled( state );
926 void QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged(
int )
928 if ( !mMapGrid || !mMap )
934 mMap->beginCommand( tr(
"Change Tick Length Mode" ) );
935 mMapGrid->setRotatedTicksLengthMode( mode );
940 void QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged(
double val )
942 if ( !mMapGrid || !mMap )
947 mMap->beginCommand( tr(
"Change Rotated Ticks Threshold" ) );
948 mMapGrid->setRotatedTicksMinimumAngle( val );
953 void QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged(
double val )
955 if ( !mMapGrid || !mMap )
960 mMap->beginCommand( tr(
"Change Rotated Ticks Margin to Corner" ) );
961 mMapGrid->setRotatedTicksMarginToCorner( val );
966 void QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled(
bool state )
968 if ( !mMapGrid || !mMap )
973 mMap->beginCommand( tr(
"Change Annotation Rotation Enabled" ) );
974 mMapGrid->setRotatedAnnotationsEnabled( state );
979 void QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged(
int )
981 if ( !mMapGrid || !mMap )
987 mMap->beginCommand( tr(
"Change Annotation Length Mode" ) );
988 mMapGrid->setRotatedAnnotationsLengthMode( mode );
993 void QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged(
double val )
995 if ( !mMapGrid || !mMap )
1000 mMap->beginCommand( tr(
"Change Rotated Annotations Threshold" ) );
1001 mMapGrid->setRotatedAnnotationsMinimumAngle( val );
1006 void QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged(
double val )
1008 if ( !mMapGrid || !mMap )
1013 mMap->beginCommand( tr(
"Change Rotated Annotations Margin to Corner" ) );
1014 mMapGrid->setRotatedAnnotationsMarginToCorner( val );
1019 void QgsLayoutMapGridWidget::intervalUnitChanged(
int )
1021 if ( !mMapGrid || !mMap )
1032 mIntervalStackedWidget->setCurrentIndex( 0 );
1036 mIntervalStackedWidget->setCurrentIndex( 1 );
1040 mMap->beginCommand( tr(
"Change Grid Unit" ) );
1041 mMapGrid->setUnits( unit );
1042 mMap->updateBoundingRect();
1047 void QgsLayoutMapGridWidget::minIntervalChanged(
double interval )
1050 mMapGrid->setMinimumIntervalWidth( interval );
1052 mMap->updateBoundingRect();
1056 void QgsLayoutMapGridWidget::maxIntervalChanged(
double interval )
1059 mMapGrid->setMaximumIntervalWidth( interval );
1061 mMap->updateBoundingRect();
1065 void QgsLayoutMapGridWidget::annotationTextFormatChanged()
1067 if ( !mMapGrid || !mMap )
1072 mMap->beginCommand( tr(
"Change Annotation Font" ) );
1073 mMapGrid->setAnnotationTextFormat( mAnnotationFontButton->textFormat() );
1075 mMap->updateBoundingRect();
1079 void QgsLayoutMapGridWidget::onCrsChanged()
1081 mBlockAnnotationFormatUpdates++;
1084 mAnnotationFormatComboBox->clear();
1114 const int prevIndex = mAnnotationFormatComboBox->findData( prevFormat );
1115 if ( prevIndex >= 0 )
1116 mAnnotationFormatComboBox->setCurrentIndex( prevIndex );
1118 mAnnotationFormatComboBox->setCurrentIndex( 0 );
1119 mBlockAnnotationFormatUpdates--;
1122 if ( newFormat != prevFormat )
1124 mAnnotationFormatComboBox_currentIndexChanged( mAnnotationFormatComboBox->currentIndex() );
1128 void QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged(
int index )
1133 mMap->beginCommand( tr(
"Change Grid Blend Mode" ) );
1134 mMapGrid->setBlendMode( mGridBlendComboBox->blendMode() );
1141 void QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged(
int )
1143 if ( !mMapGrid || !mMap )
1148 mMap->beginCommand( tr(
"Change Grid Type" ) );
1153 mCrossWidthSpinBox->setVisible(
true );
1154 mCrossWidthDDBtn->setVisible(
true );
1155 mCrossWidthLabel->setVisible(
true );
1156 mGridLineStyleButton->setVisible(
true );
1157 mLineStyleLabel->setVisible(
true );
1158 mGridMarkerStyleButton->setVisible(
false );
1159 mMarkerStyleLabel->setVisible(
false );
1160 mGridBlendComboBox->setVisible(
true );
1161 mGridBlendLabel->setVisible(
true );
1166 mCrossWidthSpinBox->setVisible(
false );
1167 mCrossWidthDDBtn->setVisible(
false );
1168 mCrossWidthLabel->setVisible(
false );
1169 mGridLineStyleButton->setVisible(
false );
1170 mLineStyleLabel->setVisible(
false );
1171 mGridMarkerStyleButton->setVisible(
true );
1172 mMarkerStyleLabel->setVisible(
true );
1173 mGridBlendComboBox->setVisible(
true );
1174 mGridBlendLabel->setVisible(
true );
1179 mCrossWidthSpinBox->setVisible(
false );
1180 mCrossWidthDDBtn->setVisible(
false );
1181 mCrossWidthLabel->setVisible(
false );
1182 mGridLineStyleButton->setVisible(
true );
1183 mLineStyleLabel->setVisible(
true );
1184 mGridMarkerStyleButton->setVisible(
false );
1185 mMarkerStyleLabel->setVisible(
false );
1186 mGridBlendComboBox->setVisible(
true );
1187 mGridBlendLabel->setVisible(
true );
1192 mCrossWidthSpinBox->setVisible(
false );
1193 mCrossWidthDDBtn->setVisible(
false );
1194 mCrossWidthLabel->setVisible(
false );
1195 mGridLineStyleButton->setVisible(
false );
1196 mLineStyleLabel->setVisible(
false );
1197 mGridMarkerStyleButton->setVisible(
false );
1198 mMarkerStyleLabel->setVisible(
false );
1199 mGridBlendComboBox->setVisible(
false );
1200 mGridBlendLabel->setVisible(
false );
1204 mMap->updateBoundingRect();
1211 if ( !mMapGrid || !mMap )
1216 if ( mMapGrid->crs() ==
crs )
1219 mMap->beginCommand( tr(
"Change Grid CRS" ) );
1220 mMapGrid->setCrs(
crs );
1221 mMap->updateBoundingRect();
1226 void QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled(
bool state )
1228 if ( !mMapGrid || !mMap )
1233 mMap->beginCommand( tr(
"Toggle Annotations" ) );
1234 mMapGrid->setAnnotationEnabled( state );
1235 mMap->updateBoundingRect();
1240 void QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked()
1242 if ( !mMapGrid || !mMap )
1248 expressionContext.
setHighlightedFunctions( QStringList() << QStringLiteral(
"to_dms" ) << QStringLiteral(
"to_dm" ) );
1250 QgsExpressionBuilderDialog exprDlg(
nullptr, mMapGrid->annotationExpression(),
this, QStringLiteral(
"generic" ), expressionContext );
1251 exprDlg.setWindowTitle( tr(
"Expression Based Annotation" ) );
1253 if ( exprDlg.exec() == QDialog::Accepted )
1255 QString expression = exprDlg.expressionText();
1256 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1257 mMapGrid->setAnnotationExpression( expression );
1258 mMap->updateBoundingRect();
1264 void QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged(
int )
1269 void QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged(
int )
1274 void QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged(
int )
1279 void QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged(
int )
1284 void QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged(
int )
1289 void QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged(
int )
1294 void QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged(
int )
1299 void QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged(
int )
1304 void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged(
int index )
1309 void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged(
int index )
1314 void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged(
int index )
1319 void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged(
int index )
1324 void QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged(
double d )
1326 if ( !mMapGrid || !mMap )
1332 mMapGrid->setAnnotationFrameDistance( d );
1333 mMap->updateBoundingRect();
1338 void QgsLayoutMapGridWidget::lineSymbolChanged()
1340 if ( !mMapGrid || !mMap )
1346 mMapGrid->setLineSymbol( mGridLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
1351 void QgsLayoutMapGridWidget::markerSymbolChanged()
1353 if ( !mMapGrid || !mMap )
1359 mMapGrid->setMarkerSymbol( mGridMarkerStyleButton->clonedSymbol<
QgsMarkerSymbol>() );
1364 void QgsLayoutMapGridWidget::gridEnabledToggled(
bool active )
1366 if ( !mMapGrid || !mMap )
1371 mMap->beginCommand( tr(
"Toggle Grid Display" ) );
1372 mMapGrid->setEnabled( active );
1374 mMap->updateBoundingRect();
1378 void QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged(
int index )
1380 if ( !mMapGrid || !mMap )
1384 if ( mBlockAnnotationFormatUpdates )
1387 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1392 mMap->updateBoundingRect();
1397 void QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged(
int value )
1399 if ( !mMapGrid || !mMap )
1403 mMap->beginCommand( tr(
"Change Annotation Precision" ) );
1404 mMapGrid->setAnnotationPrecision( value );
1405 mMap->updateBoundingRect();
static QString defaultProjectScales()
A string with default project scales.
This class represents a coordinate reference system (CRS).
Q_GADGET QgsUnitTypes::DistanceUnit mapUnits
A generic dialog for building expression strings.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setHighlightedFunctions(const QStringList &names)
Sets the list of function names intended to be highlighted to the user.
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
GridStyle
Grid drawing style.
@ Markers
Draw markers at intersections of grid lines.
@ Cross
Draw line crosses at intersections of grid lines.
@ FrameAnnotationsOnly
No grid lines over the map, only draw frame and annotations.
GridUnit
Unit for grid values.
@ CM
Grid units in centimeters.
@ MM
Grid units in millimeters.
@ DynamicPageSizeBased
Dynamically sized, based on a on-page size range.
@ MapUnit
Grid units follow map units.
@ FrameTop
Top side of map.
@ FrameBottom
Bottom side of map.
@ FrameLeft
Left side of map.
@ FrameRight
Right side of map.
AnnotationPosition
Position for grid annotations.
@ InsideMapFrame
Draw annotations inside the map frame.
@ OutsideMapFrame
Draw annotations outside the map frame.
DisplayMode
Display settings for grid annotations and frames.
@ LongitudeOnly
Show longitude/x annotations/divisions only.
@ ShowAll
Show both latitude and longitude annotations/divisions.
@ LatitudeOnly
Show latitude/y annotations/divisions only.
void crsChanged()
Emitted whenever the grid's CRS is changed.
TickLengthMode
Tick length mode (useful for rotated grids)
@ OrthogonalTicks
Align ticks orthogonaly.
@ NormalizedTicks
Constant tick lengths.
AnnotationFormat
Format for displaying grid annotations.
@ DegreeMinuteSecondNoSuffix
Degree/minutes/seconds, use - for S/W coordinates.
@ DegreeMinuteSecondPadded
Degree/minutes/seconds, with minutes using leading zeros where required.
@ DegreeMinuteSecond
Degree/minutes/seconds, use NSEW suffix.
@ DecimalWithSuffix
Decimal degrees, use NSEW suffix.
@ DegreeMinute
Degree/minutes, use NSEW suffix.
@ DegreeMinuteNoSuffix
Degree/minutes, use - for S/W coordinates.
@ Decimal
Decimal degrees, use - for S/W coordinates.
@ DegreeMinutePadded
Degree/minutes, with minutes using leading zeros where required.
@ CustomFormat
Custom expression-based format.
AnnotationDirection
Direction of grid annotations.
@ OnTick
Draw annotations parallel to tick (on the line)
@ Horizontal
Draw annotations horizontally.
@ Vertical
Draw annotations vertically, ascending.
@ BoundaryDirection
Annotations follow the boundary direction.
@ AboveTick
Draw annotations parallel to tick (above the line)
@ UnderTick
Draw annotations parallel to tick (under the line)
@ VerticalDescending
Draw annotations vertically, descending.
FrameStyle
Style for grid frame.
@ Zebra
Black/white pattern.
@ InteriorTicks
Tick markers drawn inside map frame.
@ LineBorder
Simple solid line frame.
@ InteriorExteriorTicks
Tick markers drawn both inside and outside the map frame.
@ LineBorderNautical
Simple solid line frame, with nautical style diagonals on corners.
@ ExteriorTicks
Tick markers drawn outside map frame.
@ NoFrame
Disable grid frame.
@ ZebraNautical
Black/white pattern, with nautical style diagonals on corners.
BorderSide
Border sides for annotations.
Layout graphical items for displaying a map.
@ UndoGridFramePenColor
Map grid frame pen color.
@ UndoMapGridIntervalRange
Grid interval range.
@ UndoMapGridLineSymbol
Grid line symbol.
@ UndoMapGridMarkerSymbol
Grid marker symbol.
@ UndoMapGridFrameFill1Color
Map grid frame fill color 1.
@ UndoMapAnnotationDistance
Map frame annotation distance.
@ UndoMapGridFrameFill2Color
Map grid frame fill color 2.
@ MapGridIntervalX
Map grid interval X.
@ MapGridAnnotationDisplayBottom
Map annotation display bottom.
@ MapGridIntervalY
Map grid interval Y.
@ MapGridFrameSize
Map grid frame size.
@ MapGridFrameDivisionsBottom
Map frame division display bottom.
@ MapGridAnnotationDisplayRight
Map annotation display right.
@ MapGridFrameMargin
Map grid frame margin.
@ MapGridOffsetX
Map grid offset X.
@ MapGridLabelDistance
Map grid label distance.
@ MapGridAnnotationDisplayLeft
Map annotation display left.
@ MapGridFrameDivisionsLeft
Map frame division display left.
@ MapGridEnabled
Map grid enabled.
@ MapGridFrameLineThickness
Map grid frame line thickness.
@ MapGridFrameDivisionsRight
Map frame division display right.
@ MapGridFrameDivisionsTop
Map frame division display top.
@ MapGridCrossSize
Map grid cross size.
@ MapGridOffsetY
Map grid offset Y.
@ MapGridAnnotationDisplayTop
Map annotation display top.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
A line symbol type, for rendering LineString and MultiLineString geometries.
A marker symbol type, for rendering Point and MultiPoint geometries.
QVector< double > mapScales() const
Returns the list of custom project map scales.
static QgsProject * instance()
Returns the QgsProject singleton instance.
const QgsProjectViewSettings * viewSettings() const
Returns the project's view settings, which contains settings and properties relating to how a QgsProj...
@ DistanceDegrees
Degrees, for planar geographic CRS distance measurements.
@ DistanceKilometers
Kilometers.
@ DistanceMiles
Terrestrial miles.
@ DistanceUnknownUnit
Unknown distance unit.
@ DistanceMillimeters
Millimeters.
@ DistanceYards
Imperial yards.
@ DistanceFeet
Imperial feet.
@ DistanceNauticalMiles
Nautical miles.
@ DistanceCentimeters
Centimeters.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
const QgsCoordinateReferenceSystem & crs