QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsmaplayerloadstyledialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayerloadstyledialog.h
3 ---------------------
4 begin : April 2013
5 copyright : (C) 2013 by Emilio Loi
6 email : loi at faunalia dot it
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 QGSMAPLAYERLOADSTYLEDIALOG_H
17#define QGSMAPLAYERLOADSTYLEDIALOG_H
18
19// We don't want to expose this in the public API
20#define SIP_NO_FILE
21
22#include "ui_qgsvectorlayerloadstyledialog.h"
23#include "qgis_gui.h"
25#include "qgsmaplayer.h"
26
28
41class GUI_EXPORT QgsMapLayerLoadStyleDialog : public QDialog, private Ui::QgsVectorLayerLoadStyleDialog
42{
43 Q_OBJECT
44 public:
45
49 explicit QgsMapLayerLoadStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
50
54 QgsMapLayer::StyleCategories styleCategories() const;
55
59 QgsLayerPropertiesDialog::StyleType currentStyleType() const;
60
66 QString fileExtension() const;
67
73 QString filePath() const;
74
78 void initializeLists( const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit );
79
83 QString selectedStyleId();
84
85 public slots:
86 void accept() override;
87
88 private slots:
89 void updateLoadButtonState();
90 void onRelatedTableSelectionChanged();
91 void onOthersTableSelectionChanged();
92 void deleteStyleFromDB();
93 void showHelp();
94 void selectAll();
95 void deselectAll();
96 void invertSelection();
97
98 private:
99 void selectionChanged( QTableWidget *styleTable );
100
101 QgsMapLayer *mLayer = nullptr;
103 QString mSelectedStyleId;
104 QString mSelectedStyleName;
105 int mSectionLimit = 0;
106 QPushButton *mDeleteButton = nullptr;
107 QPushButton *mLoadButton = nullptr;
108 QPushButton *mCancelButton = nullptr;
109};
110
111#endif //QGSMAPLAYERLOADSTYLEDIALOG_H
A reusable dialog which allows users to select stored layer styles and categories to load for a map l...
Model for layer style categories.
Base class for all map layer types.
Definition: qgsmaplayer.h:75
QFlags< StyleCategory > StyleCategories
Definition: qgsmaplayer.h:188