QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
23 #include <QApplication>
28 : QDialog( parent, fl )
32 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsProjectionSelectionDialog::showHelp );
41 mSplitter->restoreState( settings.
value( QStringLiteral(
"Windows/ProjectionSelectorDialog/splitterState" ) ).toByteArray() );
47 settings.
setValue( QStringLiteral(
"Windows/ProjectionSelectorDialog/splitterState" ), mSplitter->saveState() );
59 setMessage( tr(
"This layer appears to have no projection specification." )
61 + tr(
"By default, this layer will now have its projection set to that of the project, "
62 "but you may override this by selecting a different projection below." ) );
67 projectionSelector->setShowNoProjection( show );
72 return projectionSelector->showNoProjection();
77 projectionSelector->setNotSetText( text );
82 return projectionSelector->crs();
87 projectionSelector->setCrs(
crs );
92 projectionSelector->setOgcWmsCrsFilter( crsFilter );
95 void QgsProjectionSelectionDialog::showHelp()
97 QgsHelp::openHelp( QStringLiteral(
"working_with_projections/working_with_projections.html" ) );
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setNotSetText(const QString &text)
Sets the text to show for the not set option.
const QgsCoordinateReferenceSystem & crs
void setShowNoProjection(bool show)
Sets whether a "no/invalid" projection option should be shown.
QgsCoordinateReferenceSystem crs() const
Returns the CRS currently selected in the widget.
void setMessage(const QString &message)
Sets a message to show in the dialog.
bool showNoProjection() const
Returns whether the "no/invalid" projection option is shown.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the initial crs to show within the dialog.
This class is a composition of two QSettings instances:
~QgsProjectionSelectionDialog() override
void setOgcWmsCrsFilter(const QSet< QString > &crsFilter)
filters this dialog by the given CRSs
void showNoCrsForLayerMessage()
When called, the dialog will show a default "layer has no CRS set" message above the projection selec...
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
QgsProjectionSelectionDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsProjectionSelectionDialog.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
This class represents a coordinate reference system (CRS).
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
static QString reportStyleSheet(QgsApplication::StyleSheetType styleSheetType=QgsApplication::StyleSheetType::Qt)
Returns a css style sheet for reports, the styleSheetType argument determines what type of stylesheet...