QGIS API Documentation 3.41.0-Master (d5b93354e9c)
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:
45 QgsColorBrewerColorRampWidget( const QgsColorBrewerColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46
51 QgsColorBrewerColorRamp ramp() const { return mRamp; }
52
58 void setRamp( const QgsColorBrewerColorRamp &ramp );
59
60 signals:
61
63 void changed();
64
65 private slots:
66 void setSchemeName();
67 void setColors();
68 void populateVariants();
69
70 private:
71 void updatePreview();
72 void updateUi();
73
75};
76
82class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog
83{
84 Q_OBJECT
85 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
86
87 public:
93 QgsColorBrewerColorRampDialog( const QgsColorBrewerColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
94
99 QgsColorBrewerColorRamp ramp() const { return mWidget->ramp(); }
100
106 void setRamp( const QgsColorBrewerColorRamp &ramp ) { mWidget->setRamp( ramp ); }
107
112 QDialogButtonBox *buttonBox() const;
113
114 signals:
115
117 void changed();
118
119 private:
120 QgsColorBrewerColorRampWidget *mWidget = nullptr;
121 QDialogButtonBox *mButtonBox = nullptr;
122
123 private slots:
124
125 void showHelp();
126};
127
128#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