QGIS API Documentation 4.3.0-Master (0cfde48c85b)
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 public slots:
62
64 void setCount( int val );
66 void setHue1( int val );
68 void setHue2( int val );
70 void setSat1( int val );
72 void setSat2( int val );
74 void setVal1( int val );
76 void setVal2( int val );
77
78 private:
79 void updatePreview();
80 void updateUi();
81
83};
84
85
91class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog
92{
93 Q_OBJECT
94 Q_PROPERTY( QgsLimitedRandomColorRamp ramp READ ramp WRITE setRamp )
95
96 public:
103
108 QgsLimitedRandomColorRamp ramp() const { return mWidget->ramp(); }
109
115 void setRamp( const QgsLimitedRandomColorRamp &ramp ) { mWidget->setRamp( ramp ); }
116
121 QDialogButtonBox *buttonBox() const;
122
123 signals:
124
126 void changed();
127
128 private:
129 QgsLimitedRandomColorRampWidget *mWidget = nullptr;
130 QDialogButtonBox *mButtonBox = nullptr;
131
132 private slots:
133
134 void showHelp();
135};
136
137#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 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.
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:52