QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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:
44 QgsLimitedRandomColorRampWidget( const QgsLimitedRandomColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
50 QgsLimitedRandomColorRamp ramp() const { return mRamp; }
51
57 void setRamp( const QgsLimitedRandomColorRamp &ramp );
58
59 signals:
60
62 void changed();
63
64 public slots:
65
67 void setCount( int val );
69 void setHue1( int val );
71 void setHue2( int val );
73 void setSat1( int val );
75 void setSat2( int val );
77 void setVal1( int val );
79 void setVal2( int val );
80
81 private:
82 void updatePreview();
83 void updateUi();
84
86};
87
88
94class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog
95{
96 Q_OBJECT
97 Q_PROPERTY( QgsLimitedRandomColorRamp ramp READ ramp WRITE setRamp )
98
99 public:
105 QgsLimitedRandomColorRampDialog( const QgsLimitedRandomColorRamp &ramp, QWidget *parent SIP_TRANSFERTHIS = nullptr );
106
111 QgsLimitedRandomColorRamp ramp() const { return mWidget->ramp(); }
112
118 void setRamp( const QgsLimitedRandomColorRamp &ramp ) { mWidget->setRamp( ramp ); }
119
124 QDialogButtonBox *buttonBox() const;
125
126 signals:
127
129 void changed();
130
131 private:
132 QgsLimitedRandomColorRampWidget *mWidget = nullptr;
133 QDialogButtonBox *mButtonBox = nullptr;
134
135 private slots:
136
137 void showHelp();
138};
139
140#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