QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsstyleexportimportdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsstyleexportimportdialog.h
3 ---------------------
4 begin : Jan 2011
5 copyright : (C) 2011 by Alexander Bruy
6 email : alexander dot bruy at gmail dot com
7
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSSTYLEV2EXPORTIMPORTDIALOG_H
18#define QGSSTYLEV2EXPORTIMPORTDIALOG_H
19
20#include "ui_qgsstyleexportimportdialogbase.h"
21
22#include <memory>
23
24#include "qgis_gui.h"
25#include "qgis_sip.h"
26#include "qgshelp.h"
27
28#include <QDialog>
29#include <QUrl>
30
31class QgsStyle;
35class QTemporaryFile;
36
42class GUI_EXPORT QgsStyleExportImportDialog : public QDialog, private Ui::QgsStyleExportImportDialogBase
43{
44 Q_OBJECT
45
46 public:
48 enum Mode
49 {
52 };
53
60 QgsStyleExportImportDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr, Mode mode = Export );
62
68 void setImportFilePath( const QString &path );
69
74 void selectSymbols( const QStringList &symbolNames );
75
80 void deselectSymbols( const QStringList &symbolNames );
81
82 public slots:
83 void doExportImport();
84
88 void selectByGroup();
89
93 void selectAll();
94
98 void clearSelection();
99
104 void selectFavorites();
105
110 void deselectFavorites();
111
116 void selectTag( const QString &tagName );
117
122 void deselectTag( const QString &tagName );
123
128 void selectSmartgroup( const QString &groupName );
129
134 void deselectSmartgroup( const QString &groupName );
135
136 void importTypeChanged( int );
137
138 private slots:
139 void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
140 void showHelp();
141
142 void fetch();
143 void importFileChanged( const QString &path );
144
145 private:
146 enum ImportSource
147 {
148 File,
149 //Official,
150 Url,
151 };
152
153 void downloadStyleXml( const QUrl &url );
154 bool populateStyles();
155 void moveStyles( QModelIndexList *selection, QgsStyle *src, QgsStyle *dst );
156
157 QgsStyleGroupSelectionDialog *mGroupSelectionDlg = nullptr;
158 QTemporaryFile *mTempFile = nullptr;
159
160 QString mFileName;
161 Mode mDialogMode;
162
163 QgsStyleProxyModel *mModel = nullptr;
164
165 QgsStyle *mStyle = nullptr;
166 std::unique_ptr<QgsStyle> mTempStyle;
167 std::unique_ptr<QgsTemporaryCursorOverride> mCursorOverride;
168};
169
170#endif // QGSSTYLEV2EXPORTIMPORTDIALOG_H
A dialog allowing importing and exporting of entities from a QgsStyle.
@ Export
Export existing symbols mode.
QgsStyleExportImportDialog(QgsStyle *style, QWidget *parent=nullptr, Mode mode=Export)
Constructor for QgsStyleExportImportDialog, with the specified parent widget.
A dialog which presents available groups from a QgsStyle.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
A database of saved style entities, including symbols, color ramps, text formats and others.
Definition qgsstyle.h:88
Temporarily sets a cursor override for the QApplication for the lifetime of the object.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53