QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
QgsMetadataWidget Class Reference

A wizard to edit metadata on a map layer. More...

#include <qgsmetadatawidget.h>

Inheritance diagram for QgsMetadataWidget:
Inheritance graph
[legend]

Public Types

enum  Mode { LayerMetadata = 0 , ProjectMetadata }
 Widget modes. More...
 

Public Slots

void setTitle (const QString &title)
 Sets the title field for the metadata.
 

Signals

void titleChanged (const QString &title)
 Emitted when the title field is changed.
 

Public Member Functions

 QgsMetadataWidget (QWidget *parent SIP_TRANSFERTHIS=nullptr, QgsMapLayer *layer=nullptr)
 Constructor for the wizard.
 
void acceptMetadata ()
 Saves the metadata to the layer.
 
bool checkMetadata ()
 Check if values in the wizard are correct.
 
void crsChanged ()
 If the CRS is updated.
 
QgsAbstractMetadataBasemetadata () SIP_FACTORY
 Returns a QgsAbstractMetadataBase object representing the current state of the widget.
 
Mode mode () const
 Returns the widget's current mode.
 
void saveMetadata (QgsAbstractMetadataBase *metadata)
 Save all fields in a metadata object.
 
void setMapCanvas (QgsMapCanvas *canvas)
 Sets a map canvas associated with the widget.
 
void setMetadata (const QgsAbstractMetadataBase *metadata)
 Sets the metadata to display in the widget.
 
void setMode (Mode mode)
 Sets the widget's current mode.
 
QString title () const
 Returns the current title field for the metadata.
 

Static Public Member Functions

static QMap< QString, QString > parseLanguages ()
 Returns a list of languages available by default in the wizard.
 
static QStringList parseLicenses ()
 Returns a list of licences available by default in the wizard.
 
static QStringList parseLinkTypes ()
 Returns a list of link types available by default in the wizard.
 
static QStringList parseMimeTypes ()
 Returns a list of MIME types available by default in the wizard.
 
static QMap< QString, QString > parseTypes ()
 Returns a list of types available by default in the wizard.
 

Properties

QString title
 

Detailed Description

A wizard to edit metadata on a map layer.

Definition at line 40 of file qgsmetadatawidget.h.

Member Enumeration Documentation

◆ Mode

Widget modes.

Since
QGIS 3.2
Enumerator
LayerMetadata 

Show layer metadata.

ProjectMetadata 

Show project metadata.

Definition at line 51 of file qgsmetadatawidget.h.

Constructor & Destructor Documentation

◆ QgsMetadataWidget()

QgsMetadataWidget::QgsMetadataWidget ( QWidget *parent  SIP_TRANSFERTHIS = nullptr,
QgsMapLayer layer = nullptr 
)

Constructor for the wizard.

If layer is set, then this constructor automatically sets the widget's metadata() to match the layer's metadata..

See also
setMetadata()

Definition at line 34 of file qgsmetadatawidget.cpp.

Member Function Documentation

◆ acceptMetadata()

void QgsMetadataWidget::acceptMetadata ( )

Saves the metadata to the layer.

Definition at line 1035 of file qgsmetadatawidget.cpp.

◆ checkMetadata()

bool QgsMetadataWidget::checkMetadata ( )

Check if values in the wizard are correct.

See also
saveMetadata()

Definition at line 833 of file qgsmetadatawidget.cpp.

◆ crsChanged()

void QgsMetadataWidget::crsChanged ( )

If the CRS is updated.

Definition at line 335 of file qgsmetadatawidget.cpp.

◆ metadata()

QgsAbstractMetadataBase * QgsMetadataWidget::metadata ( )

Returns a QgsAbstractMetadataBase object representing the current state of the widget.

Caller takes ownership of the returned object.

See also
saveMetadata()

Definition at line 212 of file qgsmetadatawidget.cpp.

◆ mode()

Mode QgsMetadataWidget::mode ( ) const
inline

Returns the widget's current mode.

See also
setMode()
Since
QGIS 3.2

Definition at line 79 of file qgsmetadatawidget.h.

◆ parseLanguages()

QMap< QString, QString > QgsMetadataWidget::parseLanguages ( )
static

Returns a list of languages available by default in the wizard.

Definition at line 879 of file qgsmetadatawidget.cpp.

◆ parseLicenses()

QStringList QgsMetadataWidget::parseLicenses ( )
static

Returns a list of licences available by default in the wizard.

Definition at line 922 of file qgsmetadatawidget.cpp.

◆ parseLinkTypes()

QStringList QgsMetadataWidget::parseLinkTypes ( )
static

Returns a list of link types available by default in the wizard.

See also
https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv

Definition at line 946 of file qgsmetadatawidget.cpp.

◆ parseMimeTypes()

QStringList QgsMetadataWidget::parseMimeTypes ( )
static

Returns a list of MIME types available by default in the wizard.

See also
https://fr.wikipedia.org/wiki/Type_MIME

Definition at line 970 of file qgsmetadatawidget.cpp.

◆ parseTypes()

QMap< QString, QString > QgsMetadataWidget::parseTypes ( )
static

Returns a list of types available by default in the wizard.

Definition at line 992 of file qgsmetadatawidget.cpp.

◆ saveMetadata()

void QgsMetadataWidget::saveMetadata ( QgsAbstractMetadataBase metadata)

Save all fields in a metadata object.

See also
metadata()
acceptMetadata()
checkMetadata()

Definition at line 693 of file qgsmetadatawidget.cpp.

◆ setMapCanvas()

void QgsMetadataWidget::setMapCanvas ( QgsMapCanvas canvas)

Sets a map canvas associated with the widget.

Definition at line 1015 of file qgsmetadatawidget.cpp.

◆ setMetadata()

void QgsMetadataWidget::setMetadata ( const QgsAbstractMetadataBase metadata)

Sets the metadata to display in the widget.

This method can be called after constructing a QgsMetadataWidget in order to set the displayed metadata to custom, non-layer based metadata.

Calling this method will automatically setMode() to the correct mode corresponding to the specified metadata object.

See also
metadata()

Definition at line 198 of file qgsmetadatawidget.cpp.

◆ setMode()

void QgsMetadataWidget::setMode ( QgsMetadataWidget::Mode  mode)

Sets the widget's current mode.

See also
mode()
Since
QGIS 3.2

Definition at line 143 of file qgsmetadatawidget.cpp.

◆ setTitle

void QgsMetadataWidget::setTitle ( const QString &  title)
slot

Sets the title field for the metadata.

See also
title()
titleChanged()
Since
QGIS 3.2

Definition at line 1026 of file qgsmetadatawidget.cpp.

◆ title()

QString QgsMetadataWidget::title ( ) const

Returns the current title field for the metadata.

See also
setTitle()
titleChanged()
Since
QGIS 3.2

Definition at line 1021 of file qgsmetadatawidget.cpp.

◆ titleChanged

void QgsMetadataWidget::titleChanged ( const QString &  title)
signal

Emitted when the title field is changed.

See also
title()
setTitle()
Since
QGIS 3.2

Property Documentation

◆ title

QString QgsMetadataWidget::title
readwrite

Definition at line 43 of file qgsmetadatawidget.h.


The documentation for this class was generated from the following files: