52 mGridFrameMarginSpinBox->setShowClearButton(
true );
53 mGridFrameMarginSpinBox->setClearValue( 0 );
55 mDistanceToMapFrameSpinBox->setShowClearButton(
true );
56 mDistanceToMapFrameSpinBox->setClearValue( 0 );
58 connect( mIntervalXSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished );
59 connect( mIntervalYSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished );
60 connect( mOffsetXSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged );
61 connect( mOffsetYSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged );
62 connect( mCrossWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged );
63 connect( mFrameWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged );
64 connect( mGridFrameMarginSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged );
65 connect( mFrameStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged );
66 connect( mRotatedTicksGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled );
67 connect( mRotatedTicksLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged );
68 connect( mRotatedTicksThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged );
69 connect( mRotatedTicksMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged );
70 connect( mRotatedAnnotationsGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled );
71 connect( mRotatedAnnotationsLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged );
72 connect( mRotatedAnnotationsThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged );
73 connect( mRotatedAnnotationsMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged );
74 connect( mGridFramePenSizeSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged );
75 connect( mGridFramePenColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged );
76 connect( mGridFrameFill1ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged );
77 connect( mGridFrameFill2ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged );
78 connect( mGridTypeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged );
79 connect( mMapGridUnitComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::intervalUnitChanged );
80 connect( mGridBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged );
81 connect( mCheckGridLeftSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled );
82 connect( mCheckGridRightSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridRightSide_toggled );
83 connect( mCheckGridTopSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridTopSide_toggled );
84 connect( mCheckGridBottomSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled );
85 connect( mFrameDivisionsLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged );
86 connect( mFrameDivisionsRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged );
87 connect( mFrameDivisionsTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged );
88 connect( mFrameDivisionsBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged );
89 connect( mDrawAnnotationGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled );
90 connect( mAnnotationFormatButton, &QToolButton::clicked,
this, &QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked );
91 connect( mAnnotationDisplayLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged );
92 connect( mAnnotationDisplayRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged );
93 connect( mAnnotationDisplayTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged );
94 connect( mAnnotationDisplayBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged );
95 connect( mAnnotationPositionLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged );
96 connect( mAnnotationPositionRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged );
97 connect( mAnnotationPositionTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged );
98 connect( mAnnotationPositionBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged );
99 connect( mAnnotationDirectionComboBoxLeft,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged );
100 connect( mAnnotationDirectionComboBoxRight,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged );
101 connect( mAnnotationDirectionComboBoxTop,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged );
102 connect( mAnnotationDirectionComboBoxBottom,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged );
103 connect( mAnnotationFormatComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged );
104 connect( mCoordinatePrecisionSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged );
105 connect( mDistanceToMapFrameSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged );
106 connect( mMinWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::minIntervalChanged );
107 connect( mMaxWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::maxIntervalChanged );
108 connect( mEnabledCheckBox, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::gridEnabledToggled );
112 mMapGridCrsSelector->setNotSetText( tr(
"Use Map CRS" ) );
113 mMapGridCrsSelector->setDialogTitle( tr(
"Grid CRS" ) );
117 blockAllSignals(
true );
129 insertFrameDisplayEntries( mFrameDivisionsLeftComboBox );
130 insertFrameDisplayEntries( mFrameDivisionsRightComboBox );
131 insertFrameDisplayEntries( mFrameDivisionsTopComboBox );
132 insertFrameDisplayEntries( mFrameDivisionsBottomComboBox );
134 insertAnnotationDisplayEntries( mAnnotationDisplayLeftComboBox );
135 insertAnnotationDisplayEntries( mAnnotationDisplayRightComboBox );
136 insertAnnotationDisplayEntries( mAnnotationDisplayTopComboBox );
137 insertAnnotationDisplayEntries( mAnnotationDisplayBottomComboBox );
139 insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
140 insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
141 insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
142 insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );
144 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
145 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
146 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
147 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );
149 mGridFramePenColorButton->setColorDialogTitle( tr(
"Select Grid Frame Color" ) );
150 mGridFramePenColorButton->setAllowOpacity(
true );
151 mGridFramePenColorButton->setContext( QStringLiteral(
"composer" ) );
152 mGridFramePenColorButton->setNoColorString( tr(
"Transparent Frame" ) );
153 mGridFramePenColorButton->setShowNoColor(
true );
155 mGridFrameFill1ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
156 mGridFrameFill1ColorButton->setAllowOpacity(
true );
157 mGridFrameFill1ColorButton->setContext( QStringLiteral(
"composer" ) );
158 mGridFrameFill1ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
159 mGridFrameFill1ColorButton->setShowNoColor(
true );
161 mGridFrameFill2ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
162 mGridFrameFill2ColorButton->setAllowOpacity(
true );
163 mGridFrameFill2ColorButton->setContext( QStringLiteral(
"composer" ) );
164 mGridFrameFill2ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
165 mGridFrameFill2ColorButton->setShowNoColor(
true );
171 toggleFrameControls(
false,
false,
false,
false );
197 blockAllSignals(
false );
198 connect( mAnnotationFontButton, &
QgsFontButton::changed,
this, &QgsLayoutMapGridWidget::annotationTextFormatChanged );
202 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
204 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
206 if ( mMap->layout() )
213 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
240void QgsLayoutMapGridWidget::setGuiElementValues()
247 if ( !mMapGrid || !mMap )
252 blockAllSignals(
true );
255 blockAllSignals(
false );
258void QgsLayoutMapGridWidget::blockAllSignals(
bool block )
261 mEnabledCheckBox->blockSignals( block );
262 mGridTypeComboBox->blockSignals( block );
263 mIntervalXSpinBox->blockSignals( block );
264 mIntervalYSpinBox->blockSignals( block );
265 mOffsetXSpinBox->blockSignals( block );
266 mOffsetYSpinBox->blockSignals( block );
267 mCrossWidthSpinBox->blockSignals( block );
268 mFrameStyleComboBox->blockSignals( block );
269 mFrameWidthSpinBox->blockSignals( block );
270 mGridFrameMarginSpinBox->blockSignals( block );
271 mGridLineStyleButton->blockSignals( block );
272 mMapGridUnitComboBox->blockSignals( block );
273 mGridFramePenSizeSpinBox->blockSignals( block );
274 mGridFramePenColorButton->blockSignals( block );
275 mGridFrameFill1ColorButton->blockSignals( block );
276 mGridFrameFill2ColorButton->blockSignals( block );
277 mGridBlendComboBox->blockSignals( block );
278 mCheckGridLeftSide->blockSignals( block );
279 mCheckGridRightSide->blockSignals( block );
280 mCheckGridTopSide->blockSignals( block );
281 mCheckGridBottomSide->blockSignals( block );
282 mFrameDivisionsLeftComboBox->blockSignals( block );
283 mFrameDivisionsRightComboBox->blockSignals( block );
284 mFrameDivisionsTopComboBox->blockSignals( block );
285 mFrameDivisionsBottomComboBox->blockSignals( block );
286 mGridMarkerStyleButton->blockSignals( block );
289 mDrawAnnotationGroupBox->blockSignals( block );
290 mAnnotationFormatComboBox->blockSignals( block );
291 mAnnotationDisplayLeftComboBox->blockSignals( block );
292 mAnnotationPositionLeftComboBox->blockSignals( block );
293 mAnnotationDirectionComboBoxLeft->blockSignals( block );
294 mAnnotationDisplayRightComboBox->blockSignals( block );
295 mAnnotationPositionRightComboBox->blockSignals( block );
296 mAnnotationDirectionComboBoxRight->blockSignals( block );
297 mAnnotationDisplayTopComboBox->blockSignals( block );
298 mAnnotationPositionTopComboBox->blockSignals( block );
299 mAnnotationDirectionComboBoxTop->blockSignals( block );
300 mAnnotationDisplayBottomComboBox->blockSignals( block );
301 mAnnotationPositionBottomComboBox->blockSignals( block );
302 mAnnotationDirectionComboBoxBottom->blockSignals( block );
303 mDistanceToMapFrameSpinBox->blockSignals( block );
304 mCoordinatePrecisionSpinBox->blockSignals( block );
305 mAnnotationFontButton->blockSignals( block );
306 mMinWidthSpinBox->blockSignals( block );
307 mMaxWidthSpinBox->blockSignals( block );
312 if ( !mMapGrid || !mMap )
317 mMap->beginCommand( tr(
"Change Frame Divisions" ) );
318 mMapGrid->setFrameDivisions( mode, border );
320 mMap->updateBoundingRect();
325 if ( !mMapGrid || !mMap )
330 mMap->beginCommand( tr(
"Change Annotation Format" ) );
331 mMapGrid->setAnnotationDisplay( mode, border );
332 mMap->updateBoundingRect();
337void QgsLayoutMapGridWidget::toggleFrameControls(
bool frameEnabled,
bool frameFillEnabled,
bool frameSizeEnabled,
bool rotationEnabled )
340 mFrameWidthSpinBox->setEnabled( frameSizeEnabled );
341 mGridFrameMarginSpinBox->setEnabled( frameEnabled );
342 mGridFramePenSizeSpinBox->setEnabled( frameEnabled );
343 mGridFramePenColorButton->setEnabled( frameEnabled );
344 mGridFrameFill1ColorButton->setEnabled( frameFillEnabled );
345 mGridFrameFill2ColorButton->setEnabled( frameFillEnabled );
346 mFrameWidthLabel->setEnabled( frameSizeEnabled );
347 mFrameMarginLabel->setEnabled( frameEnabled );
348 mFramePenLabel->setEnabled( frameEnabled );
349 mFrameFillLabel->setEnabled( frameFillEnabled );
350 mCheckGridLeftSide->setEnabled( frameEnabled );
351 mCheckGridRightSide->setEnabled( frameEnabled );
352 mCheckGridTopSide->setEnabled( frameEnabled );
353 mCheckGridBottomSide->setEnabled( frameEnabled );
354 mFrameDivisionsLeftComboBox->setEnabled( frameEnabled );
355 mFrameDivisionsRightComboBox->setEnabled( frameEnabled );
356 mFrameDivisionsTopComboBox->setEnabled( frameEnabled );
357 mFrameDivisionsBottomComboBox->setEnabled( frameEnabled );
358 mLeftDivisionsLabel->setEnabled( frameEnabled );
359 mRightDivisionsLabel->setEnabled( frameEnabled );
360 mTopDivisionsLabel->setEnabled( frameEnabled );
361 mBottomDivisionsLabel->setEnabled( frameEnabled );
362 mRotatedTicksGroupBox->setEnabled( rotationEnabled );
365void QgsLayoutMapGridWidget::insertAnnotationPositionEntries( QComboBox *
c )
371void QgsLayoutMapGridWidget::insertAnnotationDirectionEntries( QComboBox *
c )
389 c->setCurrentIndex(
c->findData( display ) );
394 if ( !mMapGrid || !mMap )
399 mMap->beginCommand( tr(
"Change Annotation Position" ) );
400 mMapGrid->setAnnotationPosition( position, border );
402 mMap->updateBoundingRect();
409 if ( !mMapGrid || !mMap )
414 mMap->beginCommand( tr(
"Change Annotation Direction" ) );
415 mMapGrid->setAnnotationDirection( direction, border );
416 mMap->updateBoundingRect();
421void QgsLayoutMapGridWidget::insertFrameDisplayEntries( QComboBox *
c )
428void QgsLayoutMapGridWidget::insertAnnotationDisplayEntries( QComboBox *
c )
445 c->setCurrentIndex(
c->findText( tr(
"Inside Frame" ) ) );
449 c->setCurrentIndex(
c->findText( tr(
"Outside Frame" ) ) );
459 c->setCurrentIndex(
c->findData( dir ) );
462bool QgsLayoutMapGridWidget::hasPredefinedScales()
const
467 if ( !hasProjectScales || scales.isEmpty() )
471 return !scales.isEmpty() && !scales[0].isEmpty();
476void QgsLayoutMapGridWidget::setGridItems()
483 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
484 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
485 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
487 mEnabledCheckBox->setChecked( mMapGrid->enabled() );
488 mIntervalXSpinBox->setValue( mMapGrid->intervalX() );
489 mIntervalYSpinBox->setValue( mMapGrid->intervalY() );
490 mOffsetXSpinBox->setValue( mMapGrid->offsetX() );
491 mOffsetYSpinBox->setValue( mMapGrid->offsetY() );
492 mCrossWidthSpinBox->setValue( mMapGrid->crossLength() );
493 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
494 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
495 mGridFramePenSizeSpinBox->setValue( mMapGrid->framePenSize() );
496 mGridFramePenColorButton->setColor( mMapGrid->framePenColor() );
497 mGridFrameFill1ColorButton->setColor( mMapGrid->frameFillColor1() );
498 mGridFrameFill2ColorButton->setColor( mMapGrid->frameFillColor2() );
501 mGridTypeComboBox->setCurrentIndex( mGridTypeComboBox->findData( gridStyle ) );
505 mCrossWidthSpinBox->setVisible(
true );
506 mCrossWidthDDBtn->setVisible(
true );
507 mCrossWidthLabel->setVisible(
true );
508 mGridLineStyleButton->setVisible(
true );
509 mLineStyleLabel->setVisible(
true );
510 mGridMarkerStyleButton->setVisible(
false );
511 mMarkerStyleLabel->setVisible(
false );
512 mGridBlendComboBox->setVisible(
true );
513 mGridBlendLabel->setVisible(
true );
516 mCrossWidthSpinBox->setVisible(
false );
517 mCrossWidthDDBtn->setVisible(
false );
518 mCrossWidthLabel->setVisible(
false );
519 mGridLineStyleButton->setVisible(
false );
520 mLineStyleLabel->setVisible(
false );
521 mGridMarkerStyleButton->setVisible(
true );
522 mMarkerStyleFrame->setVisible(
true );
523 mMarkerStyleLabel->setVisible(
true );
524 mGridBlendComboBox->setVisible(
true );
525 mGridBlendLabel->setVisible(
true );
528 mCrossWidthSpinBox->setVisible(
false );
529 mCrossWidthDDBtn->setVisible(
false );
530 mCrossWidthLabel->setVisible(
false );
531 mGridLineStyleButton->setVisible(
true );
532 mLineStyleLabel->setVisible(
true );
533 mGridMarkerStyleButton->setVisible(
false );
534 mMarkerStyleFrame->setVisible(
false );
535 mMarkerStyleLabel->setVisible(
false );
536 mGridBlendComboBox->setVisible(
true );
537 mGridBlendLabel->setVisible(
true );
540 mCrossWidthSpinBox->setVisible(
false );
541 mCrossWidthDDBtn->setVisible(
false );
542 mCrossWidthLabel->setVisible(
false );
543 mGridLineStyleButton->setVisible(
false );
544 mLineStyleLabel->setVisible(
false );
545 mGridMarkerStyleButton->setVisible(
false );
546 mMarkerStyleFrame->setVisible(
false );
547 mMarkerStyleLabel->setVisible(
false );
548 mGridBlendComboBox->setVisible(
false );
549 mGridBlendLabel->setVisible(
false );
554 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
555 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
557 mFrameStyleComboBox->setCurrentIndex( mFrameStyleComboBox->findData( gridFrameStyle ) );
558 switch ( gridFrameStyle )
562 toggleFrameControls(
true,
true,
true,
false );
567 toggleFrameControls(
true,
false,
true,
true );
571 toggleFrameControls(
true,
false,
false,
false );
574 toggleFrameControls(
false,
false,
false,
false );
583 mRotatedTicksGroupBox->setChecked( mMapGrid->rotatedTicksEnabled() );
584 mRotatedTicksLengthModeComboBox->setCurrentIndex( mRotatedTicksLengthModeComboBox->findData( mMapGrid->rotatedTicksLengthMode() ) );
585 mRotatedTicksThresholdSpinBox->setValue( mMapGrid->rotatedTicksMinimumAngle() );
586 mRotatedTicksMarginToCornerSpinBox->setValue( mMapGrid->rotatedTicksMarginToCorner() );
588 mRotatedAnnotationsGroupBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
589 mRotatedAnnotationsLengthModeComboBox->setCurrentIndex( mRotatedAnnotationsLengthModeComboBox->findData( mMapGrid->rotatedAnnotationsLengthMode() ) );
590 mRotatedAnnotationsThresholdSpinBox->setValue( mMapGrid->rotatedAnnotationsMinimumAngle() );
591 mRotatedAnnotationsMarginToCornerSpinBox->setValue( mMapGrid->rotatedAnnotationsMarginToCorner() );
599 mGridLineStyleButton->setSymbol( mMapGrid->lineSymbol()->clone() );
601 mGridMarkerStyleButton->setSymbol( mMapGrid->markerSymbol()->clone() );
603 mGridBlendComboBox->setBlendMode( mMapGrid->blendMode() );
605 mDrawAnnotationGroupBox->setChecked( mMapGrid->annotationEnabled() );
606 mAnnotationDisplayLeftComboBox->setCurrentIndex( mAnnotationDisplayLeftComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Left ) ) );
607 mAnnotationDisplayRightComboBox->setCurrentIndex( mAnnotationDisplayRightComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Right ) ) );
608 mAnnotationDisplayTopComboBox->setCurrentIndex( mAnnotationDisplayTopComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Top ) ) );
609 mAnnotationDisplayBottomComboBox->setCurrentIndex( mAnnotationDisplayBottomComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Bottom ) ) );
611 mAnnotationPositionLeftComboBox->setCurrentIndex( mAnnotationPositionLeftComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Left ) ) );
612 mAnnotationPositionRightComboBox->setCurrentIndex( mAnnotationPositionRightComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Right ) ) );
613 mAnnotationPositionTopComboBox->setCurrentIndex( mAnnotationPositionTopComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Top ) ) );
614 mAnnotationPositionBottomComboBox->setCurrentIndex( mAnnotationPositionBottomComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Bottom ) ) );
618 initAnnotationDirectionBox( mAnnotationDirectionComboBoxTop, mMapGrid->annotationDirection(
QgsLayoutItemMapGrid::Top ) );
621 mAnnotationFontButton->setDialogTitle( tr(
"Grid Annotation Font" ) );
623 mAnnotationFontButton->setTextFormat( mMapGrid->annotationTextFormat() );
625 mAnnotationFormatComboBox->setCurrentIndex( mAnnotationFormatComboBox->findData( mMapGrid->annotationFormat() ) );
627 mDistanceToMapFrameSpinBox->setValue( mMapGrid->annotationFrameDistance() );
628 mCoordinatePrecisionSpinBox->setValue( mMapGrid->annotationPrecision() );
631 mMapGridUnitComboBox->setCurrentIndex( mMapGridUnitComboBox->findData( mMapGrid->units() ) );
632 switch ( mMapGrid->units() )
637 mIntervalStackedWidget->setCurrentIndex( 0 );
641 mIntervalStackedWidget->setCurrentIndex( 1 );
644 mMinWidthSpinBox->setValue( mMapGrid->minimumIntervalWidth() );
645 mMaxWidthSpinBox->setValue( mMapGrid->maximumIntervalWidth() );
647 whileBlocking( mMapGridCrsSelector )->setCrs( mMapGrid->crs() );
650void QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished()
652 if ( !mMapGrid || !mMap )
657 mMap->beginCommand( tr(
"Change Grid Interval" ) );
658 mMapGrid->setIntervalX( mIntervalXSpinBox->value() );
659 mMap->updateBoundingRect();
664void QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished()
666 if ( !mMapGrid || !mMap )
671 mMap->beginCommand( tr(
"Change Grid Interval" ) );
672 mMapGrid->setIntervalY( mIntervalYSpinBox->value() );
673 mMap->updateBoundingRect();
678void QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged(
double value )
680 if ( !mMapGrid || !mMap )
685 mMap->beginCommand( tr(
"Change Grid Offset" ) );
686 mMapGrid->setOffsetX( value );
687 mMap->updateBoundingRect();
692void QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged(
double value )
694 if ( !mMapGrid || !mMap )
699 mMap->beginCommand( tr(
"Change Grid Offset" ) );
700 mMapGrid->setOffsetY( value );
701 mMap->updateBoundingRect();
706void QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged(
double val )
708 if ( !mMapGrid || !mMap )
713 mMap->beginCommand( tr(
"Change Cross Width" ) );
714 mMapGrid->setCrossLength( val );
719void QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged(
double val )
721 if ( !mMapGrid || !mMap )
726 mMap->beginCommand( tr(
"Change Frame Width" ) );
727 mMapGrid->setFrameWidth( val );
728 mMap->updateBoundingRect();
733void QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged(
double val )
735 if ( !mMapGrid || !mMap )
740 mMap->beginCommand( tr(
"Change Grid Frame Margin" ) );
741 mMapGrid->setFrameMargin( val );
742 mMap->updateBoundingRect();
747void QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled(
bool checked )
749 if ( !mMapGrid || !mMap )
754 mMap->beginCommand( tr(
"Change Frame Left" ) );
756 mMap->updateBoundingRect();
761void QgsLayoutMapGridWidget::mCheckGridRightSide_toggled(
bool checked )
763 if ( !mMapGrid || !mMap )
768 mMap->beginCommand( tr(
"Change Frame Right" ) );
770 mMap->updateBoundingRect();
775void QgsLayoutMapGridWidget::mCheckGridTopSide_toggled(
bool checked )
777 if ( !mMapGrid || !mMap )
782 mMap->beginCommand( tr(
"Change Frame Top" ) );
784 mMap->updateBoundingRect();
789void QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled(
bool checked )
791 if ( !mMapGrid || !mMap )
796 mMap->beginCommand( tr(
"Change Frame Bottom" ) );
798 mMap->updateBoundingRect();
803void QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged(
int index )
808void QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged(
int index )
813void QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged(
int index )
818void QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged(
int index )
823void QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged(
double d )
825 if ( !mMapGrid || !mMap )
830 mMap->beginCommand( tr(
"Change Frame Thickness" ) );
831 mMapGrid->setFramePenSize( d );
832 mMap->updateBoundingRect();
837void QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged(
const QColor &newColor )
839 if ( !mMapGrid || !mMap )
845 mMapGrid->setFramePenColor( newColor );
850void QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged(
const QColor &newColor )
852 if ( !mMapGrid || !mMap )
858 mMapGrid->setFrameFillColor1( newColor );
863void QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged(
const QColor &newColor )
865 if ( !mMapGrid || !mMap )
871 mMapGrid->setFrameFillColor2( newColor );
876void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged(
int )
878 if ( !mMapGrid || !mMap )
884 mMap->beginCommand( tr(
"Change Frame Style" ) );
885 mMapGrid->setFrameStyle( style );
890 toggleFrameControls(
true,
true,
true,
false );
895 toggleFrameControls(
true,
false,
true,
true );
899 toggleFrameControls(
true,
false,
false,
false );
902 toggleFrameControls(
false,
false,
false,
false );
905 mMap->updateBoundingRect();
910void QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled(
bool state )
912 if ( !mMapGrid || !mMap )
917 mMap->beginCommand( tr(
"Change Tick Rotation Enabled" ) );
918 mMapGrid->setRotatedTicksEnabled( state );
923void QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged(
int )
925 if ( !mMapGrid || !mMap )
931 mMap->beginCommand( tr(
"Change Tick Length Mode" ) );
932 mMapGrid->setRotatedTicksLengthMode( mode );
937void QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged(
double val )
939 if ( !mMapGrid || !mMap )
944 mMap->beginCommand( tr(
"Change Rotated Ticks Threshold" ) );
945 mMapGrid->setRotatedTicksMinimumAngle( val );
950void QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged(
double val )
952 if ( !mMapGrid || !mMap )
957 mMap->beginCommand( tr(
"Change Rotated Ticks Margin to Corner" ) );
958 mMapGrid->setRotatedTicksMarginToCorner( val );
963void QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled(
bool state )
965 if ( !mMapGrid || !mMap )
970 mMap->beginCommand( tr(
"Change Annotation Rotation Enabled" ) );
971 mMapGrid->setRotatedAnnotationsEnabled( state );
976void QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged(
int )
978 if ( !mMapGrid || !mMap )
984 mMap->beginCommand( tr(
"Change Annotation Length Mode" ) );
985 mMapGrid->setRotatedAnnotationsLengthMode( mode );
990void QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged(
double val )
992 if ( !mMapGrid || !mMap )
997 mMap->beginCommand( tr(
"Change Rotated Annotations Threshold" ) );
998 mMapGrid->setRotatedAnnotationsMinimumAngle( val );
1003void QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged(
double val )
1005 if ( !mMapGrid || !mMap )
1010 mMap->beginCommand( tr(
"Change Rotated Annotations Margin to Corner" ) );
1011 mMapGrid->setRotatedAnnotationsMarginToCorner( val );
1016void QgsLayoutMapGridWidget::intervalUnitChanged(
int )
1018 if ( !mMapGrid || !mMap )
1029 mIntervalStackedWidget->setCurrentIndex( 0 );
1033 mIntervalStackedWidget->setCurrentIndex( 1 );
1037 mMap->beginCommand( tr(
"Change Grid Unit" ) );
1038 mMapGrid->setUnits( unit );
1039 mMap->updateBoundingRect();
1044void QgsLayoutMapGridWidget::minIntervalChanged(
double interval )
1047 mMapGrid->setMinimumIntervalWidth( interval );
1049 mMap->updateBoundingRect();
1053void QgsLayoutMapGridWidget::maxIntervalChanged(
double interval )
1056 mMapGrid->setMaximumIntervalWidth( interval );
1058 mMap->updateBoundingRect();
1062void QgsLayoutMapGridWidget::annotationTextFormatChanged()
1064 if ( !mMapGrid || !mMap )
1069 mMap->beginCommand( tr(
"Change Annotation Font" ) );
1070 mMapGrid->setAnnotationTextFormat( mAnnotationFontButton->textFormat() );
1072 mMap->updateBoundingRect();
1076void QgsLayoutMapGridWidget::onCrsChanged()
1078 mBlockAnnotationFormatUpdates++;
1081 mAnnotationFormatComboBox->clear();
1089 case Qgis::DistanceUnit::Meters:
1090 case Qgis::DistanceUnit::Kilometers:
1091 case Qgis::DistanceUnit::Feet:
1092 case Qgis::DistanceUnit::NauticalMiles:
1093 case Qgis::DistanceUnit::Yards:
1094 case Qgis::DistanceUnit::Miles:
1095 case Qgis::DistanceUnit::Centimeters:
1096 case Qgis::DistanceUnit::Millimeters:
1100 case Qgis::DistanceUnit::Degrees:
1101 case Qgis::DistanceUnit::Unknown:
1112 const int prevIndex = mAnnotationFormatComboBox->findData( prevFormat );
1113 if ( prevIndex >= 0 )
1114 mAnnotationFormatComboBox->setCurrentIndex( prevIndex );
1116 mAnnotationFormatComboBox->setCurrentIndex( 0 );
1117 mBlockAnnotationFormatUpdates--;
1120 if ( newFormat != prevFormat )
1122 mAnnotationFormatComboBox_currentIndexChanged( mAnnotationFormatComboBox->currentIndex() );
1126void QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged(
int index )
1131 mMap->beginCommand( tr(
"Change Grid Blend Mode" ) );
1132 mMapGrid->setBlendMode( mGridBlendComboBox->blendMode() );
1139void QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged(
int )
1141 if ( !mMapGrid || !mMap )
1146 mMap->beginCommand( tr(
"Change Grid Type" ) );
1151 mCrossWidthSpinBox->setVisible(
true );
1152 mCrossWidthDDBtn->setVisible(
true );
1153 mCrossWidthLabel->setVisible(
true );
1154 mGridLineStyleButton->setVisible(
true );
1155 mLineStyleLabel->setVisible(
true );
1156 mGridMarkerStyleButton->setVisible(
false );
1157 mMarkerStyleFrame->setVisible(
false );
1158 mMarkerStyleFrame->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 mMarkerStyleFrame->setVisible(
true );
1173 mMarkerStyleLabel->setVisible(
true );
1174 mGridBlendComboBox->setVisible(
true );
1175 mGridBlendLabel->setVisible(
true );
1180 mCrossWidthSpinBox->setVisible(
false );
1181 mCrossWidthDDBtn->setVisible(
false );
1182 mCrossWidthLabel->setVisible(
false );
1183 mGridLineStyleButton->setVisible(
true );
1184 mLineStyleLabel->setVisible(
true );
1185 mGridMarkerStyleButton->setVisible(
false );
1186 mMarkerStyleFrame->setVisible(
false );
1187 mMarkerStyleLabel->setVisible(
false );
1188 mGridBlendComboBox->setVisible(
true );
1189 mGridBlendLabel->setVisible(
true );
1194 mCrossWidthSpinBox->setVisible(
false );
1195 mCrossWidthDDBtn->setVisible(
false );
1196 mCrossWidthLabel->setVisible(
false );
1197 mGridLineStyleButton->setVisible(
false );
1198 mLineStyleLabel->setVisible(
false );
1199 mGridMarkerStyleButton->setVisible(
false );
1200 mMarkerStyleFrame->setVisible(
false );
1201 mMarkerStyleLabel->setVisible(
false );
1202 mGridBlendComboBox->setVisible(
false );
1203 mGridBlendLabel->setVisible(
false );
1207 mMap->updateBoundingRect();
1214 if ( !mMapGrid || !mMap )
1219 if ( mMapGrid->crs() ==
crs )
1222 mMap->beginCommand( tr(
"Change Grid CRS" ) );
1223 mMapGrid->setCrs(
crs );
1224 mMap->updateBoundingRect();
1229void QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled(
bool state )
1231 if ( !mMapGrid || !mMap )
1236 mMap->beginCommand( tr(
"Toggle Annotations" ) );
1237 mMapGrid->setAnnotationEnabled( state );
1238 mMap->updateBoundingRect();
1243void QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked()
1245 if ( !mMapGrid || !mMap )
1251 expressionContext.
setHighlightedFunctions( QStringList() << QStringLiteral(
"to_dms" ) << QStringLiteral(
"to_dm" ) );
1254 exprDlg.setWindowTitle( tr(
"Expression Based Annotation" ) );
1256 if ( exprDlg.exec() == QDialog::Accepted )
1258 const QString expression = exprDlg.expressionText();
1259 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1260 mMapGrid->setAnnotationExpression( expression );
1261 mMap->updateBoundingRect();
1267void QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged(
int )
1272void QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged(
int )
1277void QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged(
int )
1282void QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged(
int )
1287void QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged(
int )
1292void QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged(
int )
1297void QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged(
int )
1302void QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged(
int )
1307void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged(
int index )
1312void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged(
int index )
1317void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged(
int index )
1322void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged(
int index )
1327void QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged(
double d )
1329 if ( !mMapGrid || !mMap )
1335 mMapGrid->setAnnotationFrameDistance( d );
1336 mMap->updateBoundingRect();
1341void QgsLayoutMapGridWidget::lineSymbolChanged()
1343 if ( !mMapGrid || !mMap )
1349 mMapGrid->setLineSymbol( mGridLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
1354void QgsLayoutMapGridWidget::markerSymbolChanged()
1356 if ( !mMapGrid || !mMap )
1362 mMapGrid->setMarkerSymbol( mGridMarkerStyleButton->clonedSymbol<
QgsMarkerSymbol>() );
1367void QgsLayoutMapGridWidget::gridEnabledToggled(
bool active )
1369 if ( !mMapGrid || !mMap )
1374 mMap->beginCommand( tr(
"Toggle Grid Display" ) );
1375 mMapGrid->setEnabled( active );
1377 mMap->updateBoundingRect();
1381void QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged(
int index )
1383 if ( !mMapGrid || !mMap )
1387 if ( mBlockAnnotationFormatUpdates )
1390 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1395 mMap->updateBoundingRect();
1400void QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged(
int value )
1402 if ( !mMapGrid || !mMap )
1406 mMap->beginCommand( tr(
"Change Annotation Precision" ) );
1407 mMapGrid->setAnnotationPrecision( value );
1408 mMap->updateBoundingRect();
@ Inches
Inches (since QGIS 3.32)
This class represents a coordinate reference system (CRS).
Q_GADGET 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