QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgslayoutmapgridwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutmapgridwidget.h
3 ----------------------
4 begin : October 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSLAYOUTMAPGRIDWIDGET_H
19#define QGSLAYOUTMAPGRIDWIDGET_H
20
21// We don't want to expose this in the public API
22#define SIP_NO_FILE
23
24#include "qgis_gui.h"
25#include "ui_qgslayoutmapgridwidgetbase.h"
26#include "qgslayoutitemwidget.h"
28
36class GUI_EXPORT QgsLayoutMapGridWidget : public QgsLayoutItemBaseWidget, private Ui::QgsLayoutMapGridWidgetBase
37{
38 Q_OBJECT
39
40 public:
43
44 private slots:
45
46 void setGridItems();
47 void mIntervalXSpinBox_editingFinished();
48 void mIntervalYSpinBox_editingFinished();
49 void mOffsetXSpinBox_valueChanged( double value );
50 void mOffsetYSpinBox_valueChanged( double value );
51 void mCrossWidthSpinBox_valueChanged( double val );
52 void mFrameWidthSpinBox_valueChanged( double val );
53 void mRotatedTicksGroupBox_toggled( bool checked );
54 void mRotatedTicksLengthModeComboBox_currentIndexChanged( int );
55 void mRotatedTicksThresholdSpinBox_valueChanged( double val );
56 void mRotatedTicksMarginToCornerSpinBox_valueChanged( double val );
57 void mRotatedAnnotationsGroupBox_toggled( bool checked );
58 void mRotatedAnnotationsLengthModeComboBox_currentIndexChanged( int );
59 void mRotatedAnnotationsThresholdSpinBox_valueChanged( double val );
60 void mRotatedAnnotationsMarginToCornerSpinBox_valueChanged( double val );
61 void mGridFrameMarginSpinBox_valueChanged( double val );
62 void mFrameStyleComboBox_currentIndexChanged( int );
63 void mGridFramePenSizeSpinBox_valueChanged( double d );
64 void mGridFramePenColorButton_colorChanged( const QColor &newColor );
65 void mGridFrameFill1ColorButton_colorChanged( const QColor &newColor );
66 void mGridFrameFill2ColorButton_colorChanged( const QColor &newColor );
67 void mGridTypeComboBox_currentIndexChanged( int );
68 void mapGridCrsChanged( const QgsCoordinateReferenceSystem &crs );
69 void mGridBlendComboBox_currentIndexChanged( int index );
70 void mCheckGridLeftSide_toggled( bool checked );
71 void mCheckGridRightSide_toggled( bool checked );
72 void mCheckGridTopSide_toggled( bool checked );
73 void mCheckGridBottomSide_toggled( bool checked );
74
75 //frame divisions display
76 void mFrameDivisionsLeftComboBox_currentIndexChanged( int index );
77 void mFrameDivisionsRightComboBox_currentIndexChanged( int index );
78 void mFrameDivisionsTopComboBox_currentIndexChanged( int index );
79 void mFrameDivisionsBottomComboBox_currentIndexChanged( int index );
80
81 void mDrawAnnotationGroupBox_toggled( bool state );
82 void mAnnotationFormatButton_clicked();
83
84 //annotation display
85 void mAnnotationDisplayLeftComboBox_currentIndexChanged( int );
86 void mAnnotationDisplayRightComboBox_currentIndexChanged( int );
87 void mAnnotationDisplayTopComboBox_currentIndexChanged( int );
88 void mAnnotationDisplayBottomComboBox_currentIndexChanged( int );
89
90 //annotation position
91 void mAnnotationPositionLeftComboBox_currentIndexChanged( int );
92 void mAnnotationPositionRightComboBox_currentIndexChanged( int );
93 void mAnnotationPositionTopComboBox_currentIndexChanged( int );
94 void mAnnotationPositionBottomComboBox_currentIndexChanged( int );
95
96 //annotation direction
97 void mAnnotationDirectionComboBoxLeft_currentIndexChanged( int index );
98 void mAnnotationDirectionComboBoxRight_currentIndexChanged( int index );
99 void mAnnotationDirectionComboBoxTop_currentIndexChanged( int index );
100 void mAnnotationDirectionComboBoxBottom_currentIndexChanged( int index );
101
102 void mAnnotationFormatComboBox_currentIndexChanged( int index );
103 void mCoordinatePrecisionSpinBox_valueChanged( int value );
104 void mDistanceToMapFrameSpinBox_valueChanged( double d );
105
106 protected:
108 virtual void updateGuiElements();
109
110 protected slots:
112 void populateDataDefinedButtons();
113
114 private slots:
115
117 void setGuiElementValues();
118 void lineSymbolChanged();
119 void markerSymbolChanged();
120 void gridEnabledToggled( bool active );
121 void intervalUnitChanged( int index );
122 void minIntervalChanged( double interval );
123 void maxIntervalChanged( double interval );
124 void annotationTextFormatChanged();
125 void onCrsChanged();
126
127 private:
128 QPointer<QgsLayoutItemMap> mMap;
129 QPointer<QgsLayoutItemMapGrid> mMapGrid;
130 int mBlockAnnotationFormatUpdates = 0;
131
133 void blockAllSignals( bool b );
134
135 void handleChangedFrameDisplay( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::DisplayMode mode );
136 void handleChangedAnnotationDisplay( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::DisplayMode mode );
137 void handleChangedAnnotationPosition( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::AnnotationPosition position );
138 void handleChangedAnnotationDirection( QgsLayoutItemMapGrid::BorderSide border, QgsLayoutItemMapGrid::AnnotationDirection direction );
139
140 void insertFrameDisplayEntries( QComboBox *c );
141 void insertAnnotationDisplayEntries( QComboBox *c );
142 void insertAnnotationPositionEntries( QComboBox *c );
143 void insertAnnotationDirectionEntries( QComboBox *c );
144
145 void initFrameDisplayBox( QComboBox *c, QgsLayoutItemMapGrid::DisplayMode display );
146 void initAnnotationPositionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationPosition pos );
147 void initAnnotationDirectionBox( QComboBox *c, QgsLayoutItemMapGrid::AnnotationDirection dir );
148
150 void toggleFrameControls( bool frameEnabled, bool frameFillEnabled, bool frameSizeEnabled, bool ticksRotationEnabled );
151
153 bool hasPredefinedScales() const;
154};
155
156#endif //QGSLAYOUTMAPGRIDWIDGET_H
This class represents a coordinate reference system (CRS).
A base class for property widgets for layout items.
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
AnnotationPosition
Position for grid annotations.
DisplayMode
Display settings for grid annotations and frames.
AnnotationDirection
Direction of grid annotations.
BorderSide
Border sides for annotations.
Layout graphical items for displaying a map.
A widget for configuring layout map grid items.
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
const QgsCoordinateReferenceSystem & crs