QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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:
39
45 QgsPresetColorRampWidget( const QgsPresetSchemeColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46
51 QgsPresetSchemeColorRamp ramp() const;
52
58 void setRamp( const QgsPresetSchemeColorRamp &ramp );
59
60 signals:
61
63 void changed();
64
65 private slots:
66 void setColors();
67
68 void mButtonAddColor_clicked();
69
70 void newColorChanged( const QColor &color );
71 void schemeChanged();
72
73 private:
74
75 void updatePreview();
77};
78
84class GUI_EXPORT QgsPresetColorRampDialog : public QDialog
85{
86 Q_OBJECT
87 Q_PROPERTY( QgsPresetSchemeColorRamp ramp READ ramp WRITE setRamp )
88
89 public:
90
96 QgsPresetColorRampDialog( const QgsPresetSchemeColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
97
102 QgsPresetSchemeColorRamp ramp() const { return mWidget->ramp(); }
103
109 void setRamp( const QgsPresetSchemeColorRamp &ramp ) { mWidget->setRamp( ramp ); }
110
115 QDialogButtonBox *buttonBox() const;
116
117 signals:
118
120 void changed();
121
122 private:
123
124 QgsPresetColorRampWidget *mWidget = nullptr;
125 QDialogButtonBox *mButtonBox = nullptr;
126
127 private slots:
128
129 void showHelp();
130
131};
132
133#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