QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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 "qgsguiutils.h"
24 #include "qgis_gui.h"
26 #include "qgsmaplayer.h"
27 
29 
42 class GUI_EXPORT QgsMapLayerLoadStyleDialog : public QDialog, private Ui::QgsVectorLayerLoadStyleDialog
43 {
44  Q_OBJECT
45  public:
46 
50  explicit QgsMapLayerLoadStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
51 
55  QgsMapLayer::StyleCategories styleCategories() const;
56 
60  QgsVectorLayerProperties::StyleType currentStyleType() const;
61 
67  QString fileExtension() const;
68 
74  QString filePath() const;
75 
79  void initializeLists( const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit );
80 
84  QString selectedStyleId();
85 
86  public slots:
87  void accept() override;
88 
89  private slots:
90  void updateLoadButtonState();
91  void onRelatedTableSelectionChanged();
92  void onOthersTableSelectionChanged();
93  void deleteStyleFromDB();
94  void showHelp();
95 
96  private:
97  void selectionChanged( QTableWidget *styleTable );
98 
99  QgsMapLayer *mLayer = nullptr;
101  QString mSelectedStyleId;
102  QString mSelectedStyleName;
103  int mSectionLimit = 0;
104  QPushButton *mDeleteButton = nullptr;
105  QPushButton *mLoadButton = nullptr;
106  QPushButton *mCancelButton = nullptr;
107 };
108 
109 #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:73