QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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"
27 #include "qgslayoutitemmapgrid.h"
28 
36 class 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:
107 
108 
110  virtual void updateGuiElements();
111 
112  protected slots:
114  void populateDataDefinedButtons();
115 
116  private slots:
117 
119  void setGuiElementValues();
120  void lineSymbolChanged();
121  void markerSymbolChanged();
122  void gridEnabledToggled( bool active );
123  void intervalUnitChanged( int index );
124  void minIntervalChanged( double interval );
125  void maxIntervalChanged( double interval );
126  void annotationTextFormatChanged();
127 
128  private:
129  QPointer< QgsLayoutItemMap > mMap;
130  QPointer< QgsLayoutItemMapGrid > mMapGrid;
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 
157 #endif //QGSLAYOUTMAPGRIDWIDGET_H
QgsLayoutItemMapGrid
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
Definition: qgslayoutitemmapgrid.h:141
qgslayoutitemmapgrid.h
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:51
QgsLayoutMapGridWidget
A widget for configuring layout map grid items.
Definition: qgslayoutmapgridwidget.h:37
QgsLayoutItemMapGrid::DisplayMode
DisplayMode
Display settings for grid annotations and frames.
Definition: qgslayoutitemmapgrid.h:173
qgslayoutitemwidget.h
QgsLayoutItemMapGrid::AnnotationDirection
AnnotationDirection
Direction of grid annotations.
Definition: qgslayoutitemmapgrid.h:193
QgsLayoutItemMapGrid::AnnotationPosition
AnnotationPosition
Position for grid annotations.
Definition: qgslayoutitemmapgrid.h:184
QgsLayoutItemMapGrid::BorderSide
BorderSide
Border sides for annotations.
Definition: qgslayoutitemmapgrid.h:223
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:206
QgsLayoutItemBaseWidget
A base class for property widgets for layout items.
Definition: qgslayoutitemwidget.h:123
QgsLayoutItemMap
Layout graphical items for displaying a map.
Definition: qgslayoutitemmap.h:318
c
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
Definition: porting_processing.dox:1