19#include "moc_qgslayoutmapgridwidget.cpp"
53 mGridFrameMarginSpinBox->setShowClearButton(
true );
54 mGridFrameMarginSpinBox->setClearValue( 0 );
56 mDistanceToMapFrameSpinBox->setShowClearButton(
true );
57 mDistanceToMapFrameSpinBox->setClearValue( 0 );
59 mOffsetXSpinBox->setShowClearButton(
true );
60 mOffsetXSpinBox->setClearValue( 0 );
61 mOffsetYSpinBox->setShowClearButton(
true );
62 mOffsetYSpinBox->setClearValue( 0 );
64 connect( mIntervalXSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished );
65 connect( mIntervalYSpinBox, &QgsDoubleSpinBox::editingFinished,
this, &QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished );
66 connect( mOffsetXSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged );
67 connect( mOffsetYSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged );
68 connect( mCrossWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged );
69 connect( mFrameWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged );
70 connect( mGridFrameMarginSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged );
71 connect( mFrameStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged );
72 connect( mRotatedTicksGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled );
73 connect( mRotatedTicksLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged );
74 connect( mRotatedTicksThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged );
75 connect( mRotatedTicksMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged );
76 connect( mRotatedAnnotationsGroupBox, &QGroupBox::toggled,
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled );
77 connect( mRotatedAnnotationsLengthModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged );
78 connect( mRotatedAnnotationsThresholdSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged );
79 connect( mRotatedAnnotationsMarginToCornerSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged );
80 connect( mGridFramePenSizeSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged );
81 connect( mGridFramePenColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged );
82 connect( mGridFrameFill1ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged );
83 connect( mGridFrameFill2ColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged );
84 connect( mGridTypeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged );
85 connect( mMapGridUnitComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::intervalUnitChanged );
86 connect( mGridBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged );
87 connect( mCheckGridLeftSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled );
88 connect( mCheckGridRightSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridRightSide_toggled );
89 connect( mCheckGridTopSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridTopSide_toggled );
90 connect( mCheckGridBottomSide, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled );
91 connect( mFrameDivisionsLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged );
92 connect( mFrameDivisionsRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged );
93 connect( mFrameDivisionsTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged );
94 connect( mFrameDivisionsBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged );
95 connect( mDrawAnnotationGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled );
96 connect( mAnnotationFormatButton, &QToolButton::clicked,
this, &QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked );
97 connect( mAnnotationDisplayLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged );
98 connect( mAnnotationDisplayRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged );
99 connect( mAnnotationDisplayTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged );
100 connect( mAnnotationDisplayBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged );
101 connect( mAnnotationPositionLeftComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged );
102 connect( mAnnotationPositionRightComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged );
103 connect( mAnnotationPositionTopComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged );
104 connect( mAnnotationPositionBottomComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged );
105 connect( mAnnotationDirectionComboBoxLeft,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged );
106 connect( mAnnotationDirectionComboBoxRight,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged );
107 connect( mAnnotationDirectionComboBoxTop,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged );
108 connect( mAnnotationDirectionComboBoxBottom,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged );
109 connect( mAnnotationFormatComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged );
110 connect( mCoordinatePrecisionSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged );
111 connect( mDistanceToMapFrameSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged );
112 connect( mMinWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::minIntervalChanged );
113 connect( mMaxWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutMapGridWidget::maxIntervalChanged );
114 connect( mEnabledCheckBox, &QCheckBox::toggled,
this, &QgsLayoutMapGridWidget::gridEnabledToggled );
118 mMapGridCrsSelector->setNotSetText( tr(
"Use Map CRS" ) );
119 mMapGridCrsSelector->setDialogTitle( tr(
"Grid CRS" ) );
123 blockAllSignals(
true );
135 insertFrameDisplayEntries( mFrameDivisionsLeftComboBox );
136 insertFrameDisplayEntries( mFrameDivisionsRightComboBox );
137 insertFrameDisplayEntries( mFrameDivisionsTopComboBox );
138 insertFrameDisplayEntries( mFrameDivisionsBottomComboBox );
140 insertAnnotationDisplayEntries( mAnnotationDisplayLeftComboBox );
141 insertAnnotationDisplayEntries( mAnnotationDisplayRightComboBox );
142 insertAnnotationDisplayEntries( mAnnotationDisplayTopComboBox );
143 insertAnnotationDisplayEntries( mAnnotationDisplayBottomComboBox );
145 insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox );
146 insertAnnotationPositionEntries( mAnnotationPositionRightComboBox );
147 insertAnnotationPositionEntries( mAnnotationPositionTopComboBox );
148 insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox );
150 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft );
151 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight );
152 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop );
153 insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom );
155 mGridFramePenColorButton->setColorDialogTitle( tr(
"Select Grid Frame Color" ) );
156 mGridFramePenColorButton->setAllowOpacity(
true );
157 mGridFramePenColorButton->setContext( QStringLiteral(
"composer" ) );
158 mGridFramePenColorButton->setNoColorString( tr(
"Transparent Frame" ) );
159 mGridFramePenColorButton->setShowNoColor(
true );
161 mGridFrameFill1ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
162 mGridFrameFill1ColorButton->setAllowOpacity(
true );
163 mGridFrameFill1ColorButton->setContext( QStringLiteral(
"composer" ) );
164 mGridFrameFill1ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
165 mGridFrameFill1ColorButton->setShowNoColor(
true );
167 mGridFrameFill2ColorButton->setColorDialogTitle( tr(
"Select Grid Frame Fill Color" ) );
168 mGridFrameFill2ColorButton->setAllowOpacity(
true );
169 mGridFrameFill2ColorButton->setContext( QStringLiteral(
"composer" ) );
170 mGridFrameFill2ColorButton->setNoColorString( tr(
"Transparent Fill" ) );
171 mGridFrameFill2ColorButton->setShowNoColor(
true );
177 toggleFrameControls(
false,
false,
false,
false );
203 blockAllSignals(
false );
204 connect( mAnnotationFontButton, &
QgsFontButton::changed,
this, &QgsLayoutMapGridWidget::annotationTextFormatChanged );
208 mGridLineStyleButton->registerExpressionContextGenerator( mMapGrid );
210 mGridMarkerStyleButton->registerExpressionContextGenerator( mMapGrid );
212 if ( mMap->layout() )
219 mAnnotationFontButton->registerExpressionContextGenerator( mMapGrid );
246void QgsLayoutMapGridWidget::setGuiElementValues()
253 if ( !mMapGrid || !mMap )
258 blockAllSignals(
true );
261 blockAllSignals(
false );
264void QgsLayoutMapGridWidget::blockAllSignals(
bool block )
267 mEnabledCheckBox->blockSignals( block );
268 mGridTypeComboBox->blockSignals( block );
269 mIntervalXSpinBox->blockSignals( block );
270 mIntervalYSpinBox->blockSignals( block );
271 mOffsetXSpinBox->blockSignals( block );
272 mOffsetYSpinBox->blockSignals( block );
273 mCrossWidthSpinBox->blockSignals( block );
274 mFrameStyleComboBox->blockSignals( block );
275 mFrameWidthSpinBox->blockSignals( block );
276 mGridFrameMarginSpinBox->blockSignals( block );
277 mGridLineStyleButton->blockSignals( block );
278 mMapGridUnitComboBox->blockSignals( block );
279 mGridFramePenSizeSpinBox->blockSignals( block );
280 mGridFramePenColorButton->blockSignals( block );
281 mGridFrameFill1ColorButton->blockSignals( block );
282 mGridFrameFill2ColorButton->blockSignals( block );
283 mGridBlendComboBox->blockSignals( block );
284 mCheckGridLeftSide->blockSignals( block );
285 mCheckGridRightSide->blockSignals( block );
286 mCheckGridTopSide->blockSignals( block );
287 mCheckGridBottomSide->blockSignals( block );
288 mFrameDivisionsLeftComboBox->blockSignals( block );
289 mFrameDivisionsRightComboBox->blockSignals( block );
290 mFrameDivisionsTopComboBox->blockSignals( block );
291 mFrameDivisionsBottomComboBox->blockSignals( block );
292 mGridMarkerStyleButton->blockSignals( block );
295 mDrawAnnotationGroupBox->blockSignals( block );
296 mAnnotationFormatComboBox->blockSignals( block );
297 mAnnotationDisplayLeftComboBox->blockSignals( block );
298 mAnnotationPositionLeftComboBox->blockSignals( block );
299 mAnnotationDirectionComboBoxLeft->blockSignals( block );
300 mAnnotationDisplayRightComboBox->blockSignals( block );
301 mAnnotationPositionRightComboBox->blockSignals( block );
302 mAnnotationDirectionComboBoxRight->blockSignals( block );
303 mAnnotationDisplayTopComboBox->blockSignals( block );
304 mAnnotationPositionTopComboBox->blockSignals( block );
305 mAnnotationDirectionComboBoxTop->blockSignals( block );
306 mAnnotationDisplayBottomComboBox->blockSignals( block );
307 mAnnotationPositionBottomComboBox->blockSignals( block );
308 mAnnotationDirectionComboBoxBottom->blockSignals( block );
309 mDistanceToMapFrameSpinBox->blockSignals( block );
310 mCoordinatePrecisionSpinBox->blockSignals( block );
311 mAnnotationFontButton->blockSignals( block );
312 mMinWidthSpinBox->blockSignals( block );
313 mMaxWidthSpinBox->blockSignals( block );
318 if ( !mMapGrid || !mMap )
323 mMap->beginCommand( tr(
"Change Frame Divisions" ) );
324 mMapGrid->setFrameDivisions( mode, border );
326 mMap->updateBoundingRect();
331 if ( !mMapGrid || !mMap )
336 mMap->beginCommand( tr(
"Change Annotation Format" ) );
337 mMapGrid->setAnnotationDisplay( mode, border );
338 mMap->updateBoundingRect();
343void QgsLayoutMapGridWidget::toggleFrameControls(
bool frameEnabled,
bool frameFillEnabled,
bool frameSizeEnabled,
bool rotationEnabled )
346 mFrameWidthSpinBox->setEnabled( frameSizeEnabled );
347 mGridFrameMarginSpinBox->setEnabled( frameEnabled );
348 mGridFramePenSizeSpinBox->setEnabled( frameEnabled );
349 mGridFramePenColorButton->setEnabled( frameEnabled );
350 mGridFrameFill1ColorButton->setEnabled( frameFillEnabled );
351 mGridFrameFill2ColorButton->setEnabled( frameFillEnabled );
352 mFrameWidthLabel->setEnabled( frameSizeEnabled );
353 mFrameMarginLabel->setEnabled( frameEnabled );
354 mFramePenLabel->setEnabled( frameEnabled );
355 mFrameFillLabel->setEnabled( frameFillEnabled );
356 mCheckGridLeftSide->setEnabled( frameEnabled );
357 mCheckGridRightSide->setEnabled( frameEnabled );
358 mCheckGridTopSide->setEnabled( frameEnabled );
359 mCheckGridBottomSide->setEnabled( frameEnabled );
360 mFrameDivisionsLeftComboBox->setEnabled( frameEnabled );
361 mFrameDivisionsRightComboBox->setEnabled( frameEnabled );
362 mFrameDivisionsTopComboBox->setEnabled( frameEnabled );
363 mFrameDivisionsBottomComboBox->setEnabled( frameEnabled );
364 mLeftDivisionsLabel->setEnabled( frameEnabled );
365 mRightDivisionsLabel->setEnabled( frameEnabled );
366 mTopDivisionsLabel->setEnabled( frameEnabled );
367 mBottomDivisionsLabel->setEnabled( frameEnabled );
368 mRotatedTicksGroupBox->setEnabled( rotationEnabled );
371void QgsLayoutMapGridWidget::insertAnnotationPositionEntries( QComboBox *
c )
377void QgsLayoutMapGridWidget::insertAnnotationDirectionEntries( QComboBox *
c )
395 c->setCurrentIndex(
c->findData( display ) );
400 if ( !mMapGrid || !mMap )
405 mMap->beginCommand( tr(
"Change Annotation Position" ) );
406 mMapGrid->setAnnotationPosition( position, border );
408 mMap->updateBoundingRect();
415 if ( !mMapGrid || !mMap )
420 mMap->beginCommand( tr(
"Change Annotation Direction" ) );
421 mMapGrid->setAnnotationDirection( direction, border );
422 mMap->updateBoundingRect();
427void QgsLayoutMapGridWidget::insertFrameDisplayEntries( QComboBox *
c )
434void QgsLayoutMapGridWidget::insertAnnotationDisplayEntries( QComboBox *
c )
451 c->setCurrentIndex(
c->findText( tr(
"Inside Frame" ) ) );
455 c->setCurrentIndex(
c->findText( tr(
"Outside Frame" ) ) );
465 c->setCurrentIndex(
c->findData( dir ) );
468bool QgsLayoutMapGridWidget::hasPredefinedScales()
const
473 if ( !hasProjectScales || scales.isEmpty() )
477 return !scales.isEmpty() && !scales[0].isEmpty();
482void 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 mMarkerStyleFrame->setVisible(
true );
529 mMarkerStyleLabel->setVisible(
true );
530 mGridBlendComboBox->setVisible(
true );
531 mGridBlendLabel->setVisible(
true );
534 mCrossWidthSpinBox->setVisible(
false );
535 mCrossWidthDDBtn->setVisible(
false );
536 mCrossWidthLabel->setVisible(
false );
537 mGridLineStyleButton->setVisible(
true );
538 mLineStyleLabel->setVisible(
true );
539 mGridMarkerStyleButton->setVisible(
false );
540 mMarkerStyleFrame->setVisible(
false );
541 mMarkerStyleLabel->setVisible(
false );
542 mGridBlendComboBox->setVisible(
true );
543 mGridBlendLabel->setVisible(
true );
546 mCrossWidthSpinBox->setVisible(
false );
547 mCrossWidthDDBtn->setVisible(
false );
548 mCrossWidthLabel->setVisible(
false );
549 mGridLineStyleButton->setVisible(
false );
550 mLineStyleLabel->setVisible(
false );
551 mGridMarkerStyleButton->setVisible(
false );
552 mMarkerStyleFrame->setVisible(
false );
553 mMarkerStyleLabel->setVisible(
false );
554 mGridBlendComboBox->setVisible(
false );
555 mGridBlendLabel->setVisible(
false );
560 mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
561 mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
563 mFrameStyleComboBox->setCurrentIndex( mFrameStyleComboBox->findData( gridFrameStyle ) );
564 switch ( gridFrameStyle )
568 toggleFrameControls(
true,
true,
true,
false );
573 toggleFrameControls(
true,
false,
true,
true );
577 toggleFrameControls(
true,
false,
false,
false );
580 toggleFrameControls(
false,
false,
false,
false );
589 mRotatedTicksGroupBox->setChecked( mMapGrid->rotatedTicksEnabled() );
590 mRotatedTicksLengthModeComboBox->setCurrentIndex( mRotatedTicksLengthModeComboBox->findData( mMapGrid->rotatedTicksLengthMode() ) );
591 mRotatedTicksThresholdSpinBox->setValue( mMapGrid->rotatedTicksMinimumAngle() );
592 mRotatedTicksMarginToCornerSpinBox->setValue( mMapGrid->rotatedTicksMarginToCorner() );
594 mRotatedAnnotationsGroupBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
595 mRotatedAnnotationsLengthModeComboBox->setCurrentIndex( mRotatedAnnotationsLengthModeComboBox->findData( mMapGrid->rotatedAnnotationsLengthMode() ) );
596 mRotatedAnnotationsThresholdSpinBox->setValue( mMapGrid->rotatedAnnotationsMinimumAngle() );
597 mRotatedAnnotationsMarginToCornerSpinBox->setValue( mMapGrid->rotatedAnnotationsMarginToCorner() );
605 mGridLineStyleButton->setSymbol( mMapGrid->lineSymbol()->clone() );
607 mGridMarkerStyleButton->setSymbol( mMapGrid->markerSymbol()->clone() );
609 mGridBlendComboBox->setBlendMode( mMapGrid->blendMode() );
611 mDrawAnnotationGroupBox->setChecked( mMapGrid->annotationEnabled() );
612 mAnnotationDisplayLeftComboBox->setCurrentIndex( mAnnotationDisplayLeftComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Left ) ) );
613 mAnnotationDisplayRightComboBox->setCurrentIndex( mAnnotationDisplayRightComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Right ) ) );
614 mAnnotationDisplayTopComboBox->setCurrentIndex( mAnnotationDisplayTopComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Top ) ) );
615 mAnnotationDisplayBottomComboBox->setCurrentIndex( mAnnotationDisplayBottomComboBox->findData( mMapGrid->annotationDisplay(
QgsLayoutItemMapGrid::Bottom ) ) );
617 mAnnotationPositionLeftComboBox->setCurrentIndex( mAnnotationPositionLeftComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Left ) ) );
618 mAnnotationPositionRightComboBox->setCurrentIndex( mAnnotationPositionRightComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Right ) ) );
619 mAnnotationPositionTopComboBox->setCurrentIndex( mAnnotationPositionTopComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Top ) ) );
620 mAnnotationPositionBottomComboBox->setCurrentIndex( mAnnotationPositionBottomComboBox->findData( mMapGrid->annotationPosition(
QgsLayoutItemMapGrid::Bottom ) ) );
624 initAnnotationDirectionBox( mAnnotationDirectionComboBoxTop, mMapGrid->annotationDirection(
QgsLayoutItemMapGrid::Top ) );
627 mAnnotationFontButton->setDialogTitle( tr(
"Grid Annotation Font" ) );
629 mAnnotationFontButton->setTextFormat( mMapGrid->annotationTextFormat() );
631 mAnnotationFormatComboBox->setCurrentIndex( mAnnotationFormatComboBox->findData( mMapGrid->annotationFormat() ) );
633 mDistanceToMapFrameSpinBox->setValue( mMapGrid->annotationFrameDistance() );
634 mCoordinatePrecisionSpinBox->setValue( mMapGrid->annotationPrecision() );
637 mMapGridUnitComboBox->setCurrentIndex( mMapGridUnitComboBox->findData( mMapGrid->units() ) );
638 switch ( mMapGrid->units() )
643 mIntervalStackedWidget->setCurrentIndex( 0 );
647 mIntervalStackedWidget->setCurrentIndex( 1 );
650 mMinWidthSpinBox->setValue( mMapGrid->minimumIntervalWidth() );
651 mMaxWidthSpinBox->setValue( mMapGrid->maximumIntervalWidth() );
653 whileBlocking( mMapGridCrsSelector )->setCrs( mMapGrid->crs() );
656void QgsLayoutMapGridWidget::mIntervalXSpinBox_editingFinished()
658 if ( !mMapGrid || !mMap )
663 mMap->beginCommand( tr(
"Change Grid Interval" ) );
664 mMapGrid->setIntervalX( mIntervalXSpinBox->value() );
665 mMap->updateBoundingRect();
670void QgsLayoutMapGridWidget::mIntervalYSpinBox_editingFinished()
672 if ( !mMapGrid || !mMap )
677 mMap->beginCommand( tr(
"Change Grid Interval" ) );
678 mMapGrid->setIntervalY( mIntervalYSpinBox->value() );
679 mMap->updateBoundingRect();
684void QgsLayoutMapGridWidget::mOffsetXSpinBox_valueChanged(
double value )
686 if ( !mMapGrid || !mMap )
691 mMap->beginCommand( tr(
"Change Grid Offset" ) );
692 mMapGrid->setOffsetX( value );
693 mMap->updateBoundingRect();
698void QgsLayoutMapGridWidget::mOffsetYSpinBox_valueChanged(
double value )
700 if ( !mMapGrid || !mMap )
705 mMap->beginCommand( tr(
"Change Grid Offset" ) );
706 mMapGrid->setOffsetY( value );
707 mMap->updateBoundingRect();
712void QgsLayoutMapGridWidget::mCrossWidthSpinBox_valueChanged(
double val )
714 if ( !mMapGrid || !mMap )
719 mMap->beginCommand( tr(
"Change Cross Width" ) );
720 mMapGrid->setCrossLength( val );
725void QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged(
double val )
727 if ( !mMapGrid || !mMap )
732 mMap->beginCommand( tr(
"Change Frame Width" ) );
733 mMapGrid->setFrameWidth( val );
734 mMap->updateBoundingRect();
739void QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged(
double val )
741 if ( !mMapGrid || !mMap )
746 mMap->beginCommand( tr(
"Change Grid Frame Margin" ) );
747 mMapGrid->setFrameMargin( val );
748 mMap->updateBoundingRect();
753void QgsLayoutMapGridWidget::mCheckGridLeftSide_toggled(
bool checked )
755 if ( !mMapGrid || !mMap )
760 mMap->beginCommand( tr(
"Change Frame Left" ) );
762 mMap->updateBoundingRect();
767void QgsLayoutMapGridWidget::mCheckGridRightSide_toggled(
bool checked )
769 if ( !mMapGrid || !mMap )
774 mMap->beginCommand( tr(
"Change Frame Right" ) );
776 mMap->updateBoundingRect();
781void QgsLayoutMapGridWidget::mCheckGridTopSide_toggled(
bool checked )
783 if ( !mMapGrid || !mMap )
788 mMap->beginCommand( tr(
"Change Frame Top" ) );
790 mMap->updateBoundingRect();
795void QgsLayoutMapGridWidget::mCheckGridBottomSide_toggled(
bool checked )
797 if ( !mMapGrid || !mMap )
802 mMap->beginCommand( tr(
"Change Frame Bottom" ) );
804 mMap->updateBoundingRect();
809void QgsLayoutMapGridWidget::mFrameDivisionsLeftComboBox_currentIndexChanged(
int index )
814void QgsLayoutMapGridWidget::mFrameDivisionsRightComboBox_currentIndexChanged(
int index )
819void QgsLayoutMapGridWidget::mFrameDivisionsTopComboBox_currentIndexChanged(
int index )
824void QgsLayoutMapGridWidget::mFrameDivisionsBottomComboBox_currentIndexChanged(
int index )
829void QgsLayoutMapGridWidget::mGridFramePenSizeSpinBox_valueChanged(
double d )
831 if ( !mMapGrid || !mMap )
836 mMap->beginCommand( tr(
"Change Frame Thickness" ) );
837 mMapGrid->setFramePenSize( d );
838 mMap->updateBoundingRect();
843void QgsLayoutMapGridWidget::mGridFramePenColorButton_colorChanged(
const QColor &newColor )
845 if ( !mMapGrid || !mMap )
851 mMapGrid->setFramePenColor( newColor );
856void QgsLayoutMapGridWidget::mGridFrameFill1ColorButton_colorChanged(
const QColor &newColor )
858 if ( !mMapGrid || !mMap )
864 mMapGrid->setFrameFillColor1( newColor );
869void QgsLayoutMapGridWidget::mGridFrameFill2ColorButton_colorChanged(
const QColor &newColor )
871 if ( !mMapGrid || !mMap )
877 mMapGrid->setFrameFillColor2( newColor );
882void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged(
int )
884 if ( !mMapGrid || !mMap )
890 mMap->beginCommand( tr(
"Change Frame Style" ) );
891 mMapGrid->setFrameStyle( style );
896 toggleFrameControls(
true,
true,
true,
false );
901 toggleFrameControls(
true,
false,
true,
true );
905 toggleFrameControls(
true,
false,
false,
false );
908 toggleFrameControls(
false,
false,
false,
false );
911 mMap->updateBoundingRect();
916void QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled(
bool state )
918 if ( !mMapGrid || !mMap )
923 mMap->beginCommand( tr(
"Change Tick Rotation Enabled" ) );
924 mMapGrid->setRotatedTicksEnabled( state );
929void QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged(
int )
931 if ( !mMapGrid || !mMap )
937 mMap->beginCommand( tr(
"Change Tick Length Mode" ) );
938 mMapGrid->setRotatedTicksLengthMode( mode );
943void QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged(
double val )
945 if ( !mMapGrid || !mMap )
950 mMap->beginCommand( tr(
"Change Rotated Ticks Threshold" ) );
951 mMapGrid->setRotatedTicksMinimumAngle( val );
956void QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged(
double val )
958 if ( !mMapGrid || !mMap )
963 mMap->beginCommand( tr(
"Change Rotated Ticks Margin to Corner" ) );
964 mMapGrid->setRotatedTicksMarginToCorner( val );
969void QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled(
bool state )
971 if ( !mMapGrid || !mMap )
976 mMap->beginCommand( tr(
"Change Annotation Rotation Enabled" ) );
977 mMapGrid->setRotatedAnnotationsEnabled( state );
982void QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged(
int )
984 if ( !mMapGrid || !mMap )
990 mMap->beginCommand( tr(
"Change Annotation Length Mode" ) );
991 mMapGrid->setRotatedAnnotationsLengthMode( mode );
996void QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged(
double val )
998 if ( !mMapGrid || !mMap )
1003 mMap->beginCommand( tr(
"Change Rotated Annotations Threshold" ) );
1004 mMapGrid->setRotatedAnnotationsMinimumAngle( val );
1009void QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged(
double val )
1011 if ( !mMapGrid || !mMap )
1016 mMap->beginCommand( tr(
"Change Rotated Annotations Margin to Corner" ) );
1017 mMapGrid->setRotatedAnnotationsMarginToCorner( val );
1022void QgsLayoutMapGridWidget::intervalUnitChanged(
int )
1024 if ( !mMapGrid || !mMap )
1035 mIntervalStackedWidget->setCurrentIndex( 0 );
1039 mIntervalStackedWidget->setCurrentIndex( 1 );
1043 mMap->beginCommand( tr(
"Change Grid Unit" ) );
1044 mMapGrid->setUnits( unit );
1045 mMap->updateBoundingRect();
1050void QgsLayoutMapGridWidget::minIntervalChanged(
double interval )
1053 mMapGrid->setMinimumIntervalWidth( interval );
1055 mMap->updateBoundingRect();
1059void QgsLayoutMapGridWidget::maxIntervalChanged(
double interval )
1062 mMapGrid->setMaximumIntervalWidth( interval );
1064 mMap->updateBoundingRect();
1068void QgsLayoutMapGridWidget::annotationTextFormatChanged()
1070 if ( !mMapGrid || !mMap )
1075 mMap->beginCommand( tr(
"Change Annotation Font" ) );
1076 mMapGrid->setAnnotationTextFormat( mAnnotationFontButton->textFormat() );
1078 mMap->updateBoundingRect();
1082void QgsLayoutMapGridWidget::onCrsChanged()
1084 mBlockAnnotationFormatUpdates++;
1087 mAnnotationFormatComboBox->clear();
1157 const int prevIndex = mAnnotationFormatComboBox->findData( prevFormat );
1158 if ( prevIndex >= 0 )
1159 mAnnotationFormatComboBox->setCurrentIndex( prevIndex );
1161 mAnnotationFormatComboBox->setCurrentIndex( 0 );
1162 mBlockAnnotationFormatUpdates--;
1165 if ( newFormat != prevFormat )
1167 mAnnotationFormatComboBox_currentIndexChanged( mAnnotationFormatComboBox->currentIndex() );
1171void QgsLayoutMapGridWidget::mGridBlendComboBox_currentIndexChanged(
int index )
1176 mMap->beginCommand( tr(
"Change Grid Blend Mode" ) );
1177 mMapGrid->setBlendMode( mGridBlendComboBox->blendMode() );
1184void QgsLayoutMapGridWidget::mGridTypeComboBox_currentIndexChanged(
int )
1186 if ( !mMapGrid || !mMap )
1191 mMap->beginCommand( tr(
"Change Grid Type" ) );
1196 mCrossWidthSpinBox->setVisible(
true );
1197 mCrossWidthDDBtn->setVisible(
true );
1198 mCrossWidthLabel->setVisible(
true );
1199 mGridLineStyleButton->setVisible(
true );
1200 mLineStyleLabel->setVisible(
true );
1201 mGridMarkerStyleButton->setVisible(
false );
1202 mMarkerStyleFrame->setVisible(
false );
1203 mMarkerStyleFrame->setVisible(
false );
1204 mMarkerStyleLabel->setVisible(
false );
1205 mGridBlendComboBox->setVisible(
true );
1206 mGridBlendLabel->setVisible(
true );
1211 mCrossWidthSpinBox->setVisible(
false );
1212 mCrossWidthDDBtn->setVisible(
false );
1213 mCrossWidthLabel->setVisible(
false );
1214 mGridLineStyleButton->setVisible(
false );
1215 mLineStyleLabel->setVisible(
false );
1216 mGridMarkerStyleButton->setVisible(
true );
1217 mMarkerStyleFrame->setVisible(
true );
1218 mMarkerStyleLabel->setVisible(
true );
1219 mGridBlendComboBox->setVisible(
true );
1220 mGridBlendLabel->setVisible(
true );
1225 mCrossWidthSpinBox->setVisible(
false );
1226 mCrossWidthDDBtn->setVisible(
false );
1227 mCrossWidthLabel->setVisible(
false );
1228 mGridLineStyleButton->setVisible(
true );
1229 mLineStyleLabel->setVisible(
true );
1230 mGridMarkerStyleButton->setVisible(
false );
1231 mMarkerStyleFrame->setVisible(
false );
1232 mMarkerStyleLabel->setVisible(
false );
1233 mGridBlendComboBox->setVisible(
true );
1234 mGridBlendLabel->setVisible(
true );
1239 mCrossWidthSpinBox->setVisible(
false );
1240 mCrossWidthDDBtn->setVisible(
false );
1241 mCrossWidthLabel->setVisible(
false );
1242 mGridLineStyleButton->setVisible(
false );
1243 mLineStyleLabel->setVisible(
false );
1244 mGridMarkerStyleButton->setVisible(
false );
1245 mMarkerStyleFrame->setVisible(
false );
1246 mMarkerStyleLabel->setVisible(
false );
1247 mGridBlendComboBox->setVisible(
false );
1248 mGridBlendLabel->setVisible(
false );
1252 mMap->updateBoundingRect();
1259 if ( !mMapGrid || !mMap )
1264 if ( mMapGrid->crs() ==
crs )
1267 mMap->beginCommand( tr(
"Change Grid CRS" ) );
1268 mMapGrid->setCrs(
crs );
1269 mMap->updateBoundingRect();
1274void QgsLayoutMapGridWidget::mDrawAnnotationGroupBox_toggled(
bool state )
1276 if ( !mMapGrid || !mMap )
1281 mMap->beginCommand( tr(
"Toggle Annotations" ) );
1282 mMapGrid->setAnnotationEnabled( state );
1283 mMap->updateBoundingRect();
1288void QgsLayoutMapGridWidget::mAnnotationFormatButton_clicked()
1290 if ( !mMapGrid || !mMap )
1296 expressionContext.
setHighlightedFunctions( QStringList() << QStringLiteral(
"to_dms" ) << QStringLiteral(
"to_dm" ) );
1299 exprDlg.setWindowTitle( tr(
"Expression Based Annotation" ) );
1301 if ( exprDlg.exec() == QDialog::Accepted )
1303 const QString expression = exprDlg.expressionText();
1304 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1305 mMapGrid->setAnnotationExpression( expression );
1306 mMap->updateBoundingRect();
1312void QgsLayoutMapGridWidget::mAnnotationDisplayLeftComboBox_currentIndexChanged(
int )
1317void QgsLayoutMapGridWidget::mAnnotationDisplayRightComboBox_currentIndexChanged(
int )
1322void QgsLayoutMapGridWidget::mAnnotationDisplayTopComboBox_currentIndexChanged(
int )
1327void QgsLayoutMapGridWidget::mAnnotationDisplayBottomComboBox_currentIndexChanged(
int )
1332void QgsLayoutMapGridWidget::mAnnotationPositionLeftComboBox_currentIndexChanged(
int )
1337void QgsLayoutMapGridWidget::mAnnotationPositionRightComboBox_currentIndexChanged(
int )
1342void QgsLayoutMapGridWidget::mAnnotationPositionTopComboBox_currentIndexChanged(
int )
1347void QgsLayoutMapGridWidget::mAnnotationPositionBottomComboBox_currentIndexChanged(
int )
1352void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxLeft_currentIndexChanged(
int index )
1357void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxRight_currentIndexChanged(
int index )
1362void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxTop_currentIndexChanged(
int index )
1367void QgsLayoutMapGridWidget::mAnnotationDirectionComboBoxBottom_currentIndexChanged(
int index )
1372void QgsLayoutMapGridWidget::mDistanceToMapFrameSpinBox_valueChanged(
double d )
1374 if ( !mMapGrid || !mMap )
1380 mMapGrid->setAnnotationFrameDistance( d );
1381 mMap->updateBoundingRect();
1386void QgsLayoutMapGridWidget::lineSymbolChanged()
1388 if ( !mMapGrid || !mMap )
1394 mMapGrid->setLineSymbol( mGridLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
1399void QgsLayoutMapGridWidget::markerSymbolChanged()
1401 if ( !mMapGrid || !mMap )
1407 mMapGrid->setMarkerSymbol( mGridMarkerStyleButton->clonedSymbol<
QgsMarkerSymbol>() );
1412void QgsLayoutMapGridWidget::gridEnabledToggled(
bool active )
1414 if ( !mMapGrid || !mMap )
1419 mMap->beginCommand( tr(
"Toggle Grid Display" ) );
1420 mMapGrid->setEnabled( active );
1422 mMap->updateBoundingRect();
1426void QgsLayoutMapGridWidget::mAnnotationFormatComboBox_currentIndexChanged(
int index )
1428 if ( !mMapGrid || !mMap )
1432 if ( mBlockAnnotationFormatUpdates )
1435 mMap->beginCommand( tr(
"Change Annotation Format" ) );
1440 mMap->updateBoundingRect();
1445void QgsLayoutMapGridWidget::mCoordinatePrecisionSpinBox_valueChanged(
int value )
1447 if ( !mMapGrid || !mMap )
1451 mMap->beginCommand( tr(
"Change Annotation Precision" ) );
1452 mMapGrid->setAnnotationPrecision( value );
1453 mMap->updateBoundingRect();
@ YardsBritishSears1922Truncated
British yards (Sears 1922 truncated)
@ MilesUSSurvey
US Survey miles.
@ LinksBritishSears1922
British links (Sears 1922)
@ YardsBritishBenoit1895A
British yards (Benoit 1895 A)
@ LinksBritishBenoit1895A
British links (Benoit 1895 A)
@ Centimeters
Centimeters.
@ YardsIndian1975
Indian yards (1975)
@ FeetUSSurvey
US Survey feet.
@ Millimeters
Millimeters.
@ FeetBritishSears1922
British feet (Sears 1922)
@ YardsClarkes
Clarke's yards.
@ YardsIndian
Indian yards.
@ FeetBritishBenoit1895B
British feet (Benoit 1895 B)
@ Miles
Terrestrial miles.
@ LinksUSSurvey
US Survey links.
@ ChainsUSSurvey
US Survey chains.
@ FeetClarkes
Clarke's feet.
@ Unknown
Unknown distance unit.
@ FeetBritish1936
British feet (1936)
@ FeetIndian1962
Indian feet (1962)
@ YardsBritishSears1922
British yards (Sears 1922)
@ FeetIndian1937
Indian feet (1937)
@ YardsIndian1937
Indian yards (1937)
@ Degrees
Degrees, for planar geographic CRS distance measurements.
@ ChainsBritishBenoit1895B
British chains (Benoit 1895 B)
@ LinksBritishSears1922Truncated
British links (Sears 1922 truncated)
@ ChainsBritishBenoit1895A
British chains (Benoit 1895 A)
@ YardsBritishBenoit1895B
British yards (Benoit 1895 B)
@ FeetBritish1865
British feet (1865)
@ YardsIndian1962
Indian yards (1962)
@ FeetBritishSears1922Truncated
British feet (Sears 1922 truncated)
@ MetersGermanLegal
German legal meter.
@ LinksBritishBenoit1895B
British links (Benoit 1895 B)
@ ChainsInternational
International chains.
@ LinksInternational
International links.
@ ChainsBritishSears1922Truncated
British chains (Sears 1922 truncated)
@ FeetIndian
Indian (geodetic) feet.
@ NauticalMiles
Nautical miles.
@ ChainsClarkes
Clarke's chains.
@ LinksClarkes
Clarke's links.
@ ChainsBritishSears1922
British chains (Sears 1922)
@ FeetIndian1975
Indian feet (1975)
@ FeetGoldCoast
Gold Coast feet.
@ FeetBritishBenoit1895A
British feet (Benoit 1895 A)
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.
@ MapGridOffsetY
Map grid offset Y.
@ MapGridFrameDivisionsBottom
Map frame division display bottom.
@ MapGridEnabled
Map grid enabled.
@ MapGridIntervalX
Map grid interval X.
@ MapGridFrameDivisionsTop
Map frame division display top.
@ MapGridAnnotationDisplayLeft
Map annotation display left.
@ MapGridFrameMargin
Map grid frame margin.
@ MapGridCrossSize
Map grid cross size.
@ MapGridAnnotationDisplayRight
Map annotation display right.
@ MapGridOffsetX
Map grid offset X.
@ MapGridAnnotationDisplayTop
Map annotation display top.
@ MapGridAnnotationDisplayBottom
Map annotation display bottom.
@ MapGridFrameDivisionsRight
Map frame division display right.
@ MapGridLabelDistance
Map grid label distance.
@ MapGridIntervalY
Map grid interval Y.
@ MapGridFrameSize
Map grid frame size.
@ MapGridFrameLineThickness
Map grid frame line thickness.
@ MapGridFrameDivisionsLeft
Map frame division display left.
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