QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgspresetcolorrampdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspresetcolorrampdialog.h
3 ---------------------
4 begin : September 2016
5 copyright : (C) 2016 by Nyall Dawson
6 email : nyall dot dawson 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 QGSPRESETCOLORRAMPDIALOG_H
17#define QGSPRESETCOLORRAMPDIALOG_H
18
19#include <QDialog>
20#include "qgis_sip.h"
21#include "qgspanelwidget.h"
22#include "qgscolorrampimpl.h"
23#include "ui_qgspresetcolorrampwidgetbase.h"
24#include "qgis_gui.h"
25
26class QDialogButtonBox;
27
33class GUI_EXPORT QgsPresetColorRampWidget : public QgsPanelWidget, private Ui::QgsPresetColorRampWidgetBase
34{
35 Q_OBJECT
36 Q_PROPERTY( QgsPresetSchemeColorRamp ramp READ ramp WRITE setRamp )
37
38 public:
44 QgsPresetColorRampWidget( const QgsPresetSchemeColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
50 QgsPresetSchemeColorRamp ramp() const;
51
57 void setRamp( const QgsPresetSchemeColorRamp &ramp );
58
59 signals:
60
62 void changed();
63
64 private slots:
65 void setColors();
66
67 void mButtonAddColor_clicked();
68
69 void newColorChanged( const QColor &color );
70 void schemeChanged();
71
72 private:
73 void updatePreview();
75};
76
82class GUI_EXPORT QgsPresetColorRampDialog : public QDialog
83{
84 Q_OBJECT
85 Q_PROPERTY( QgsPresetSchemeColorRamp ramp READ ramp WRITE setRamp )
86
87 public:
93 QgsPresetColorRampDialog( const QgsPresetSchemeColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
94
99 QgsPresetSchemeColorRamp ramp() const { return mWidget->ramp(); }
100
106 void setRamp( const QgsPresetSchemeColorRamp &ramp ) { mWidget->setRamp( ramp ); }
107
112 QDialogButtonBox *buttonBox() const;
113
114 signals:
115
117 void changed();
118
119 private:
120 QgsPresetColorRampWidget *mWidget = nullptr;
121 QDialogButtonBox *mButtonBox = nullptr;
122
123 private slots:
124
125 void showHelp();
126};
127
128#endif //QGSPRESETCOLORRAMPDIALOG_H
Base class for any widget that can be shown as a inline panel.
A dialog which allows users to modify the properties of a QgsPresetSchemeColorRamp.
QgsPresetSchemeColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void changed()
Emitted when the dialog settings change.
void setRamp(const QgsPresetSchemeColorRamp &ramp)
Sets the color ramp to show in the dialog.
A widget which allows users to modify the properties of a QgsPresetSchemeColorRamp.
void changed()
Emitted when the dialog settings change.
A scheme based color ramp consisting of a list of predefined colors.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53