QGIS API Documentation  2.99.0-Master (11bb234)
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 #include "qgis_gui.h"
25 
27 
38 class GUI_EXPORT QgsExtentGroupBox : public QgsCollapsibleGroupBox, private Ui::QgsExtentGroupBoxWidget
39 {
40  Q_OBJECT
41  Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
42 
43  public:
44  explicit QgsExtentGroupBox( QWidget *parent = nullptr );
45 
47  {
51  };
52 
54  void setOriginalExtent( const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs );
55 
56  QgsRectangle originalExtent() const { return mOriginalExtent; }
57  const QgsCoordinateReferenceSystem &originalCrs() const { return mOriginalCrs; }
58 
60  void setCurrentExtent( const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs );
61 
62  QgsRectangle currentExtent() const { return mCurrentExtent; }
63  const QgsCoordinateReferenceSystem &currentCrs() const { return mCurrentCrs; }
64 
67  void setOutputCrs( const QgsCoordinateReferenceSystem &outputCrs );
68 
70  QgsRectangle outputExtent() const;
71 
72  ExtentState extentState() const { return mExtentState; }
73 
76  void setTitleBase( const QString &title );
79  QString titleBase() const;
80 
81  public slots:
83  void setOutputExtentFromOriginal();
84 
86  void setOutputExtentFromCurrent();
87 
89  void setOutputExtentFromUser( const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs );
90 
91  signals:
93  void extentChanged( const QgsRectangle &r );
94 
95  protected slots:
96 
97  void on_mXMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
98  void on_mXMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
99  void on_mYMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
100  void on_mYMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
101 
102  void groupBoxClicked();
103 
104  protected:
105  void setOutputExtent( const QgsRectangle &r, const QgsCoordinateReferenceSystem &srcCrs, ExtentState state );
106  void setOutputExtentFromLineEdit();
107  void updateTitle();
108 
110  QString mTitleBase;
111 
113 
115 
118 
121 };
122 
123 #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:38
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
This class represents 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