QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsrecentstylehandler.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrecentstylehandler.h
3
------------------------
4
begin : September 2021
5
copyright : (C) 2021 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgsrecentstylehandler.h
"
17
18
#include "
qgssymbol.h
"
19
20
QgsRecentStyleHandler::QgsRecentStyleHandler
() =
default
;
21
22
QgsRecentStyleHandler::~QgsRecentStyleHandler
() =
default
;
23
24
25
void
QgsRecentStyleHandler::pushRecentSymbol
(
const
QString &identifier,
QgsSymbol
*symbol )
26
{
27
mRecentSymbols[identifier] = std::unique_ptr< QgsSymbol >( symbol );
28
}
29
30
QgsSymbol
*
QgsRecentStyleHandler::recentSymbol
(
const
QString &identifier )
const
31
{
32
auto
it = mRecentSymbols.find( identifier );
33
if
( it != mRecentSymbols.end() )
34
return
it->second->
clone
();
35
else
36
return
nullptr
;
37
}
QgsRecentStyleHandler::pushRecentSymbol
void pushRecentSymbol(const QString &identifier, QgsSymbol *symbol)
Pushes a recently used symbol with the specified identifier.
Definition
qgsrecentstylehandler.cpp:25
QgsRecentStyleHandler::QgsRecentStyleHandler
QgsRecentStyleHandler()
Creates a new recent style handler.
QgsRecentStyleHandler::~QgsRecentStyleHandler
~QgsRecentStyleHandler()
QgsRecentStyleHandler::recentSymbol
QgsSymbol * recentSymbol(const QString &identifier) const
Returns a copy of the recently used symbol with the specified identifier, or nullptr if no symbol wit...
Definition
qgsrecentstylehandler.cpp:30
QgsSymbol
Abstract base class for all rendered symbols.
Definition
qgssymbol.h:227
QgsSymbol::clone
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
qgsrecentstylehandler.h
qgssymbol.h
Generated on
for QGIS API Documentation by
1.17.0