QGIS API Documentation 4.1.0-Master (9af12b5a203)
Loading...
Searching...
No Matches
qgsbloomsettings.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsbloomsettings.cpp
3 --------------------------------------
4 Date : May 2026
5 Copyright : (C) 2026 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 "qgsbloomsettings.h"
17
18#include "qgsreadwritecontext.h"
19
20#include <QDomDocument>
21#include <QString>
22
23using namespace Qt::StringLiterals;
24
26 : mEnabled( other.mEnabled )
27 , mIntensity( other.mIntensity )
28 , mRadius( other.mRadius )
29{}
30
32{
33 if ( &rhs == this )
34 return *this;
35
36 mEnabled = rhs.mEnabled;
37 mIntensity = rhs.mIntensity;
38 mRadius = rhs.mRadius;
39 return *this;
40}
41
42void QgsBloomSettings::readXml( const QDomElement &element, const QgsReadWriteContext & )
43{
44 mEnabled = static_cast< bool >( element.attribute( u"enabled"_s, u"0"_s ).toInt() );
45 mIntensity = element.attribute( u"intensity"_s, u"0.05"_s ).toDouble();
46 mRadius = element.attribute( u"radius"_s, u"0.005"_s ).toDouble();
47}
48
49void QgsBloomSettings::writeXml( QDomElement &element, const QgsReadWriteContext & ) const
50{
51 element.setAttribute( u"enabled"_s, mEnabled ? u"1"_s : u"0"_s );
52 element.setAttribute( u"intensity"_s, mIntensity );
53 element.setAttribute( u"radius"_s, mRadius );
54}
void writeXml(QDomElement &element, const QgsReadWriteContext &context) const
Writes settings to a DOM element.
QgsBloomSettings()=default
QgsBloomSettings & operator=(QgsBloomSettings const &rhs)
void readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads settings from a DOM element.
A container for the context for various read/write operations on objects.