QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsmaplayerstyleguiutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayerstyleguiutils.h
3  --------------------------------------
4  Date : January 2015
5  Copyright : (C) 2015 by Martin Dobias
6  Email : wonder dot sk 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 #ifndef QGSMAPLAYERSTYLEGUIUTILS_H
17 #define QGSMAPLAYERSTYLEGUIUTILS_H
18 
19 #include <QObject>
20 #include "qgis_gui.h"
21 
22 #define SIP_NO_FILE
23 
24 class QgsMapLayer;
25 
26 class QAction;
27 class QMenu;
28 
29 
38 class GUI_EXPORT QgsMapLayerStyleGuiUtils : public QObject
39 {
40  Q_OBJECT
41 
42  public:
43 
47  static QgsMapLayerStyleGuiUtils *instance();
48 
52  void addStyleManagerActions( QMenu *m, QgsMapLayer *layer );
53 
59  void removesExtraMenuSeparators( QMenu *m );
60 
61  public slots:
62 
63  private :
64  QAction *actionAddStyle( QgsMapLayer *layer, QObject *parent = nullptr );
65  QAction *actionRemoveStyle( QgsMapLayer *layer, QObject *parent = nullptr );
66  QAction *actionRenameStyle( QgsMapLayer *layer, QObject *parent = nullptr );
67  QList<QAction *> actionsUseStyle( QgsMapLayer *layer, QObject *parent = nullptr );
68 
69  private slots:
70  void addStyle();
71  void useStyle();
72  void removeStyle();
73  void renameStyle();
74 };
75 
76 #endif // QGSMAPLAYERSTYLEGUIUTILS_H
Various GUI utility functions for dealing with map layer's style manager.
Base class for all map layer types.
Definition: qgsmaplayer.h:73