QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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 <QDialog>
20#include "qgis_sip.h"
21#include "qgspanelwidget.h"
22#include "qgscolorrampimpl.h"
23#include "ui_qgslimitedrandomcolorrampwidgetbase.h"
24#include "qgis_gui.h"
25
26class QDialogButtonBox;
27
33class GUI_EXPORT QgsLimitedRandomColorRampWidget : public QgsPanelWidget, private Ui::QgsLimitedRandomColorRampWidgetBase
34{
35 Q_OBJECT
36 Q_PROPERTY( QgsLimitedRandomColorRamp ramp READ ramp WRITE setRamp )
37
38 public:
39
45 QgsLimitedRandomColorRampWidget( const QgsLimitedRandomColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46
51 QgsLimitedRandomColorRamp ramp() const { return mRamp; }
52
58 void setRamp( const QgsLimitedRandomColorRamp &ramp );
59
60 signals:
61
63 void changed();
64
65 public slots:
66
68 void setCount( int val );
70 void setHue1( int val );
72 void setHue2( int val );
74 void setSat1( int val );
76 void setSat2( int val );
78 void setVal1( int val );
80 void setVal2( int val );
81
82 private:
83
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:
102
108 QgsLimitedRandomColorRampDialog( const QgsLimitedRandomColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
109
114 QgsLimitedRandomColorRamp ramp() const { return mWidget->ramp(); }
115
121 void setRamp( const QgsLimitedRandomColorRamp &ramp ) { mWidget->setRamp( ramp ); }
122
127 QDialogButtonBox *buttonBox() const;
128
129 signals:
130
132 void changed();
133
134 private:
135
136 QgsLimitedRandomColorRampWidget *mWidget = nullptr;
137 QDialogButtonBox *mButtonBox = nullptr;
138
139 private slots:
140
141 void showHelp();
142
143};
144
145#endif
A dialog which allows users to modify the properties of a QgsLimitedRandomColorRamp.
void setRamp(const QgsLimitedRandomColorRamp &ramp)
Sets the color ramp to show in the dialog.
void changed()
Emitted when the dialog settings change.
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.
void changed()
Emitted when the dialog settings change.
QgsLimitedRandomColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
Constrained random color ramp, which returns random colors based on preset parameters.
Base class for any widget that can be shown as a inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53