QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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#define SIP_NO_FILE
21
22#include "ui_qgsmaplayersavestyledialog.h"
23
24#include "qgis_gui.h"
26#include "qgsmaplayer.h"
27
28#include <QDialog>
29
31
45class GUI_EXPORT QgsMapLayerSaveStyleDialog : public QDialog, private Ui::QgsMapLayerSaveStyleDialog
46{
47 Q_OBJECT
48
49 public:
51 {
52 public:
54 QString name;
55 QString description;
57 };
58
62 explicit QgsMapLayerSaveStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
63
68
72 QString outputFilePath() const;
73
78
83
89 bool saveOnlyCurrentStyle() const;
90
96 void setSaveOnlyCurrentStyle( bool saveCurrentStyle );
97
101 const QListWidget *stylesWidget();
102
108
109 public slots:
110 void accept() override;
111
112 private slots:
113 void updateSaveButtonState();
114 void showHelp();
115 void readUiFileContent( const QString &filePath );
116 void selectAll();
117 void deselectAll();
118 void invertSelection();
119
120 private:
121 void setupMultipleStyles();
122 void populateStyleComboBox();
123 QgsMapLayer *mLayer = nullptr;
125 QString mUiFileContent;
126 bool mSaveOnlyCurrentStyle = true;
127};
128
129#endif // QGSMAPLAYERSAVESTYLEDIALOG_H
QFlags< SldExportOption > SldExportOptions
Definition qgis.h:702
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:80
QFlags< StyleCategory > StyleCategories