QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsextentgroupbox.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsextentgroupbox.h
3  ---------------------
4  begin : March 2014
5  copyright : (C) 2014 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSEXTENTGROUPBOX_H
16 #define QGSEXTENTGROUPBOX_H
17 
18 #include "qgscollapsiblegroupbox.h"
19 
20 #include "ui_qgsextentgroupboxwidget.h"
21 
23 #include "qgsrectangle.h"
24 
26 
37 class GUI_EXPORT QgsExtentGroupBox : public QgsCollapsibleGroupBox, private Ui::QgsExtentGroupBoxWidget
38 {
39  Q_OBJECT
40  Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
41 
42  public:
43  explicit QgsExtentGroupBox( QWidget* parent = nullptr );
44 
46  {
50  };
51 
53  void setOriginalExtent( const QgsRectangle& originalExtent, const QgsCoordinateReferenceSystem& originalCrs );
54 
55  QgsRectangle originalExtent() const { return mOriginalExtent; }
56  const QgsCoordinateReferenceSystem& originalCrs() const { return mOriginalCrs; }
57 
59  void setCurrentExtent( const QgsRectangle& currentExtent, const QgsCoordinateReferenceSystem& currentCrs );
60 
61  QgsRectangle currentExtent() const { return mCurrentExtent; }
62  const QgsCoordinateReferenceSystem& currentCrs() const { return mCurrentCrs; }
63 
66  void setOutputCrs( const QgsCoordinateReferenceSystem& outputCrs );
67 
69  QgsRectangle outputExtent() const;
70 
71  ExtentState extentState() const { return mExtentState; }
72 
75  void setTitleBase( const QString& title );
78  QString titleBase() const;
79 
80  public slots:
82  void setOutputExtentFromOriginal();
83 
85  void setOutputExtentFromCurrent();
86 
88  void setOutputExtentFromUser( const QgsRectangle& extent, const QgsCoordinateReferenceSystem& crs );
89 
90  signals:
92  void extentChanged( const QgsRectangle& r );
93 
94  protected slots:
95 
96  void on_mXMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
97  void on_mXMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
98  void on_mYMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
99  void on_mYMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
100 
101  void groupBoxClicked();
102 
103  protected:
104  void setOutputExtent( const QgsRectangle& r, const QgsCoordinateReferenceSystem& srcCrs, ExtentState state );
105  void setOutputExtentFromLineEdit();
106  void updateTitle();
107 
110 
112 
114 
117 
120 };
121 
122 #endif // QGSEXTENTGROUPBOX_H
void on_mYMaxLineEdit_textEdited(const QString &)
extent manually entered/modified by the user
ExtentState mExtentState
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsRectangle originalExtent() const
void on_mXMinLineEdit_textEdited(const QString &)
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
QgsCoordinateReferenceSystem mOutputCrs
QgsCoordinateReferenceSystem mOriginalCrs
QString mTitleBase
Base part of the title used for the extent.
QgsRectangle mCurrentExtent
const QgsCoordinateReferenceSystem & currentCrs() const
void on_mXMaxLineEdit_textEdited(const QString &)
QgsRectangle currentExtent() const
const QgsCoordinateReferenceSystem & originalCrs() const
Class for storing a coordinate reference system (CRS)
QgsRectangle mOriginalExtent
QgsCoordinateReferenceSystem mCurrentCrs
void on_mYMinLineEdit_textEdited(const QString &)
Collapsible group box for configuration of extent, typically for a save operation.
ExtentState extentState() const