QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsvectorlayersavestyledialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayersavestyledialog.h
3  --------------------------------------
4  Date : September 2018
5  Copyright : (C) 2018 by Denis Rouzaud
6  Email : [email protected]
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 QGSVECTORLAYERSAVESTYLEDIALOG_H
17 #define QGSVECTORLAYERSAVESTYLEDIALOG_H
18 
19 // We don't want to expose this in the public API
20 #define SIP_NO_FILE
21 
22 #include <QDialog>
23 #include "ui_qgsvectorlayersavestyledialog.h"
25 #include "qgis_gui.h"
26 
27 class QgsVectorLayer;
29 
38 class GUI_EXPORT QgsVectorLayerSaveStyleDialog : public QDialog, private Ui::QgsVectorLayerSaveStyleDialog
39 {
40  Q_OBJECT
41 
42  public:
43 
45  {
46  public:
47  QString uiFileContent;
48  QString name;
49  QString description;
50  bool isDefault;
51  };
52 
53  explicit QgsVectorLayerSaveStyleDialog( QgsVectorLayer *layer, QWidget *parent = nullptr );
54 
55  SaveToDbSettings saveToDbSettings() const;
56  QString outputFilePath() const;
57  QgsMapLayer::StyleCategories styleCategories() const;
58 
59  QgsVectorLayerProperties::StyleType currentStyleType() const;
60 
61  bool saveOnlyCurrentStyle() const;
62  void setSaveOnlyCurrentStyle( bool saveCurrentStyle );
63 
64  const QListWidget *stylesWidget( );
65 
66  public slots:
67  void accept() override;
68 
69  private slots:
70  void updateSaveButtonState();
71  void showHelp();
72  void readUiFileContent( const QString &filePath );
73 
74  private:
75  void setupMultipleStyles();
76  QgsVectorLayer *mLayer = nullptr;
78  QString mUiFileContent;
79  bool mSaveOnlyCurrentStyle = true;
80 };
81 
82 #endif // QGSVECTORLAYERSAVESTYLE_H
Model for layer style categories.
The QgsVectorLayerSaveStyleDialog class provides the UI to save the current style or multiple styles ...
Represents a vector layer which manages a vector based data sets.