QGIS API Documentation 3.41.0-Master (3440c17df1d)
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 <QDialog>
20#include "qgspanelwidget.h"
21#include "qgscolorrampimpl.h"
22#include "ui_qgscolorbrewercolorrampwidgetbase.h"
23#include "qgis_gui.h"
24#include "qgis_sip.h"
25
27class QDialogButtonBox;
28
34class GUI_EXPORT QgsColorBrewerColorRampWidget : public QgsPanelWidget, private Ui::QgsColorBrewerColorRampWidgetBase
35{
36 Q_OBJECT
37 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
38
39 public:
40
46 QgsColorBrewerColorRampWidget( const QgsColorBrewerColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
47
52 QgsColorBrewerColorRamp ramp() const { return mRamp; }
53
59 void setRamp( const QgsColorBrewerColorRamp &ramp );
60
61 signals:
62
64 void changed();
65
66 private slots:
67 void setSchemeName();
68 void setColors();
69 void populateVariants();
70
71 private:
72
73 void updatePreview();
74 void updateUi();
75
77};
78
84class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog
85{
86 Q_OBJECT
87 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
88
89 public:
90
96 QgsColorBrewerColorRampDialog( const QgsColorBrewerColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
97
102 QgsColorBrewerColorRamp ramp() const { return mWidget->ramp(); }
103
109 void setRamp( const QgsColorBrewerColorRamp &ramp ) { mWidget->setRamp( ramp ); }
110
115 QDialogButtonBox *buttonBox() const;
116
117 signals:
118
120 void changed();
121
122 private:
123
124 QgsColorBrewerColorRampWidget *mWidget = nullptr;
125 QDialogButtonBox *mButtonBox = nullptr;
126
127 private slots:
128
129 void showHelp();
130
131};
132
133#endif
A dialog which allows users to modify the properties of a QgsColorBrewerColorRamp.
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.
QgsColorBrewerColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void changed()
Emitted when the dialog settings change.
Color ramp utilising "Color Brewer" preset color schemes.
Base class for any widget that can be shown as a inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53