QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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:
47
52 QgsLimitedRandomColorRamp ramp() const { return mRamp; }
53
59 void setRamp( const QgsLimitedRandomColorRamp &ramp );
60
61 signals:
62
64 void changed();
65
66 public slots:
67
69 void setCount( int val );
71 void setHue1( int val );
73 void setHue2( int val );
75 void setSat1( int val );
77 void setSat2( int val );
79 void setVal1( int val );
81 void setVal2( int val );
82
83 private:
84 void updatePreview();
85 void updateUi();
86
88};
89
90
96class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog
97{
98 Q_OBJECT
99 Q_PROPERTY( QgsLimitedRandomColorRamp ramp READ ramp WRITE setRamp )
100
101 public:
108
113 QgsLimitedRandomColorRamp ramp() const { return mWidget->ramp(); }
114
120 void setRamp( const QgsLimitedRandomColorRamp &ramp ) { mWidget->setRamp( ramp ); }
121
126 QDialogButtonBox *buttonBox() const;
127
128 signals:
129
131 void changed();
132
133 private:
134 QgsLimitedRandomColorRampWidget *mWidget = nullptr;
135 QDialogButtonBox *mButtonBox = nullptr;
136
137 private slots:
138
139 void showHelp();
140};
141
142#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