QGIS API Documentation 3.99.0-Master (7d2ca374f2d)
Loading...
Searching...
No Matches
qgsmaplayerloadstyledialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayerloadstyledialog.h
3 ---------------------
4 begin : April 2013
5 copyright : (C) 2013 by Emilio Loi
6 email : loi at faunalia dot it
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 QGSMAPLAYERLOADSTYLEDIALOG_H
17#define QGSMAPLAYERLOADSTYLEDIALOG_H
18
19// We don't want to expose this in the public API
20
21#include "ui_qgsvectorlayerloadstyledialog.h"
22
23#include "qgis_gui.h"
24#include "qgsmaplayer.h"
26
27#define SIP_NO_FILE
28
30
43class GUI_EXPORT QgsMapLayerLoadStyleDialog : public QDialog, private Ui::QgsVectorLayerLoadStyleDialog
44{
45 Q_OBJECT
46 public:
50 explicit QgsMapLayerLoadStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
51
56
61
67 QString fileExtension() const;
68
74 QString filePath() const;
75
79 void initializeLists( const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit );
80
84 QString selectedStyleId();
85
92
93 public slots:
94 void accept() override;
95
96 private slots:
97 void updateLoadButtonState();
98 void onRelatedTableSelectionChanged();
99 void onOthersTableSelectionChanged();
100 void deleteStyleFromDB();
101 void showHelp();
102 void selectAll();
103 void deselectAll();
104 void invertSelection();
105
106 private:
107 void selectionChanged( QTableWidget *styleTable );
108
109 QgsMapLayer *mLayer = nullptr;
111 QString mSelectedStyleId;
112 QString mSelectedStyleName;
113 int mSectionLimit = 0;
114 QPushButton *mDeleteButton = nullptr;
115 QPushButton *mLoadButton = nullptr;
116 QPushButton *mCancelButton = nullptr;
117};
118
119#endif //QGSMAPLAYERLOADSTYLEDIALOG_H
QgsMapLayer::StyleCategories styleCategories() const
Returns the list of selected style categories the user has opted to load.
void initializeLists(const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit)
Initialize list of database stored styles.
QString selectedStyleId()
Returns the ID of the selected database stored style.
QgsMapLayerLoadStyleDialog(QgsMapLayer *layer, QWidget *parent=nullptr)
Constructor for QgsMapLayerLoadStyleDialog, associated with the specified map layer.
QString filePath() const
Returns the full path to the selected layer style source file.
QString fileExtension() const
Returns the file extension for the selected layer style source file.
void allowLoadingOnlyFromFiles()
Do not allow loading styles from databases, only from files.
QgsLayerPropertiesDialog::StyleType currentStyleType() const
Returns the selected style type.
Base class for all map layer types.
Definition qgsmaplayer.h:83
QFlags< StyleCategory > StyleCategories