52 mGridFrameMarginSpinBox->setShowClearButton(
true );
53 mGridFrameMarginSpinBox->setClearValue( 0 );
55 mDistanceToMapFrameSpinBox->setShowClearButton(
true );
56 mDistanceToMapFrameSpinBox->setClearValue( 0 );
58 mOffsetXSpinBox->setShowClearButton(
true );
59 mOffsetXSpinBox->setClearValue( 0 );
60 mOffsetYSpinBox->setShowClearButton(
true );
61 mOffsetYSpinBox->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" ) );
118 mMapGridCrsSelector->setDialogTitle( tr(
"Grid CRS" ) );
122 blockAllSignals(
true );
134 insertFrameDisplayEntries( mFrameDivisionsLeftComboBox );
135 insertFrameDisplayEntries( mFrameDivisionsRightComboBox );
136 insertFrameDisplayEntries( mFrameDivisionsTopComboBox );
137 insertFrameDisplayEntries( mFrameDivisionsBottomComboBox );
139 insertAnnotationDisplayEntries( mAnnotationDisplayLeftComboBox );
140 insertAnnotationDisplayEntries( mAnnotationDisplayRightComboBox );
141 insertAnnotationDisplayEntries( mAnnotationDisplayTopComboBox );
142 insertAnnotationDisplayEntries( mAnnotationDisplayBottomComboBox );
144 insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
145 insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
146 insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
147 insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );
149 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
150 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
151 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
152 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );
154 mGridFramePenColorButton->setColorDialogTitle( tr(
"Select Grid Frame Color" ) );
155 mGridFramePenColorButton->setAllowOpacity(
true );
156 mGridFramePenColorButton->setContext( QStringLiteral(
"composer" ) );
157 mGridFramePenColorButton->setNoColorString( tr(
"Transparent Frame" ) );
158 mGridFramePenColorButton->setShowNoColor(
true );
160 mGridFrameFill1ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
161 mGridFrameFill1ColorButton->setAllowOpacity(
true );
162 mGridFrameFill1ColorButton->setContext( QStringLiteral(
"composer" ) );
163 mGridFrameFill1ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
164 mGridFrameFill1ColorButton->setShowNoColor(
true );
166 mGridFrameFill2ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
167 mGridFrameFill2ColorButton->setAllowOpacity(
true );
168 mGridFrameFill2ColorButton->setContext( QStringLiteral(
"composer" ) );
169 mGridFrameFill2ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
170 mGridFrameFill2ColorButton->setShowNoColor(
true );
176 toggleFrameControls(
false,
false,
false,
false );
202 blockAllSignals(
false );
203 connect( mAnnotationFontButton, &
QgsFontButton::changed,
this, &QgsLayoutMapGridWidget::annotationTextFormatChanged );
207 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
209 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
211 if ( mMap->layout() )
218 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
245void QgsLayoutMapGridWidget::setGuiElementValues()
252 if ( !mMapGrid || !mMap )
257 blockAllSignals(
true );
260 blockAllSignals(
false );
263void QgsLayoutMapGridWidget::blockAllSignals(
bool block )
266 mEnabledCheckBox->blockSignals( block );
267 mGridTypeComboBox->blockSignals( block );
268 mIntervalXSpinBox->blockSignals( block );
269 mIntervalYSpinBox->blockSignals( block );
270 mOffsetXSpinBox->blockSignals( block );
271 mOffsetYSpinBox->blockSignals( block );
272 mCrossWidthSpinBox->blockSignals( block );
273 mFrameStyleComboBox->blockSignals( block );
274 mFrameWidthSpinBox->blockSignals( block );
275 mGridFrameMarginSpinBox->blockSignals( block );
276 mGridLineStyleButton->blockSignals( block );
277 mMapGridUnitComboBox->blockSignals( block );
278 mGridFramePenSizeSpinBox->blockSignals( block );
279 mGridFramePenColorButton->blockSignals( block );
280 mGridFrameFill1ColorButton->blockSignals( block );
281 mGridFrameFill2ColorButton->blockSignals( block );
282 mGridBlendComboBox->blockSignals( block );
283 mCheckGridLeftSide->blockSignals( block );
284 mCheckGridRightSide->blockSignals( block );
285 mCheckGridTopSide->blockSignals( block );
286 mCheckGridBottomSide->blockSignals( block );
287 mFrameDivisionsLeftComboBox->blockSignals( block );
288 mFrameDivisionsRightComboBox->blockSignals( block );
289 mFrameDivisionsTopComboBox->blockSignals( block );
290 mFrameDivisionsBottomComboBox->blockSignals( block );
291 mGridMarkerStyleButton->blockSignals( block );
294 mDrawAnnotationGroupBox->blockSignals( block );
295 mAnnotationFormatComboBox->blockSignals( block );
296 mAnnotationDisplayLeftComboBox->blockSignals( block );
297 mAnnotationPositionLeftComboBox->blockSignals( block );
298 mAnnotationDirectionComboBoxLeft->blockSignals( block );
299 mAnnotationDisplayRightComboBox->blockSignals( block );
300 mAnnotationPositionRightComboBox->blockSignals( block );
301 mAnnotationDirectionComboBoxRight->blockSignals( block );
302 mAnnotationDisplayTopComboBox->blockSignals( block );
303 mAnnotationPositionTopComboBox->blockSignals( block );
304 mAnnotationDirectionComboBoxTop->blockSignals( block );
305 mAnnotationDisplayBottomComboBox->blockSignals( block );
306 mAnnotationPositionBottomComboBox->blockSignals( block );
307 mAnnotationDirectionComboBoxBottom->blockSignals( block );
308 mDistanceToMapFrameSpinBox->blockSignals( block );
309 mCoordinatePrecisionSpinBox->blockSignals( block );
310 mAnnotationFontButton->blockSignals( block );
311 mMinWidthSpinBox->blockSignals( block );
312 mMaxWidthSpinBox->blockSignals( block );
317 if ( !mMapGrid || !mMap )
322 mMap->beginCommand( tr(
"Change Frame Divisions" ) );
323 mMapGrid->setFrameDivisions( mode, border );
325 mMap->updateBoundingRect();
330 if ( !mMapGrid || !mMap )
335 mMap->beginCommand( tr(
"Change Annotation Format" ) );
336 mMapGrid->setAnnotationDisplay( mode, border );
337 mMap->updateBoundingRect();
342void QgsLayoutMapGridWidget::toggleFrameControls(
bool frameEnabled,
bool frameFillEnabled,
bool frameSizeEnabled,
bool rotationEnabled )
345 mFrameWidthSpinBox->setEnabled( frameSizeEnabled );
346 mGridFrameMarginSpinBox->setEnabled( frameEnabled );
347 mGridFramePenSizeSpinBox->setEnabled( frameEnabled );
348 mGridFramePenColorButton->setEnabled( frameEnabled );
349 mGridFrameFill1ColorButton->setEnabled( frameFillEnabled );
350 mGridFrameFill2ColorButton->setEnabled( frameFillEnabled );
351 mFrameWidthLabel->setEnabled( frameSizeEnabled );
352 mFrameMarginLabel->setEnabled( frameEnabled );
353 mFramePenLabel->setEnabled( frameEnabled );
354 mFrameFillLabel->setEnabled( frameFillEnabled );
355 mCheckGridLeftSide->setEnabled( frameEnabled );
356 mCheckGridRightSide->setEnabled( frameEnabled );
357 mCheckGridTopSide->setEnabled( frameEnabled );
358 mCheckGridBottomSide->setEnabled( frameEnabled );
359 mFrameDivisionsLeftComboBox->setEnabled( frameEnabled );
360 mFrameDivisionsRightComboBox->setEnabled( frameEnabled );
361 mFrameDivisionsTopComboBox->setEnabled( frameEnabled );
362 mFrameDivisionsBottomComboBox->setEnabled( frameEnabled );
363 mLeftDivisionsLabel->setEnabled( frameEnabled );
364 mRightDivisionsLabel->setEnabled( frameEnabled );
365 mTopDivisionsLabel->setEnabled( frameEnabled );
366 mBottomDivisionsLabel->setEnabled( frameEnabled );
367 mRotatedTicksGroupBox->setEnabled( rotationEnabled );
370void QgsLayoutMapGridWidget::insertAnnotationPositionEntries( QComboBox *
c )
376void QgsLayoutMapGridWidget::insertAnnotationDirectionEntries( QComboBox *
c )
394 c->setCurrentIndex(
c->findData( display ) );
399 if ( !mMapGrid || !mMap )
404 mMap->beginCommand( tr(
"Change Annotation Position" ) );
405 mMapGrid->setAnnotationPosition( position, border );
407 mMap->updateBoundingRect();
414 if ( !mMapGrid || !mMap )
419 mMap->beginCommand( tr(
"Change Annotation Direction" ) );
420 mMapGrid->setAnnotationDirection( direction, border );
421 mMap->updateBoundingRect();
426void QgsLayoutMapGridWidget::insertFrameDisplayEntries( QComboBox *
c )
433void QgsLayoutMapGridWidget::insertAnnotationDisplayEntries( QComboBox *
c )
450 c->setCurrentIndex(
c->findText( tr(
"Inside Frame" ) ) );
454 c->setCurrentIndex(
c->findText( tr(
"Outside Frame" ) ) );
464 c->setCurrentIndex(
c->findData( dir ) );
467bool QgsLayoutMapGridWidget::hasPredefinedScales()
const
472 if ( !hasProjectScales || scales.isEmpty() )
476 return !scales.isEmpty() && !scales[0].isEmpty();
481void QgsLayoutMapGridWidget::setGridItems()
488 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
489 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
490 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
492 mEnabledCheckBox->setChecked( mMapGrid->enabled() );
493 mIntervalXSpinBox->setValue( mMapGrid->intervalX() );
494 mIntervalYSpinBox->setValue( mMapGrid->intervalY() );
495 mOffsetXSpinBox->setValue( mMapGrid->offsetX() );
496 mOffsetYSpinBox->setValue( mMapGrid->offsetY() );
497 mCrossWidthSpinBox->setValue( mMapGrid->crossLength() );
498 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
499 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
500 mGridFramePenSizeSpinBox->setValue( mMapGrid->framePenSize() );
501 mGridFramePenColorButton->setColor( mMapGrid->framePenColor() );
502 mGridFrameFill1ColorButton->setColor( mMapGrid->frameFillColor1() );
503 mGridFrameFill2ColorButton->setColor( mMapGrid->frameFillColor2() );
506 mGridTypeComboBox->setCurrentIndex( mGridTypeComboBox->findData( gridStyle ) );
510 mCrossWidthSpinBox->setVisible(
true );
511 mCrossWidthDDBtn->setVisible(
true );
512 mCrossWidthLabel->setVisible(
true );
513 mGridLineStyleButton->setVisible(
true );
514 mLineStyleLabel->setVisible(
true );
515 mGridMarkerStyleButton->setVisible(
false );
516 mMarkerStyleLabel->setVisible(
false );
517 mGridBlendComboBox->setVisible(
true );
518 mGridBlendLabel->setVisible(
true );
521 mCrossWidthSpinBox->setVisible(
false );
522 mCrossWidthDDBtn->setVisible(
false );
523 mCrossWidthLabel->setVisible(
false );
524 mGridLineStyleButton->setVisible(
false );
525 mLineStyleLabel->setVisible(
false );
526 mGridMarkerStyleButton->setVisible(
true );
527 mMarkerStyleFrame->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 mMarkerStyleFrame->setVisible(
false );
540 mMarkerStyleLabel->setVisible(
false );
541 mGridBlendComboBox->setVisible(
true );
542 mGridBlendLabel->setVisible(
true );
545 mCrossWidthSpinBox->setVisible(
false );
546 mCrossWidthDDBtn->setVisible(
false );
547 mCrossWidthLabel->setVisible(
false );
548 mGridLineStyleButton->setVisible(
false );
549 mLineStyleLabel->setVisible(
false );
550 mGridMarkerStyleButton->setVisible(
false );
551 mMarkerStyleFrame->setVisible(
false );
552 mMarkerStyleLabel->setVisible(
false );
553 mGridBlendComboBox->setVisible(
false );
554 mGridBlendLabel->setVisible(
false );
559 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
560 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
562 mFrameStyleComboBox->setCurrentIndex( mFrameStyleComboBox->findData( gridFrameStyle ) );
563 switch ( gridFrameStyle )
567 toggleFrameControls(
true,
true,
true,
false );
572 toggleFrameControls(
true,
false,
true,
true );
576 toggleFrameControls(
true,
false,
false,
false );
579 toggleFrameControls(
false,
false,
false,
false );
588 mRotatedTicksGroupBox->setChecked( mMapGrid->rotatedTicksEnabled() );
589 mRotatedTicksLengthModeComboBox->setCurrentIndex( mRotatedTicksLengthModeComboBox->findData( mMapGrid->rotatedTicksLengthMode() ) );
590 mRotatedTicksThresholdSpinBox->setValue( mMapGrid->rotatedTicksMinimumAngle() );
591 mRotatedTicksMarginToCornerSpinBox->setValue( mMapGrid->rotatedTicksMarginToCorner() );
593 mRotatedAnnotationsGroupBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
594 mRotatedAnnotationsLengthModeComboBox->setCurrentIndex( mRotatedAnnotationsLengthModeComboBox->findData( mMapGrid->rotatedAnnotationsLengthMode() ) );
595 mRotatedAnnotationsThresholdSpinBox->setValue( mMapGrid->rotatedAnnotationsMinimumAngle() );
596 mRotatedAnnotationsMarginToCornerSpinBox->setValue( mMapGrid->rotatedAnnotationsMarginToCorner() );
604 mGridLineStyleButton->setSymbol( mMapGrid->lineSymbol()->clone() );
606 mGridMarkerStyleButton->setSymbol( mMapGrid->markerSymbol()->clone() );
608 mGridBlendComboBox->setBlendMode( mMapGrid->blendMode() );
610 mDrawAnnotationGroupBox->setChecked( mMapGrid->annotationEnabled() );
611 mAnnotationDisplayLeftComboBox->setCurrentIndex( mAnnotationDisplayLeftComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Left ) ) );
612 mAnnotationDisplayRightComboBox->setCurrentIndex( mAnnotationDisplayRightComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Right ) ) );
613 mAnnotationDisplayTopComboBox->setCurrentIndex( mAnnotationDisplayTopComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Top ) ) );
614 mAnnotationDisplayBottomComboBox->setCurrentIndex( mAnnotationDisplayBottomComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Bottom ) ) );
616 mAnnotationPositionLeftComboBox->setCurrentIndex( mAnnotationPositionLeftComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Left ) ) );
617 mAnnotationPositionRightComboBox->setCurrentIndex( mAnnotationPositionRightComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Right ) ) );
618 mAnnotationPositionTopComboBox->setCurrentIndex( mAnnotationPositionTopComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Top ) ) );
619 mAnnotationPositionBottomComboBox->setCurrentIndex( mAnnotationPositionBottomComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Bottom ) ) );
623 initAnnotationDirectionBox( mAnnotationDirectionComboBoxTop, mMapGrid->annotationDirection(
QgsLayoutItemMapGrid::Top ) );
626 mAnnotationFontButton->setDialogTitle( tr(
"Grid Annotation Font" ) );
628 mAnnotationFontButton->setTextFormat( mMapGrid->annotationTextFormat() );
630 mAnnotationFormatComboBox->setCurrentIndex( mAnnotationFormatComboBox->findData( mMapGrid->annotationFormat() ) );
632 mDistanceToMapFrameSpinBox->setValue( mMapGrid->annotationFrameDistance() );
633 mCoordinatePrecisionSpinBox->setValue( mMapGrid->annotationPrecision() );
636 mMapGridUnitComboBox->setCurrentIndex( mMapGridUnitComboBox->findData( mMapGrid->units() ) );
637 switch ( mMapGrid->units() )
642 mIntervalStackedWidget->setCurrentIndex( 0 );
646 mIntervalStackedWidget->setCurrentIndex( 1 );
649 mMinWidthSpinBox->setValue( mMapGrid->minimumIntervalWidth() );
650 mMaxWidthSpinBox->setValue( mMapGrid->maximumIntervalWidth() );
652 whileBlocking( mMapGridCrsSelector )->setCrs( mMapGrid->crs() );
655void QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished()
657 if ( !mMapGrid || !mMap )
662 mMap->beginCommand( tr(
"Change Grid Interval" ) );
663 mMapGrid->setIntervalX( mIntervalXSpinBox->value() );
664 mMap->updateBoundingRect();
669void QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished()
671 if ( !mMapGrid || !mMap )
676 mMap->beginCommand( tr(
"Change Grid Interval" ) );
677 mMapGrid->setIntervalY( mIntervalYSpinBox->value() );
678 mMap->updateBoundingRect();
683void QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged(
double value )
685 if ( !mMapGrid || !mMap )
690 mMap->beginCommand( tr(
"Change Grid Offset" ) );
691 mMapGrid->setOffsetX( value );
692 mMap->updateBoundingRect();
697void QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged(
double value )
699 if ( !mMapGrid || !mMap )
704 mMap->beginCommand( tr(
"Change Grid Offset" ) );
705 mMapGrid->setOffsetY( value );
706 mMap->updateBoundingRect();
711void QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged(
double val )
713 if ( !mMapGrid || !mMap )
718 mMap->beginCommand( tr(
"Change Cross Width" ) );
719 mMapGrid->setCrossLength( val );
724void QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged(
double val )
726 if ( !mMapGrid || !mMap )
731 mMap->beginCommand( tr(
"Change Frame Width" ) );
732 mMapGrid->setFrameWidth( val );
733 mMap->updateBoundingRect();
738void QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged(
double val )
740 if ( !mMapGrid || !mMap )
745 mMap->beginCommand( tr(
"Change Grid Frame Margin" ) );
746 mMapGrid->setFrameMargin( val );
747 mMap->updateBoundingRect();
752void QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled(
bool checked )
754 if ( !mMapGrid || !mMap )
759 mMap->beginCommand( tr(
"Change Frame Left" ) );
761 mMap->updateBoundingRect();
766void QgsLayoutMapGridWidget::mCheckGridRightSide_toggled(
bool checked )
768 if ( !mMapGrid || !mMap )
773 mMap->beginCommand( tr(
"Change Frame Right" ) );
775 mMap->updateBoundingRect();
780void QgsLayoutMapGridWidget::mCheckGridTopSide_toggled(
bool checked )
782 if ( !mMapGrid || !mMap )
787 mMap->beginCommand( tr(
"Change Frame Top" ) );
789 mMap->updateBoundingRect();
794void QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled(
bool checked )
796 if ( !mMapGrid || !mMap )
801 mMap->beginCommand( tr(
"Change Frame Bottom" ) );
803 mMap->updateBoundingRect();
808void QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged(
int index )
813void QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged(
int index )
818void QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged(
int index )
823void QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged(
int index )
828void QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged(
double d )
830 if ( !mMapGrid || !mMap )
835 mMap->beginCommand( tr(
"Change Frame Thickness" ) );
836 mMapGrid->setFramePenSize( d );
837 mMap->updateBoundingRect();
842void QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged(
const QColor &newColor )
844 if ( !mMapGrid || !mMap )
850 mMapGrid->setFramePenColor( newColor );
855void QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged(
const QColor &newColor )
857 if ( !mMapGrid || !mMap )
863 mMapGrid->setFrameFillColor1( newColor );
868void QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged(
const QColor &newColor )
870 if ( !mMapGrid || !mMap )
876 mMapGrid->setFrameFillColor2( newColor );
881void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged(
int )
883 if ( !mMapGrid || !mMap )
889 mMap->beginCommand( tr(
"Change Frame Style" ) );
890 mMapGrid->setFrameStyle( style );
895 toggleFrameControls(
true,
true,
true,
false );
900 toggleFrameControls(
true,
false,
true,
true );
904 toggleFrameControls(
true,
false,
false,
false );
907 toggleFrameControls(
false,
false,
false,
false );
910 mMap->updateBoundingRect();
915void QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled(
bool state )
917 if ( !mMapGrid || !mMap )
922 mMap->beginCommand( tr(
"Change Tick Rotation Enabled" ) );
923 mMapGrid->setRotatedTicksEnabled( state );
928void QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged(
int )
930 if ( !mMapGrid || !mMap )
936 mMap->beginCommand( tr(
"Change Tick Length Mode" ) );
937 mMapGrid->setRotatedTicksLengthMode( mode );
942void QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged(
double val )
944 if ( !mMapGrid || !mMap )
949 mMap->beginCommand( tr(
"Change Rotated Ticks Threshold" ) );
950 mMapGrid->setRotatedTicksMinimumAngle( val );
955void QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged(
double val )
957 if ( !mMapGrid || !mMap )
962 mMap->beginCommand( tr(
"Change Rotated Ticks Margin to Corner" ) );
963 mMapGrid->setRotatedTicksMarginToCorner( val );
968void QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled(
bool state )
970 if ( !mMapGrid || !mMap )
975 mMap->beginCommand( tr(
"Change Annotation Rotation Enabled" ) );
976 mMapGrid->setRotatedAnnotationsEnabled( state );
981void QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged(
int )
983 if ( !mMapGrid || !mMap )
989 mMap->beginCommand( tr(
"Change Annotation Length Mode" ) );
990 mMapGrid->setRotatedAnnotationsLengthMode( mode );
995void QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged(
double val )
997 if ( !mMapGrid || !mMap )
1002 mMap->beginCommand( tr(
"Change Rotated Annotations Threshold" ) );
1003 mMapGrid->setRotatedAnnotationsMinimumAngle( val );
1008void QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged(
double val )
1010 if ( !mMapGrid || !mMap )
1015 mMap->beginCommand( tr(
"Change Rotated Annotations Margin to Corner" ) );
1016 mMapGrid->setRotatedAnnotationsMarginToCorner( val );
1021void QgsLayoutMapGridWidget::intervalUnitChanged(
int )
1023 if ( !mMapGrid || !mMap )
1034 mIntervalStackedWidget->setCurrentIndex( 0 );
1038 mIntervalStackedWidget->setCurrentIndex( 1 );
1042 mMap->beginCommand( tr(
"Change Grid Unit" ) );
1043 mMapGrid->setUnits( unit );
1044 mMap->updateBoundingRect();
1049void QgsLayoutMapGridWidget::minIntervalChanged(
double interval )
1052 mMapGrid->setMinimumIntervalWidth( interval );
1054 mMap->updateBoundingRect();
1058void QgsLayoutMapGridWidget::maxIntervalChanged(
double interval )
1061 mMapGrid->setMaximumIntervalWidth( interval );
1063 mMap->updateBoundingRect();
1067void QgsLayoutMapGridWidget::annotationTextFormatChanged()
1069 if ( !mMapGrid || !mMap )
1074 mMap->beginCommand( tr(
"Change Annotation Font" ) );
1075 mMapGrid->setAnnotationTextFormat( mAnnotationFontButton->textFormat() );
1077 mMap->updateBoundingRect();
1081void QgsLayoutMapGridWidget::onCrsChanged()
1083 mBlockAnnotationFormatUpdates++;
1086 mAnnotationFormatComboBox->clear();
1117 const int prevIndex = mAnnotationFormatComboBox->findData( prevFormat );
1118 if ( prevIndex >= 0 )
1119 mAnnotationFormatComboBox->setCurrentIndex( prevIndex );
1121 mAnnotationFormatComboBox->setCurrentIndex( 0 );
1122 mBlockAnnotationFormatUpdates--;
1125 if ( newFormat != prevFormat )
1127 mAnnotationFormatComboBox_currentIndexChanged( mAnnotationFormatComboBox->currentIndex() );
1131void QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged(
int index )
1136 mMap->beginCommand( tr(
"Change Grid Blend Mode" ) );
1137 mMapGrid->setBlendMode( mGridBlendComboBox->blendMode() );
1144void QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged(
int )
1146 if ( !mMapGrid || !mMap )
1151 mMap->beginCommand( tr(
"Change Grid Type" ) );
1156 mCrossWidthSpinBox->setVisible(
true );
1157 mCrossWidthDDBtn->setVisible(
true );
1158 mCrossWidthLabel->setVisible(
true );
1159 mGridLineStyleButton->setVisible(
true );
1160 mLineStyleLabel->setVisible(
true );
1161 mGridMarkerStyleButton->setVisible(
false );
1162 mMarkerStyleFrame->setVisible(
false );
1163 mMarkerStyleFrame->setVisible(
false );
1164 mMarkerStyleLabel->setVisible(
false );
1165 mGridBlendComboBox->setVisible(
true );
1166 mGridBlendLabel->setVisible(
true );
1171 mCrossWidthSpinBox->setVisible(
false );
1172 mCrossWidthDDBtn->setVisible(
false );
1173 mCrossWidthLabel->setVisible(
false );
1174 mGridLineStyleButton->setVisible(
false );
1175 mLineStyleLabel->setVisible(
false );
1176 mGridMarkerStyleButton->setVisible(
true );
1177 mMarkerStyleFrame->setVisible(
true );
1178 mMarkerStyleLabel->setVisible(
true );
1179 mGridBlendComboBox->setVisible(
true );
1180 mGridBlendLabel->setVisible(
true );
1185 mCrossWidthSpinBox->setVisible(
false );
1186 mCrossWidthDDBtn->setVisible(
false );
1187 mCrossWidthLabel->setVisible(
false );
1188 mGridLineStyleButton->setVisible(
true );
1189 mLineStyleLabel->setVisible(
true );
1190 mGridMarkerStyleButton->setVisible(
false );
1191 mMarkerStyleFrame->setVisible(
false );
1192 mMarkerStyleLabel->setVisible(
false );
1193 mGridBlendComboBox->setVisible(
true );
1194 mGridBlendLabel->setVisible(
true );
1199 mCrossWidthSpinBox->setVisible(
false );
1200 mCrossWidthDDBtn->setVisible(
false );
1201 mCrossWidthLabel->setVisible(
false );
1202 mGridLineStyleButton->setVisible(
false );
1203 mLineStyleLabel->setVisible(
false );
1204 mGridMarkerStyleButton->setVisible(
false );
1205 mMarkerStyleFrame->setVisible(
false );
1206 mMarkerStyleLabel->setVisible(
false );
1207 mGridBlendComboBox->setVisible(
false );
1208 mGridBlendLabel->setVisible(
false );
1212 mMap->updateBoundingRect();
1219 if ( !mMapGrid || !mMap )
1224 if ( mMapGrid->crs() ==
crs )
1227 mMap->beginCommand( tr(
"Change Grid CRS" ) );
1228 mMapGrid->setCrs(
crs );
1229 mMap->updateBoundingRect();
1234void QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled(
bool state )
1236 if ( !mMapGrid || !mMap )
1241 mMap->beginCommand( tr(
"Toggle Annotations" ) );
1242 mMapGrid->setAnnotationEnabled( state );
1243 mMap->updateBoundingRect();
1248void QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked()
1250 if ( !mMapGrid || !mMap )
1256 expressionContext.
setHighlightedFunctions( QStringList() << QStringLiteral(
"to_dms" ) << QStringLiteral(
"to_dm" ) );
1259 exprDlg.setWindowTitle( tr(
"Expression Based Annotation" ) );
1261 if ( exprDlg.exec() == QDialog::Accepted )
1263 const QString expression = exprDlg.expressionText();
1264 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1265 mMapGrid->setAnnotationExpression( expression );
1266 mMap->updateBoundingRect();
1272void QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged(
int )
1277void QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged(
int )
1282void QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged(
int )
1287void QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged(
int )
1292void QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged(
int )
1297void QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged(
int )
1302void QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged(
int )
1307void QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged(
int )
1312void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged(
int index )
1317void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged(
int index )
1322void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged(
int index )
1327void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged(
int index )
1332void QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged(
double d )
1334 if ( !mMapGrid || !mMap )
1340 mMapGrid->setAnnotationFrameDistance( d );
1341 mMap->updateBoundingRect();
1346void QgsLayoutMapGridWidget::lineSymbolChanged()
1348 if ( !mMapGrid || !mMap )
1354 mMapGrid->setLineSymbol( mGridLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
1359void QgsLayoutMapGridWidget::markerSymbolChanged()
1361 if ( !mMapGrid || !mMap )
1367 mMapGrid->setMarkerSymbol( mGridMarkerStyleButton->clonedSymbol<
QgsMarkerSymbol>() );
1372void QgsLayoutMapGridWidget::gridEnabledToggled(
bool active )
1374 if ( !mMapGrid || !mMap )
1379 mMap->beginCommand( tr(
"Toggle Grid Display" ) );
1380 mMapGrid->setEnabled( active );
1382 mMap->updateBoundingRect();
1386void QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged(
int index )
1388 if ( !mMapGrid || !mMap )
1392 if ( mBlockAnnotationFormatUpdates )
1395 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1400 mMap->updateBoundingRect();
1405void QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged(
int value )
1407 if ( !mMapGrid || !mMap )
1411 mMap->beginCommand( tr(
"Change Annotation Precision" ) );
1412 mMapGrid->setAnnotationPrecision( value );
1413 mMap->updateBoundingRect();
@ Centimeters
Centimeters.
@ Millimeters
Millimeters.
@ Miles
Terrestrial miles.
@ Unknown
Unknown distance unit.
@ Degrees
Degrees, for planar geographic CRS distance measurements.
@ Inches
Inches (since QGIS 3.32)
@ NauticalMiles
Nautical miles.
This class represents a coordinate reference system (CRS).
Qgis::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...
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
static const QgsSettingsEntryStringList * settingsMapScales
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