QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgslimitedrandomcolorrampdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslimitedrandomcolorrampdialog.h
3 ---------------------
4 begin : December 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 QGsLIMITEDRANDOMCOLORRAMPDIALOG_H
17#define QGsLIMITEDRANDOMCOLORRAMPDIALOG_H
18
19#include "ui_qgslimitedrandomcolorrampwidgetbase.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 QgsLimitedRandomColorRampWidget : public QgsPanelWidget, private Ui::QgsLimitedRandomColorRampWidgetBase
36{
37 Q_OBJECT
38 Q_PROPERTY( QgsLimitedRandomColorRamp ramp READ ramp WRITE setRamp )
39
40 public:
41
48
53 QgsLimitedRandomColorRamp ramp() const { return mRamp; }
54
60 void setRamp( const QgsLimitedRandomColorRamp &ramp );
61
62 signals:
63
65 void changed();
66
67 public slots:
68
70 void setCount( int val );
72 void setHue1( int val );
74 void setHue2( int val );
76 void setSat1( int val );
78 void setSat2( int val );
80 void setVal1( int val );
82 void setVal2( int val );
83
84 private:
85 void updatePreview();
86 void updateUi();
87
89};
90
91
97class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog
98{
99 Q_OBJECT
101
102 public:
103
110
115 QgsLimitedRandomColorRamp ramp() const { return mWidget->ramp(); }
116
122 void setRamp( const QgsLimitedRandomColorRamp &ramp ) { mWidget->setRamp( ramp ); }
123
128 QDialogButtonBox *buttonBox() const;
129
130 signals:
131
133 void changed();
134
135 private:
136 QgsLimitedRandomColorRampWidget *mWidget = nullptr;
137 QDialogButtonBox *mButtonBox = nullptr;
138
139 private slots:
140
141 void showHelp();
142};
143
144#endif
void setRamp(const QgsLimitedRandomColorRamp &ramp)
Sets the color ramp to show in the dialog.
void changed()
Emitted when the dialog settings change.
QgsLimitedRandomColorRampDialog(const QgsLimitedRandomColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsLimitedRandomColorRampDialog.
QgsLimitedRandomColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
A widget which allows users to modify the properties of a QgsLimitedRandomColorRamp.
QgsLimitedRandomColorRampWidget(const QgsLimitedRandomColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsLimitedRandomColorRampWidget.
void setCount(int val)
Sets the number of colors to create in the ramp.
void setVal1(int val)
Sets the minimum value for colors in the ramp.
void setHue2(int val)
Sets the maximum hue for colors in the ramp.
void changed()
Emitted when the dialog settings change.
void setVal2(int val)
Sets the maximum value for colors in the ramp.
void setSat2(int val)
Sets the maximum saturation for colors in the ramp.
void setRamp(const QgsLimitedRandomColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsLimitedRandomColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void setHue1(int val)
Sets the minimum hue for colors in the ramp.
void setSat1(int val)
Sets the minimum saturation for colors in the ramp.
Constrained random color ramp, which returns random colors based on preset parameters.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53