QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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:
47
53
60
61 signals:
62
64 void changed();
65
66 private slots:
67 void setColors();
68
69 void mButtonAddColor_clicked();
70
71 void newColorChanged( const QColor &color );
72 void schemeChanged();
73
74 private:
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:
96
101 QgsPresetSchemeColorRamp ramp() const { return mWidget->ramp(); }
102
108 void setRamp( const QgsPresetSchemeColorRamp &ramp ) { mWidget->setRamp( ramp ); }
109
114 QDialogButtonBox *buttonBox() const;
115
116 signals:
117
119 void changed();
120
121 private:
122 QgsPresetColorRampWidget *mWidget = nullptr;
123 QDialogButtonBox *mButtonBox = nullptr;
124
125 private slots:
126
127 void showHelp();
128};
129
130#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