QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsmaplayerstylemanagerwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayerstylemanagerwidget.h
3  ---------------------
4  begin : June 2016
5  copyright : (C) 2016 by Nathan Woodrow
6  email : woodrow dot nathan 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 #ifndef QGSMAPLAYERSTYLEMANAGERWIDGET_H
16 #define QGSMAPLAYERSTYLEMANAGERWIDGET_H
17 
18 #include <QWidget>
19 #include <QListView>
20 #include <QStandardItemModel>
21 
23 #include "qgis_gui.h"
24 
25 class QgsMapLayer;
26 class QgsMapCanvas;
27 
28 
35 {
36  Q_OBJECT
37  public:
38 
45  QgsMapLayerStyleManagerWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr );
46 
47  public slots:
48  void apply() override {}
49 
50  private slots:
51  void styleClicked( const QModelIndex &index );
52  void currentStyleChanged( const QString &name );
53  void styleAdded( const QString &name );
54  void styleRemoved( const QString &name );
55  void styleRenamed( const QString &oldname, const QString &newname );
56  void addStyle();
57  void removeStyle();
58  void renameStyle( QStandardItem *item );
59  void saveAsDefault();
60  void loadDefault();
61  void saveStyle();
62  void loadStyle();
63 
64  private:
65  QStandardItemModel *mModel = nullptr;
66  QListView *mStyleList = nullptr;
67 };
68 
69 #endif // QGSMAPLAYERSTYLEMANAGERWIDGET_H
A panel widget that can be shown in the map style dock.
Base class for all map layer types.
Definition: qgsmaplayer.h:63
The QgsMapLayerStyleManagerWidget class which is used to visually manage the layer styles...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74