QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgscolorbrewercolorrampdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscolorbrewercolorrampdialog.h
3 ---------------------
4 begin : November 2009
5 copyright : (C) 2009 by Martin Dobias
6 email : wonder dot sk at gmail dot com
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 QGSCOLORBREWERCOLORRAMPDIALOG_H
17#define QGSCOLORBREWERCOLORRAMPDIALOG_H
18
19#include "ui_qgscolorbrewercolorrampwidgetbase.h"
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23#include "qgscolorrampimpl.h"
24#include "qgspanelwidget.h"
25
26#include <QDialog>
27
29class QDialogButtonBox;
30
36class GUI_EXPORT QgsColorBrewerColorRampWidget : public QgsPanelWidget, private Ui::QgsColorBrewerColorRampWidgetBase
37{
38 Q_OBJECT
39 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
40
41 public:
42
49
54 QgsColorBrewerColorRamp ramp() const { return mRamp; }
55
61 void setRamp( const QgsColorBrewerColorRamp &ramp );
62
63 signals:
64
66 void changed();
67
68 private slots:
69 void setSchemeName();
70 void setColors();
71 void populateVariants();
72
73 private:
74 void updatePreview();
75 void updateUi();
76
78};
79
85class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog
86{
87 Q_OBJECT
88 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
89
90 public:
91
98
103 QgsColorBrewerColorRamp ramp() const { return mWidget->ramp(); }
104
110 void setRamp( const QgsColorBrewerColorRamp &ramp ) { mWidget->setRamp( ramp ); }
111
116 QDialogButtonBox *buttonBox() const;
117
118 signals:
119
121 void changed();
122
123 private:
124 QgsColorBrewerColorRampWidget *mWidget = nullptr;
125 QDialogButtonBox *mButtonBox = nullptr;
126
127 private slots:
128
129 void showHelp();
130};
131
132#endif
QgsColorBrewerColorRampDialog(const QgsColorBrewerColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsColorBrewerColorRampDialog.
void changed()
Emitted when the dialog settings change.
QgsColorBrewerColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void setRamp(const QgsColorBrewerColorRamp &ramp)
Sets the color ramp to show in the dialog.
A widget which allows users to modify the properties of a QgsColorBrewerColorRamp.
void setRamp(const QgsColorBrewerColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsColorBrewerColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void changed()
Emitted when the dialog settings change.
QgsColorBrewerColorRampWidget(const QgsColorBrewerColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsColorBrewerColorRampWidget.
Color ramp utilising "Color Brewer" preset color schemes.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53