QGIS API Documentation
2.4.0-Chugiak
|
A widget for selecting a Coordinate reference system from a tree. More...
#include <qgsprojectionselector.h>
Public Slots | |
void | setSelectedCrsName (QString theCRSName) |
QString | selectedName () |
void | setSelectedCrsId (long theCRSID) |
void | setSelectedAuthId (QString authId) |
QString | selectedProj4String () |
long | selectedPostgresSrId () |
Gets the current PostGIS-style projection identifier. More... | |
long | selectedCrsId () |
Gets the current QGIS projection identfier. More... | |
void | setOgcWmsCrsFilter (QSet< QString > crsFilter) |
filters this widget by the given CRSs More... | |
void | on_lstCoordinateSystems_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *prev) |
void | on_lstRecent_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *prev) |
void | on_cbxHideDeprecated_stateChanged () |
void | on_leSearch_textChanged (const QString &) |
void | pushProjectionToFront () |
mark selected projection for push to front More... | |
Signals | |
void | sridSelected (QString theSRID) |
void | refresh () |
Refresh any listening canvases. More... | |
void | searchBoxHasFocus (bool) |
Let listeners know if find has focus so they can adjust the default button. More... | |
void | initialized () |
Notify others that the widget is now fully initialized, including deferred selection of projection. More... | |
Public Member Functions | |
QgsProjectionSelector (QWidget *parent, const char *name="", Qt::WindowFlags fl=0) | |
~QgsProjectionSelector () | |
void | loadUserCrsList (QSet< QString > *crsFilter=0) |
Populate the proj tree view with user defined projection names... More... | |
void | loadCrsList (QSet< QString > *crsFilter=0) |
Populate the proj tree view with system projection names... More... | |
const QString | sqlSafeString (const QString theSQL) |
Make the string safe for use in SQL statements. This involves escaping single quotes, double quotes, backslashes, and optionally, percentage symbols. Percentage symbols are used as wildcards sometimes and so when using the string as part of the LIKE phrase of a select statement, should be escaped. More... | |
QString | selectedAuthId () |
Gets the current authority-style projection identifier. More... | |
Protected Member Functions | |
void | showEvent (QShowEvent *theEvent) |
Used to ensure the projection list view is actually populated. More... | |
void | resizeEvent (QResizeEvent *theEvent) |
Used to manage column sizes. More... | |
Private Types | |
enum | columns { NAME_COLUMN, AUTHID_COLUMN, QGIS_CRS_ID_COLUMN, NONE } |
Private Slots | |
QStringList | authorities () |
get list of authorities More... | |
Private Member Functions | |
QString | ogcWmsCrsFilterAsSqlExpression (QSet< QString > *crsFilter) |
converts the CRS group to a SQL expression fragment More... | |
void | applySelection (int column=NONE, QString value=QString::null) |
does the legwork of applying CRS Selection More... | |
QString | getSelectedExpression (QString e) |
gets an arbitrary sqlite3 expression from the selection More... | |
void | showDBMissingWarning (const QString theFileName) |
Show the user a warning if the srs database could not be found. More... | |
long | getLargestCRSIDMatch (QString theSql) |
Utility method used in conjunction with name based searching tool. More... | |
void | insertRecent (long theCrsId) |
add recently used CRS More... | |
void | hideDeprecated (QTreeWidgetItem *item) |
hide deprecated CRSes More... | |
Private Attributes | |
QTreeWidgetItem * | mUserProjList |
User defined projections node. More... | |
QTreeWidgetItem * | mGeoList |
GEOGCS node. More... | |
QTreeWidgetItem * | mProjList |
PROJCS node. More... | |
QString | mCustomCsFile |
Users custom coordinate system file. More... | |
QString | mSrsDatabaseFileName |
File name of the sqlite3 database. More... | |
bool | mProjListDone |
Has the Projection List been populated? More... | |
bool | mUserProjListDone |
Has the User Projection List been populated? More... | |
bool | mRecentProjListDone |
Has the Recent Projection List been populated? More... | |
int | mSearchColumn |
QString | mSearchValue |
bool | mPushProjectionToFront |
QSet< QString > | mCrsFilter |
The set of OGC WMS CRSs that want to be applied to this widget. More... | |
QStringList | mRecentProjections |
Most recently used projections (trimmed at 25 entries) More... | |
A widget for selecting a Coordinate reference system from a tree.
Definition at line 28 of file qgsprojectionselector.h.
|
private |
Enumerator | |
---|---|
NAME_COLUMN | |
AUTHID_COLUMN | |
QGIS_CRS_ID_COLUMN | |
NONE |
Definition at line 183 of file qgsprojectionselector.h.
QgsProjectionSelector::QgsProjectionSelector | ( | QWidget * | parent, |
const char * | name = "" , |
||
Qt::WindowFlags | fl = 0 |
||
) |
Definition at line 29 of file qgsprojectionselector.cpp.
References AUTHID_COLUMN, QgsCoordinateReferenceSystem::createFromOgcWmsCrs(), QgsCoordinateReferenceSystem::createFromProj4(), QgsCoordinateReferenceSystem::isValid(), mRecentProjections, mSrsDatabaseFileName, pushProjectionToFront(), QGIS_CRS_ID_COLUMN, QgsDebugMsg, QgsApplication::srsDbFilePath(), and QgsCoordinateReferenceSystem::srsid().
QgsProjectionSelector::~QgsProjectionSelector | ( | ) |
Definition at line 101 of file qgsprojectionselector.cpp.
References QgsCoordinateReferenceSystem::InternalCrsId, mPushProjectionToFront, mRecentProjections, selectedCrsId(), and QgsCoordinateReferenceSystem::toProj4().
|
private |
does the legwork of applying CRS Selection
Definition at line 253 of file qgsprojectionselector.cpp.
References mProjListDone, mSearchColumn, mSearchValue, mUserProjListDone, NONE, and QgsDebugMsg.
Referenced by setSelectedAuthId(), setSelectedCrsId(), setSelectedCrsName(), and showEvent().
|
privateslot |
get list of authorities
Definition at line 948 of file qgsprojectionselector.cpp.
References mSrsDatabaseFileName, and QgsDebugMsg.
|
private |
Utility method used in conjunction with name based searching tool.
Definition at line 879 of file qgsprojectionselector.cpp.
References mSrsDatabaseFileName, QgsApplication::qgisUserDbFilePath(), QgsDebugMsg, and showDBMissingWarning().
|
private |
gets an arbitrary sqlite3 expression from the selection
e | The sqlite3 expression (typically "srid" or "sridid") |
Definition at line 385 of file qgsprojectionselector.cpp.
References mSrsDatabaseFileName, QGIS_CRS_ID_COLUMN, QgsApplication::qgisUserDbFilePath(), QgsDebugMsg, showDBMissingWarning(), and USER_CRS_START_ID.
Referenced by selectedAuthId(), and selectedPostgresSrId().
|
private |
hide deprecated CRSes
Definition at line 779 of file qgsprojectionselector.cpp.
Referenced by on_cbxHideDeprecated_stateChanged().
|
signal |
Notify others that the widget is now fully initialized, including deferred selection of projection.
Referenced by showEvent().
|
private |
add recently used CRS
Definition at line 293 of file qgsprojectionselector.cpp.
References AUTHID_COLUMN, mProjListDone, mUserProjListDone, NAME_COLUMN, and QGIS_CRS_ID_COLUMN.
Referenced by showEvent().
void QgsProjectionSelector::loadCrsList | ( | QSet< QString > * | crsFilter = 0 | ) |
Populate the proj tree view with system projection names...
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. |
Definition at line 567 of file qgsprojectionselector.cpp.
References QgsApplication::activeThemePath(), AUTHID_COLUMN, mGeoList, mProjList, mProjListDone, mSrsDatabaseFileName, NAME_COLUMN, ogcWmsCrsFilterAsSqlExpression(), QGIS_CRS_ID_COLUMN, showDBMissingWarning(), and tr.
Referenced by showEvent().
void QgsProjectionSelector::loadUserCrsList | ( | QSet< QString > * | crsFilter = 0 | ) |
Populate the proj tree view with user defined projection names...
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. |
Definition at line 491 of file qgsprojectionselector.cpp.
References QgsApplication::activeThemePath(), AUTHID_COLUMN, mUserProjList, mUserProjListDone, ogcWmsCrsFilterAsSqlExpression(), QGIS_CRS_ID_COLUMN, QgsApplication::qgisUserDbFilePath(), QgsDebugMsg, showDBMissingWarning(), and tr.
Referenced by showEvent().
|
private |
converts the CRS group to a SQL expression fragment
Converts the given Coordinate Reference Systems to a format suitable for use in SQL for querying against the QGIS CRS database.
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. |
Definition at line 180 of file qgsprojectionselector.cpp.
References QgsDebugMsg.
Referenced by loadCrsList(), and loadUserCrsList().
|
slot |
Definition at line 796 of file qgsprojectionselector.cpp.
References hideDeprecated().
|
slot |
Definition at line 802 of file qgsprojectionselector.cpp.
References AUTHID_COLUMN, and NAME_COLUMN.
|
slot |
Definition at line 717 of file qgsprojectionselector.cpp.
References QGIS_CRS_ID_COLUMN, QgsDebugMsg, selectedCrsId(), selectedName(), selectedProj4String(), and sridSelected().
|
slot |
Definition at line 762 of file qgsprojectionselector.cpp.
References QGIS_CRS_ID_COLUMN, and QgsDebugMsg.
|
slot |
mark selected projection for push to front
Definition at line 872 of file qgsprojectionselector.cpp.
References mPushProjectionToFront.
Referenced by QgsProjectionSelector().
|
signal |
Refresh any listening canvases.
|
protected |
Used to manage column sizes.
Definition at line 146 of file qgsprojectionselector.cpp.
References AUTHID_COLUMN, NAME_COLUMN, and QGIS_CRS_ID_COLUMN.
|
signal |
Let listeners know if find has focus so they can adjust the default button.
QString QgsProjectionSelector::selectedAuthId | ( | ) |
Gets the current authority-style projection identifier.
Definition at line 462 of file qgsprojectionselector.cpp.
References getSelectedExpression(), and USER_CRS_START_ID.
|
slot |
Gets the current QGIS projection identfier.
Definition at line 472 of file qgsprojectionselector.cpp.
References QGIS_CRS_ID_COLUMN.
Referenced by on_lstCoordinateSystems_currentItemChanged(), and ~QgsProjectionSelector().
|
slot |
Definition at line 309 of file qgsprojectionselector.cpp.
References NAME_COLUMN.
Referenced by on_lstCoordinateSystems_currentItemChanged().
|
slot |
Gets the current PostGIS-style projection identifier.
Definition at line 456 of file qgsprojectionselector.cpp.
References getSelectedExpression().
|
slot |
Definition at line 317 of file qgsprojectionselector.cpp.
References mSrsDatabaseFileName, QGIS_CRS_ID_COLUMN, QgsApplication::qgisUserDbFilePath(), QgsDebugMsg, showDBMissingWarning(), and USER_CRS_START_ID.
Referenced by on_lstCoordinateSystems_currentItemChanged().
|
slot |
filters this widget by the given CRSs
Sets this widget to filter the available projections to those listed by the given Coordinate Reference Systems.
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. |
Definition at line 483 of file qgsprojectionselector.cpp.
References mCrsFilter, mProjListDone, and mUserProjListDone.
|
slot |
Definition at line 248 of file qgsprojectionselector.cpp.
References applySelection(), and AUTHID_COLUMN.
|
slot |
Definition at line 243 of file qgsprojectionselector.cpp.
References applySelection(), and QGIS_CRS_ID_COLUMN.
|
slot |
Definition at line 238 of file qgsprojectionselector.cpp.
References applySelection(), and NAME_COLUMN.
|
private |
Show the user a warning if the srs database could not be found.
Definition at line 1001 of file qgsprojectionselector.cpp.
References tr.
Referenced by getLargestCRSIDMatch(), getSelectedExpression(), loadCrsList(), loadUserCrsList(), and selectedProj4String().
|
protected |
Used to ensure the projection list view is actually populated.
Definition at line 157 of file qgsprojectionselector.cpp.
References applySelection(), initialized(), insertRecent(), loadCrsList(), loadUserCrsList(), mCrsFilter, mRecentProjections, and mRecentProjListDone.
const QString QgsProjectionSelector::sqlSafeString | ( | const QString | theSQL | ) |
Make the string safe for use in SQL statements. This involves escaping single quotes, double quotes, backslashes, and optionally, percentage symbols. Percentage symbols are used as wildcards sometimes and so when using the string as part of the LIKE phrase of a select statement, should be escaped.
Definition at line 991 of file qgsprojectionselector.cpp.
|
signal |
Referenced by on_lstCoordinateSystems_currentItemChanged().
|
private |
The set of OGC WMS CRSs that want to be applied to this widget.
Definition at line 190 of file qgsprojectionselector.h.
Referenced by setOgcWmsCrsFilter(), and showEvent().
|
private |
Users custom coordinate system file.
Definition at line 161 of file qgsprojectionselector.h.
|
private |
|
private |
|
private |
Has the Projection List been populated?
Definition at line 174 of file qgsprojectionselector.h.
Referenced by applySelection(), insertRecent(), loadCrsList(), and setOgcWmsCrsFilter().
|
private |
Definition at line 187 of file qgsprojectionselector.h.
Referenced by pushProjectionToFront(), and ~QgsProjectionSelector().
|
private |
Most recently used projections (trimmed at 25 entries)
Definition at line 193 of file qgsprojectionselector.h.
Referenced by QgsProjectionSelector(), showEvent(), and ~QgsProjectionSelector().
|
private |
Has the Recent Projection List been populated?
Definition at line 181 of file qgsprojectionselector.h.
Referenced by showEvent().
|
private |
Definition at line 184 of file qgsprojectionselector.h.
Referenced by applySelection().
|
private |
Definition at line 185 of file qgsprojectionselector.h.
Referenced by applySelection().
|
private |
File name of the sqlite3 database.
Definition at line 163 of file qgsprojectionselector.h.
Referenced by authorities(), getLargestCRSIDMatch(), getSelectedExpression(), loadCrsList(), QgsProjectionSelector(), and selectedProj4String().
|
private |
User defined projections node.
Definition at line 154 of file qgsprojectionselector.h.
Referenced by loadUserCrsList().
|
private |
Has the User Projection List been populated?
Definition at line 177 of file qgsprojectionselector.h.
Referenced by applySelection(), insertRecent(), loadUserCrsList(), and setOgcWmsCrsFilter().