QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
20
21#include <QObject>
22
23#define SIP_NO_FILE
24
25class QgsMapLayer;
26
27class QAction;
28class QMenu;
29
30
38
39class GUI_EXPORT QgsMapLayerStyleGuiUtils : public QObject
40{
41 Q_OBJECT
42
43 public:
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.
void removesExtraMenuSeparators(QMenu *m)
removes extra separators from the menu
void addStyleManagerActions(QMenu *m, QgsMapLayer *layer)
adds actions to the menu in accordance to the layer
static QgsMapLayerStyleGuiUtils * instance()
returns a singleton instance of this class
Base class for all map layer types.
Definition qgsmaplayer.h:80