23 #include <QApplication> 28 : QDialog( parent, fl )
32 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsProjectionSelectionDialog::showHelp );
49 QString sentence1 = tr(
"This layer appears to have no projection specification." );
50 QString sentence2 = tr(
"By default, this layer will now have its projection set to that of the project, " 51 "but you may override this by selecting a different projection below." );
52 m = QStringLiteral(
"%1 %2" ).arg( sentence1, sentence2 );
56 m =
"<head><style>" + myStyle +
"</style></head><body>" + m +
"</body>";
57 textEdit->setHtml( m );
63 projectionSelector->setShowNoProjection( show );
68 return projectionSelector->showNoProjection();
73 return projectionSelector->crs();
78 projectionSelector->setCrs( crs );
83 projectionSelector->setOgcWmsCrsFilter( crsFilter );
86 void QgsProjectionSelectionDialog::showHelp()
88 QgsHelp::openHelp( QStringLiteral(
"working_with_projections/working_with_projections.html" ) );
void setMessage(const QString &message)
Sets a message to show in the dialog.
static QString reportStyleSheet()
Returns a standard css style sheet for reports.
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.
QgsProjectionSelectionDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsProjectionSelectionDialog.
void setCrs(const QgsCoordinateReferenceSystem &crs)
Sets the initial crs to show within the dialog.
void setOgcWmsCrsFilter(const QSet< QString > &crsFilter)
filters this dialog by the given CRSs
This class represents a coordinate reference system (CRS).
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...
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
bool showNoProjection() const
Returns whether the "no/invalid" projection option is shown.