QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsBookmark Class Reference

Represents a spatial bookmark, with a name, CRS and extent. More...

#include <qgsbookmarkmanager.h>

Public Member Functions

 QgsBookmark ()=default
 Default constructor, creates an empty bookmark.
 
QgsReferencedRectangle extent () const
 Returns the bookmark's spatial extent.
 
QString group () const
 Returns the bookmark's group, which is a user-visible string identifying the bookmark's category.
 
QString id () const
 Returns the bookmark's unique ID.
 
QString name () const
 Returns the bookmark's name, which is a user-visible string identifying the bookmark.
 
bool operator!= (const QgsBookmark &other) const
 
bool operator== (const QgsBookmark &other) const
 
double rotation () const
 Returns the bookmark's map rotation.
 
void setExtent (const QgsReferencedRectangle &extent)
 Sets the bookmark's spatial extent.
 
void setGroup (const QString &group)
 Sets the bookmark's group, which is a user-visible string identifying the bookmark's category.
 
void setId (const QString &id)
 Sets the bookmark's unique id.
 
void setName (const QString &name)
 Sets the bookmark's name, which is a user-visible string identifying the bookmark.
 
void setRotation (double rotation)
 Sets the bookmark's spatial map rotation.
 
QDomElement writeXml (QDomDocument &doc) const
 Returns a DOM element representing the bookmark's properties.
 

Static Public Member Functions

static QgsBookmark fromXml (const QDomElement &element, const QDomDocument &doc)
 Creates a bookmark using the properties from a DOM element.
 

Detailed Description

Represents a spatial bookmark, with a name, CRS and extent.

QgsBookmark objects are typically used alongside the QgsBookmarkManager class, which handles storage of a set of bookmarks.

Since
QGIS 3.10

Definition at line 37 of file qgsbookmarkmanager.h.

Constructor & Destructor Documentation

◆ QgsBookmark()

QgsBookmark::QgsBookmark ( )
default

Default constructor, creates an empty bookmark.

Member Function Documentation

◆ extent()

QgsReferencedRectangle QgsBookmark::extent ( ) const

Returns the bookmark's spatial extent.

See also
setExtent()

Definition at line 100 of file qgsbookmarkmanager.cpp.

◆ fromXml()

QgsBookmark QgsBookmark::fromXml ( const QDomElement &  element,
const QDomDocument &  doc 
)
static

Creates a bookmark using the properties from a DOM element.

See also
writeXml()

Definition at line 40 of file qgsbookmarkmanager.cpp.

◆ group()

QString QgsBookmark::group ( ) const

Returns the bookmark's group, which is a user-visible string identifying the bookmark's category.

See also
setGroup()

Definition at line 90 of file qgsbookmarkmanager.cpp.

◆ id()

QString QgsBookmark::id ( ) const

Returns the bookmark's unique ID.

See also
setId()

Definition at line 30 of file qgsbookmarkmanager.cpp.

◆ name()

QString QgsBookmark::name ( ) const

Returns the bookmark's name, which is a user-visible string identifying the bookmark.

See also
setName()

Definition at line 80 of file qgsbookmarkmanager.cpp.

◆ operator!=()

bool QgsBookmark::operator!= ( const QgsBookmark other) const

Definition at line 75 of file qgsbookmarkmanager.cpp.

◆ operator==()

bool QgsBookmark::operator== ( const QgsBookmark other) const

Definition at line 66 of file qgsbookmarkmanager.cpp.

◆ rotation()

double QgsBookmark::rotation ( ) const

Returns the bookmark's map rotation.

See also
setRotation()
Since
QGIS 3.32

Definition at line 110 of file qgsbookmarkmanager.cpp.

◆ setExtent()

void QgsBookmark::setExtent ( const QgsReferencedRectangle extent)

Sets the bookmark's spatial extent.

See also
extent()

Definition at line 105 of file qgsbookmarkmanager.cpp.

◆ setGroup()

void QgsBookmark::setGroup ( const QString &  group)

Sets the bookmark's group, which is a user-visible string identifying the bookmark's category.

See also
group()

Definition at line 95 of file qgsbookmarkmanager.cpp.

◆ setId()

void QgsBookmark::setId ( const QString &  id)

Sets the bookmark's unique id.

See also
id()

Definition at line 35 of file qgsbookmarkmanager.cpp.

◆ setName()

void QgsBookmark::setName ( const QString &  name)

Sets the bookmark's name, which is a user-visible string identifying the bookmark.

See also
name()

Definition at line 85 of file qgsbookmarkmanager.cpp.

◆ setRotation()

void QgsBookmark::setRotation ( double  rotation)

Sets the bookmark's spatial map rotation.

See also
rotation()
Since
QGIS 3.32

Definition at line 115 of file qgsbookmarkmanager.cpp.

◆ writeXml()

QDomElement QgsBookmark::writeXml ( QDomDocument &  doc) const

Returns a DOM element representing the bookmark's properties.

See also
fromXml()

Definition at line 54 of file qgsbookmarkmanager.cpp.


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