QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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  void populateStyleComboBox();
77  QgsVectorLayer *mLayer = nullptr;
79  QString mUiFileContent;
80  bool mSaveOnlyCurrentStyle = true;
81 };
82 
83 #endif // QGSVECTORLAYERSAVESTYLE_H
QgsVectorLayerSaveStyleDialog::SaveToDbSettings::isDefault
bool isDefault
Definition: qgsvectorlayersavestyledialog.h:50
QgsVectorLayerSaveStyleDialog::SaveToDbSettings
Definition: qgsvectorlayersavestyledialog.h:44
QgsVectorLayerProperties::StyleType
StyleType
Definition: qgsvectorlayerproperties.h:66
QgsMapLayerStyleCategoriesModel
Model for layer style categories.
Definition: qgsmaplayerstylecategoriesmodel.h:35
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsVectorLayerSaveStyleDialog::SaveToDbSettings::description
QString description
Definition: qgsvectorlayersavestyledialog.h:49
QgsVectorLayerSaveStyleDialog::SaveToDbSettings::name
QString name
Definition: qgsvectorlayersavestyledialog.h:48
QgsVectorLayerSaveStyleDialog::SaveToDbSettings::uiFileContent
QString uiFileContent
Definition: qgsvectorlayersavestyledialog.h:47
qgsvectorlayerproperties.h