QGIS API Documentation 3.99.0-Master (7d2ca374f2d)
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
23#include "ui_qgslayoutmapgridwidgetbase.h"
24
25#include "qgis_gui.h"
27#include "qgslayoutitemwidget.h"
28
29#define SIP_NO_FILE
30
38class GUI_EXPORT QgsLayoutMapGridWidget : public QgsLayoutItemBaseWidget, private Ui::QgsLayoutMapGridWidgetBase
39{
40 Q_OBJECT
41
42 public:
45
46 private slots:
47
48 void setGridItems();
49 void mIntervalXSpinBox_editingFinished();
50 void mIntervalYSpinBox_editingFinished();
51 void mOffsetXSpinBox_valueChanged( double value );
52 void mOffsetYSpinBox_valueChanged( double value );
53 void mCrossWidthSpinBox_valueChanged( double val );
54 void mFrameWidthSpinBox_valueChanged( double val );
55 void mRotatedTicksGroupBox_toggled( bool checked );
56 void mRotatedTicksLengthModeComboBox_currentIndexChanged( int );
57 void mRotatedTicksThresholdSpinBox_valueChanged( double val );
58 void mRotatedTicksMarginToCornerSpinBox_valueChanged( double val );
59 void mRotatedAnnotationsGroupBox_toggled( bool checked );
60 void mRotatedAnnotationsLengthModeComboBox_currentIndexChanged( int );
61 void mRotatedAnnotationsThresholdSpinBox_valueChanged( double val );
62 void mRotatedAnnotationsMarginToCornerSpinBox_valueChanged( double val );
63 void mGridFrameMarginSpinBox_valueChanged( double val );
64 void mFrameStyleComboBox_currentIndexChanged( int );
65 void mGridFramePenSizeSpinBox_valueChanged( double d );
66 void mGridFramePenColorButton_colorChanged( const QColor &newColor );
67 void mGridFrameFill1ColorButton_colorChanged( const QColor &newColor );
68 void mGridFrameFill2ColorButton_colorChanged( const QColor &newColor );
69 void mGridTypeComboBox_currentIndexChanged( int );
70 void mapGridCrsChanged( const QgsCoordinateReferenceSystem &crs );
71 void mGridBlendComboBox_currentIndexChanged( int index );
72 void mCheckGridLeftSide_toggled( bool checked );
73 void mCheckGridRightSide_toggled( bool checked );
74 void mCheckGridTopSide_toggled( bool checked );
75 void mCheckGridBottomSide_toggled( bool checked );
76
77 //frame divisions display
78 void mFrameDivisionsLeftComboBox_currentIndexChanged( int index );
79 void mFrameDivisionsRightComboBox_currentIndexChanged( int index );
80 void mFrameDivisionsTopComboBox_currentIndexChanged( int index );
81 void mFrameDivisionsBottomComboBox_currentIndexChanged( int index );
82
83 void mDrawAnnotationGroupBox_toggled( bool state );
84 void mAnnotationFormatButton_clicked();
85
86 //annotation display
87 void mAnnotationDisplayLeftComboBox_currentIndexChanged( int );
88 void mAnnotationDisplayRightComboBox_currentIndexChanged( int );
89 void mAnnotationDisplayTopComboBox_currentIndexChanged( int );
90 void mAnnotationDisplayBottomComboBox_currentIndexChanged( int );
91
92 //annotation position
93 void mAnnotationPositionLeftComboBox_currentIndexChanged( int );
94 void mAnnotationPositionRightComboBox_currentIndexChanged( int );
95 void mAnnotationPositionTopComboBox_currentIndexChanged( int );
96 void mAnnotationPositionBottomComboBox_currentIndexChanged( int );
97
98 //annotation direction
99 void mAnnotationDirectionComboBoxLeft_currentIndexChanged( int index );
100 void mAnnotationDirectionComboBoxRight_currentIndexChanged( int index );
101 void mAnnotationDirectionComboBoxTop_currentIndexChanged( int index );
102 void mAnnotationDirectionComboBoxBottom_currentIndexChanged( int index );
103
104 void mAnnotationFormatComboBox_currentIndexChanged( int index );
105 void mCoordinatePrecisionSpinBox_valueChanged( int value );
106 void mDistanceToMapFrameSpinBox_valueChanged( double d );
107
108 protected:
110 virtual void updateGuiElements();
111
112 protected slots:
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 void onCrsChanged();
128
129 private:
130 QPointer<QgsLayoutItemMap> mMap;
131 QPointer<QgsLayoutItemMapGrid> mMapGrid;
132 int mBlockAnnotationFormatUpdates = 0;
133
135 void blockAllSignals( bool b );
136
137 void handleChangedFrameDisplay( Qgis::MapGridBorderSide border, Qgis::MapGridComponentVisibility mode );
138 void handleChangedAnnotationDisplay( Qgis::MapGridBorderSide border, Qgis::MapGridComponentVisibility mode );
139 void handleChangedAnnotationPosition( Qgis::MapGridBorderSide border, Qgis::MapGridAnnotationPosition position );
140 void handleChangedAnnotationDirection( Qgis::MapGridBorderSide border, Qgis::MapGridAnnotationDirection direction );
141
142 void insertFrameDisplayEntries( QComboBox *c );
143 void insertAnnotationDisplayEntries( QComboBox *c );
144 void insertAnnotationPositionEntries( QComboBox *c );
145 void insertAnnotationDirectionEntries( QComboBox *c );
146
147 void initFrameDisplayBox( QComboBox *c, Qgis::MapGridComponentVisibility display );
148 void initAnnotationPositionBox( QComboBox *c, Qgis::MapGridAnnotationPosition pos );
149 void initAnnotationDirectionBox( QComboBox *c, Qgis::MapGridAnnotationDirection dir );
150
152 void toggleFrameControls( bool frameEnabled, bool frameFillEnabled, bool frameSizeEnabled, bool ticksRotationEnabled );
153
155 bool hasPredefinedScales() const;
156};
157
158#endif //QGSLAYOUTMAPGRIDWIDGET_H
MapGridAnnotationPosition
Position for map grid annotations.
Definition qgis.h:5530
MapGridBorderSide
Border sides for map grid annotations.
Definition qgis.h:5584
MapGridComponentVisibility
Visibility display settings for map grid annotations and frames.
Definition qgis.h:5514
MapGridAnnotationDirection
Direction of grid annotations.
Definition qgis.h:5544
Represents a coordinate reference system (CRS).
QgsLayoutItemBaseWidget(QWidget *parent SIP_TRANSFERTHIS, QgsLayoutObject *layoutObject)
Constructor for QgsLayoutItemBaseWidget, linked with the specified layoutObject.
An individual grid which is drawn above the map content in a QgsLayoutItemMap.
Layout graphical items for displaying a map.
void populateDataDefinedButtons()
Initializes data defined buttons to current atlas coverage layer.
virtual void updateGuiElements()
Sets the current composer map values to the GUI elements.
QgsLayoutMapGridWidget(QgsLayoutItemMapGrid *mapGrid, QgsLayoutItemMap *map)
constructor
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