QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 <QDialog>
21#include <QUrl>
22
23#include "ui_qgsstyleexportimportdialogbase.h"
24#include "qgis_gui.h"
25#include "qgis_sip.h"
26#include "qgshelp.h"
27
28#include <memory>
29
30class QgsStyle;
34class QTemporaryFile;
35
40class GUI_EXPORT QgsStyleExportImportDialog : public QDialog, private Ui::QgsStyleExportImportDialogBase
41{
42 Q_OBJECT
43
44 public:
46 enum Mode
47 {
50 };
51
58 QgsStyleExportImportDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr, Mode mode = Export );
60
66 void setImportFilePath( const QString &path );
67
72 void selectSymbols( const QStringList &symbolNames );
73
78 void deselectSymbols( const QStringList &symbolNames );
79
80 public slots:
81 void doExportImport();
82
86 void selectByGroup();
87
91 void selectAll();
92
96 void clearSelection();
97
102 void selectFavorites();
103
108 void deselectFavorites();
109
114 void selectTag( const QString &tagName );
115
120 void deselectTag( const QString &tagName );
121
126 void selectSmartgroup( const QString &groupName );
127
132 void deselectSmartgroup( const QString &groupName );
133
134 void importTypeChanged( int );
135
136 private slots:
137 void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
138 void showHelp();
139
140 void fetch();
141 void importFileChanged( const QString &path );
142
143 private:
144 enum ImportSource
145 {
146 File,
147 //Official,
148 Url,
149 };
150
151 void downloadStyleXml( const QUrl &url );
152 bool populateStyles();
153 void moveStyles( QModelIndexList *selection, QgsStyle *src, QgsStyle *dst );
154
155 QgsStyleGroupSelectionDialog *mGroupSelectionDlg = nullptr;
156 QTemporaryFile *mTempFile = nullptr;
157
158 QString mFileName;
159 Mode mDialogMode;
160
161 QgsStyleProxyModel *mModel = nullptr;
162
163 QgsStyle *mStyle = nullptr;
164 std::unique_ptr<QgsStyle> mTempStyle;
165 std::unique_ptr<QgsTemporaryCursorOverride> mCursorOverride;
166};
167
168#endif // QGSSTYLEV2EXPORTIMPORTDIALOG_H
@ Export
Export existing symbols mode.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
Temporarily sets a cursor override for the QApplication for the lifetime of the object.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53