QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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 "ui_qgspresetcolorrampwidgetbase.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
28class QDialogButtonBox;
29
35class GUI_EXPORT QgsPresetColorRampWidget : public QgsPanelWidget, private Ui::QgsPresetColorRampWidgetBase
36{
37 Q_OBJECT
38 Q_PROPERTY( QgsPresetSchemeColorRamp ramp READ ramp WRITE setRamp )
39
40 public:
41
48
54
61
62 signals:
63
65 void changed();
66
67 private slots:
68 void setColors();
69
70 void mButtonAddColor_clicked();
71
72 void newColorChanged( const QColor &color );
73 void schemeChanged();
74
75 private:
76 void updatePreview();
78};
79
85class GUI_EXPORT QgsPresetColorRampDialog : public QDialog
86{
87 Q_OBJECT
88 Q_PROPERTY( QgsPresetSchemeColorRamp ramp READ ramp WRITE setRamp )
89
90 public:
91
98
103 QgsPresetSchemeColorRamp ramp() const { return mWidget->ramp(); }
104
110 void setRamp( const QgsPresetSchemeColorRamp &ramp ) { mWidget->setRamp( ramp ); }
111
116 QDialogButtonBox *buttonBox() const;
117
118 signals:
119
121 void changed();
122
123 private:
124 QgsPresetColorRampWidget *mWidget = nullptr;
125 QDialogButtonBox *mButtonBox = nullptr;
126
127 private slots:
128
129 void showHelp();
130};
131
132#endif //QGSPRESETCOLORRAMPDIALOG_H
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
QgsPresetSchemeColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
QgsPresetSchemeColorRamp ramp
void changed()
Emitted when the dialog settings change.
void setRamp(const QgsPresetSchemeColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsPresetColorRampDialog(const QgsPresetSchemeColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsPresetColorRampDialog.
A widget which allows users to modify the properties of a QgsPresetSchemeColorRamp.
void setRamp(const QgsPresetSchemeColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsPresetSchemeColorRamp ramp
QgsPresetColorRampWidget(const QgsPresetSchemeColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsPresetColorRampWidget.
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