2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
/**
|
2015-02-03 02:21:52 +01:00
|
|
|
* \ingroup gui
|
|
|
|
* A generic dialog to prompt the user for a Coordinate Reference System.
|
|
|
|
*
|
|
|
|
* Typically you will use this when you want to prompt the user for
|
|
|
|
* a coordinate system identifier e.g. from a plugin you might do this
|
|
|
|
* to get an epsg code:
|
|
|
|
* \code
|
2016-07-21 22:01:38 +10:00
|
|
|
* QgsGenericProjectionSelector mySelector( mQgisIface->mainWindow() );
|
2015-02-03 02:21:52 +01:00
|
|
|
* mySelector.setSelectedEpsg( mEpsgId );
|
|
|
|
* if ( mySelector.exec() )
|
|
|
|
* {
|
|
|
|
* mEpsgId = mySelector.selectedEpsg();
|
|
|
|
* }
|
|
|
|
* \endcode
|
|
|
|
*
|
|
|
|
* If you wish to embed the projection selector into an existing dialog
|
|
|
|
* the you probably want to look at QgsProjectionSelector rather.
|
2007-01-09 02:39:15 +00:00
|
|
|
*/
|
2008-08-07 00:16:37 +00:00
|
|
|
class QgsGenericProjectionSelector : QDialog //, private Ui::QgsGenericProjectionSelectorBase
|
2007-01-09 02:39:15 +00:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2008-08-07 00:16:37 +00:00
|
|
|
#include <qgsgenericprojectionselector.h>
|
2007-01-09 02:39:15 +00:00
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2015-02-18 17:00:36 +11:00
|
|
|
QgsGenericProjectionSelector( QWidget *parent /TransferThis/ = 0,
|
2015-10-07 11:55:34 +11:00
|
|
|
const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
//! Destructor
|
2008-08-07 00:16:37 +00:00
|
|
|
~QgsGenericProjectionSelector();
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public slots:
|
|
|
|
/** If no parameter is passed, the message will be a generic
|
|
|
|
* 'define the CRS for this layer'.
|
|
|
|
*/
|
|
|
|
void setMessage( QString theMessage = "" );
|
|
|
|
long selectedCrsId();
|
|
|
|
QString selectedAuthId();
|
|
|
|
|
2015-10-07 11:55:34 +11:00
|
|
|
void setSelectedCrsName( const QString& theName );
|
2012-09-24 02:28:15 +02:00
|
|
|
void setSelectedCrsId( long theID );
|
2015-10-07 11:55:34 +11:00
|
|
|
void setSelectedAuthId( const QString& authId );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-01-08 06:48:55 +11:00
|
|
|
void on_mButtonBox_helpRequested();
|
2014-08-25 16:07:13 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/**
|
|
|
|
* \brief filters this dialog by the given CRSs
|
|
|
|
*
|
|
|
|
* Sets this dialog to filter the available projections to those listed
|
|
|
|
* by the given Coordinate Reference Systems.
|
|
|
|
*
|
|
|
|
* \param crsFilter a list of OGC Coordinate Reference Systems to filter the
|
|
|
|
* list of projections by. This is useful in (e.g.) WMS situations
|
|
|
|
* where you just want to offer what the WMS server can support.
|
|
|
|
*
|
|
|
|
* \warning This function's behaviour is undefined if it is called after the dialog is shown.
|
|
|
|
*/
|
2015-10-07 11:55:34 +11:00
|
|
|
void setOgcWmsCrsFilter( const QSet<QString>& crsFilter );
|
2007-01-09 02:39:15 +00:00
|
|
|
};
|