23 #include <QApplication> 28 : QDialog( parent, fl )
32 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsProjectionSelectionDialog::showHelp );
49 QString format( QStringLiteral(
"<h1>%1</h1>%2 %3" ) );
50 QString header = tr(
"Define this layer's coordinate reference system:" );
51 QString sentence1 = tr(
"This layer appears to have no projection specification." );
52 QString sentence2 = tr(
"By default, this layer will now have its projection set to that of the project, " 53 "but you may override this by selecting a different projection below." );
54 m = format.arg( header, sentence1, sentence2 );
58 m =
"<head><style>" + myStyle +
"</style></head><body>" + m +
"</body>";
59 textEdit->setHtml( m );
65 projectionSelector->setShowNoProjection( show );
70 return projectionSelector->showNoProjection();
75 return projectionSelector->crs();
80 projectionSelector->setCrs( crs );
85 projectionSelector->setOgcWmsCrsFilter( crsFilter );
88 void QgsProjectionSelectionDialog::showHelp()
90 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.