File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,16 @@ QString QgsLayerMetadataFormatter::contactsSectionHtml() const
96
96
QString QgsLayerMetadataFormatter::extentSectionHtml () const
97
97
{
98
98
QString myMetadata = QStringLiteral ( " <table class=\" list-view\" >\n " );
99
- myMetadata += QStringLiteral ( " <tr><td class=\" highlight\" >" ) + QObject::tr ( " CRS" ) + QStringLiteral ( " </td><td>" ) + mMetadata .crs ().authid () + QStringLiteral ( " - " );
100
- myMetadata += mMetadata .crs ().description () + QStringLiteral ( " - " );
101
- if ( mMetadata .crs ().isGeographic () )
102
- myMetadata += QObject::tr ( " Geographic" );
103
- else
104
- myMetadata += QObject::tr ( " Projected" );
99
+ myMetadata += QStringLiteral ( " <tr><td class=\" highlight\" >" ) + QObject::tr ( " CRS" ) + QStringLiteral ( " </td><td>" );
100
+ if ( mMetadata .crs ().isValid () )
101
+ {
102
+ myMetadata += mMetadata .crs ().authid () + QStringLiteral ( " - " );
103
+ myMetadata += mMetadata .crs ().description () + QStringLiteral ( " - " );
104
+ if ( mMetadata .crs ().isGeographic () )
105
+ myMetadata += QObject::tr ( " Geographic" );
106
+ else
107
+ myMetadata += QObject::tr ( " Projected" );
108
+ }
105
109
myMetadata += QLatin1String ( " </td></tr>\n " );
106
110
107
111
const QgsLayerMetadata::Extent extent = mMetadata .extent ();
Original file line number Diff line number Diff line change @@ -414,6 +414,10 @@ void QgsMetadataWidget::setPropertiesFromLayer() const
414
414
{
415
415
selectionCrs->setCrs ( mMetadata .crs () );
416
416
}
417
+ else
418
+ {
419
+ selectionCrs->setOptionVisible ( QgsProjectionSelectionWidget::CrsNotSet, true );
420
+ }
417
421
418
422
// Links
419
423
const QList<QgsLayerMetadata::Link> &links = mMetadata .links ();
You can’t perform that action at this time.
0 commit comments