QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgslayerrestorer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayerrestorer.h
3  -------------------
4  begin : April 24, 2017
5  copyright : (C) 2017 by Paul Blottiere
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSLAYERRESTORER_H
19 #define QGSLAYERRESTORER_H
20 
21 #include <QList>
22 #include <QDomDocument>
23 #include <QMap>
24 
25 #include "qgsfeatureid.h"
26 
27 class QgsMapLayer;
28 
36 {
37  public:
38 
43  QgsLayerRestorer( const QList<QgsMapLayer *> &layers );
44 
51 
52  private:
53 
54  struct QgsLayerSettings
55  {
56  QString name;
57  double mOpacity;
58  QString mNamedStyle;
59  QDomDocument mQgisStyle;
60  QString mFilter;
61  QgsFeatureIds mSelectedFeatureIds;
62  };
63 
64  QMap<QgsMapLayer *, QgsLayerSettings> mLayerSettings;
65 };
66 
67 #endif
Base class for all map layer types.
Definition: qgsmaplayer.h:63
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:34
QgsLayerRestorer(const QList< QgsMapLayer * > &layers)
Constructor for QgsLayerRestorer.
RAII class to restore layer configuration on destruction (opacity, filters, ...)
~QgsLayerRestorer()
Destructor.