QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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#define SIP_NO_FILE
21
22#include "ui_qgsvectorlayerloadstyledialog.h"
23
24#include "qgis_gui.h"
25#include "qgsmaplayer.h"
27
29
42class GUI_EXPORT QgsMapLayerLoadStyleDialog : public QDialog, private Ui::QgsVectorLayerLoadStyleDialog
43{
44 Q_OBJECT
45 public:
49 explicit QgsMapLayerLoadStyleDialog( QgsMapLayer *layer, QWidget *parent = nullptr );
50
55
60
66 QString fileExtension() const;
67
73 QString filePath() const;
74
78 void initializeLists( const QStringList &ids, const QStringList &names, const QStringList &descriptions, int sectionLimit );
79
83 QString selectedStyleId();
84
85 public slots:
86 void accept() override;
87
88 private slots:
89 void updateLoadButtonState();
90 void onRelatedTableSelectionChanged();
91 void onOthersTableSelectionChanged();
92 void deleteStyleFromDB();
93 void showHelp();
94 void selectAll();
95 void deselectAll();
96 void invertSelection();
97
98 private:
99 void selectionChanged( QTableWidget *styleTable );
100
101 QgsMapLayer *mLayer = nullptr;
103 QString mSelectedStyleId;
104 QString mSelectedStyleName;
105 int mSectionLimit = 0;
106 QPushButton *mDeleteButton = nullptr;
107 QPushButton *mLoadButton = nullptr;
108 QPushButton *mCancelButton = nullptr;
109};
110
111#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.
QgsLayerPropertiesDialog::StyleType currentStyleType() const
Returns the selected style type.
Base class for all map layer types.
Definition qgsmaplayer.h:80
QFlags< StyleCategory > StyleCategories