QGIS API Documentation 4.3.0-Master (0cfde48c85b)
Loading...
Searching...
No Matches
qgscolorbrewercolorrampdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscolorbrewercolorrampdialog.h
3 ---------------------
4 begin : November 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 QGSCOLORBREWERCOLORRAMPDIALOG_H
17#define QGSCOLORBREWERCOLORRAMPDIALOG_H
18
19#include "ui_qgscolorbrewercolorrampwidgetbase.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
29class QDialogButtonBox;
30
36class GUI_EXPORT QgsColorBrewerColorRampWidget : public QgsPanelWidget, private Ui::QgsColorBrewerColorRampWidgetBase
37{
38 Q_OBJECT
39 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
40
41 public:
48
53 QgsColorBrewerColorRamp ramp() const { return mRamp; }
54
60 void setRamp( const QgsColorBrewerColorRamp &ramp );
61
62 private slots:
63 void setSchemeName();
64 void setColors();
65 void populateVariants();
66
67 private:
68 void updatePreview();
69 void updateUi();
70
72};
73
79class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog
80{
81 Q_OBJECT
82 Q_PROPERTY( QgsColorBrewerColorRamp ramp READ ramp WRITE setRamp )
83
84 public:
91
96 QgsColorBrewerColorRamp ramp() const { return mWidget->ramp(); }
97
103 void setRamp( const QgsColorBrewerColorRamp &ramp ) { mWidget->setRamp( ramp ); }
104
109 QDialogButtonBox *buttonBox() const;
110
111 signals:
112
114 void changed();
115
116 private:
117 QgsColorBrewerColorRampWidget *mWidget = nullptr;
118 QDialogButtonBox *mButtonBox = nullptr;
119
120 private slots:
121
122 void showHelp();
123};
124
125#endif
QgsColorBrewerColorRampDialog(const QgsColorBrewerColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsColorBrewerColorRampDialog.
void changed()
Emitted when the dialog settings change.
QgsColorBrewerColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void setRamp(const QgsColorBrewerColorRamp &ramp)
Sets the color ramp to show in the dialog.
A widget which allows users to modify the properties of a QgsColorBrewerColorRamp.
void setRamp(const QgsColorBrewerColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsColorBrewerColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
QgsColorBrewerColorRampWidget(const QgsColorBrewerColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsColorBrewerColorRampWidget.
Color ramp utilising "Color Brewer" preset color schemes.
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