QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgsmaplayersavestyledialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayersavestyledialog.h
3 --------------------------------------
4 Date : September 2018
5 Copyright : (C) 2018 by Denis Rouzaud
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 QGSMAPLAYERSAVESTYLEDIALOG_H
17#define QGSMAPLAYERSAVESTYLEDIALOG_H
18
19// We don't want to expose this in the public API
20
21#include "ui_qgsmaplayersavestyledialog.h"
22
23#include "qgis_gui.h"
25#include "qgsmaplayer.h"
26
27#include <QDialog>
28
29#define SIP_NO_FILE
30
32
46class GUI_EXPORT QgsMapLayerSaveStyleDialog : public QDialog, private Ui::QgsMapLayerSaveStyleDialog
47{
48 Q_OBJECT
49
50 public:
52 {
53 public:
55 QString name;
56 QString description;
58 };
59
63 explicit QgsMapLayerSaveStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
64
69
73 QString outputFilePath() const;
74
79
84
90 bool saveOnlyCurrentStyle() const;
91
97 void setSaveOnlyCurrentStyle( bool saveCurrentStyle );
98
102 const QListWidget *stylesWidget();
103
109
110 public slots:
111 void accept() override;
112
113 private slots:
114 void updateSaveButtonState();
115 void showHelp();
116 void readUiFileContent( const QString &filePath );
117 void selectAll();
118 void deselectAll();
119 void invertSelection();
120
121 private:
122 void setupMultipleStyles();
123 void populateStyleComboBox();
124 QgsMapLayer *mLayer = nullptr;
126 QString mUiFileContent;
127 bool mSaveOnlyCurrentStyle = true;
128};
129
130#endif // QGSMAPLAYERSAVESTYLEDIALOG_H
QFlags< SldExportOption > SldExportOptions
Definition qgis.h:723
QString outputFilePath() const
Returns the selected file output path.
Qgis::SldExportOptions sldExportOptions() const
Returns the SLD export options.
SaveToDbSettings saveToDbSettings() const
Returns the database settings for saving the style in the DB.
void setSaveOnlyCurrentStyle(bool saveCurrentStyle)
Sets whether the user only allowed to save the current style.
bool saveOnlyCurrentStyle() const
Returns whether the user only allowed to save the current style.
QgsMapLayer::StyleCategories styleCategories() const
Returns the available style categories.
QgsLayerPropertiesDialog::StyleType currentStyleType() const
Returns the selected style storage type.
QgsMapLayerSaveStyleDialog(QgsMapLayer *layer, QWidget *parent=nullptr)
Constructor.
const QListWidget * stylesWidget()
Returns the styles list widget.
Base class for all map layer types.
Definition qgsmaplayer.h:83
QFlags< StyleCategory > StyleCategories