QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgspresetcolorrampdialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgspresetcolorrampdialog.h
3
---------------------
4
begin : September 2016
5
copyright : (C) 2016 by Nyall Dawson
6
email : nyall dot dawson 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 QGSPRESETCOLORRAMPDIALOG_H
17
#define QGSPRESETCOLORRAMPDIALOG_H
18
19
#include "ui_qgspresetcolorrampwidgetbase.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
28
class
QDialogButtonBox;
29
35
class
GUI_EXPORT
QgsPresetColorRampWidget
:
public
QgsPanelWidget
,
private
Ui::QgsPresetColorRampWidgetBase
36
{
37
Q_OBJECT
38
Q_PROPERTY(
QgsPresetSchemeColorRamp
ramp
READ
ramp
WRITE
setRamp
)
39
40
public
:
46
QgsPresetColorRampWidget
(
const
QgsPresetSchemeColorRamp
&
ramp
, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
47
52
QgsPresetSchemeColorRamp
ramp
()
const
;
53
59
void
setRamp
(
const
QgsPresetSchemeColorRamp
&
ramp
);
60
61
private
slots:
62
void
setColors();
63
64
void
mButtonAddColor_clicked();
65
66
void
newColorChanged(
const
QColor &color );
67
void
schemeChanged();
68
69
private
:
70
void
updatePreview();
71
QgsPresetSchemeColorRamp
mRamp;
72
};
73
79
class
GUI_EXPORT
QgsPresetColorRampDialog
:
public
QDialog
80
{
81
Q_OBJECT
82
Q_PROPERTY(
QgsPresetSchemeColorRamp
ramp
READ
ramp
WRITE
setRamp
)
83
84
public
:
90
QgsPresetColorRampDialog
(
const
QgsPresetSchemeColorRamp
&
ramp
, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
91
96
QgsPresetSchemeColorRamp
ramp
()
const
{
return
mWidget->ramp(); }
97
103
void
setRamp
(
const
QgsPresetSchemeColorRamp
&
ramp
) { mWidget->setRamp(
ramp
); }
104
109
QDialogButtonBox *buttonBox()
const
;
110
111
signals:
112
114
void
changed
();
115
116
private
:
117
QgsPresetColorRampWidget
*mWidget =
nullptr
;
118
QDialogButtonBox *mButtonBox =
nullptr
;
119
120
private
slots:
121
122
void
showHelp();
123
};
124
125
#endif
//QGSPRESETCOLORRAMPDIALOG_H
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
QgsPresetColorRampDialog::ramp
QgsPresetSchemeColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
Definition
qgspresetcolorrampdialog.h:96
QgsPresetColorRampDialog::ramp
QgsPresetSchemeColorRamp ramp
Definition
qgspresetcolorrampdialog.h:82
QgsPresetColorRampDialog::changed
void changed()
Emitted when the dialog settings change.
QgsPresetColorRampDialog::setRamp
void setRamp(const QgsPresetSchemeColorRamp &ramp)
Sets the color ramp to show in the dialog.
Definition
qgspresetcolorrampdialog.h:103
QgsPresetColorRampDialog::QgsPresetColorRampDialog
QgsPresetColorRampDialog(const QgsPresetSchemeColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsPresetColorRampDialog.
Definition
qgspresetcolorrampdialog.cpp:116
QgsPresetColorRampWidget
A widget which allows users to modify the properties of a QgsPresetSchemeColorRamp.
Definition
qgspresetcolorrampdialog.h:36
QgsPresetColorRampWidget::setRamp
void setRamp(const QgsPresetSchemeColorRamp &ramp)
Sets the color ramp to show in the dialog.
Definition
qgspresetcolorrampdialog.cpp:57
QgsPresetColorRampWidget::ramp
QgsPresetSchemeColorRamp ramp
Definition
qgspresetcolorrampdialog.h:38
QgsPresetColorRampWidget::QgsPresetColorRampWidget
QgsPresetColorRampWidget(const QgsPresetSchemeColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsPresetColorRampWidget.
Definition
qgspresetcolorrampdialog.cpp:32
QgsPresetSchemeColorRamp
A scheme based color ramp consisting of a list of predefined colors.
Definition
qgscolorrampimpl.h:533
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgscolorrampimpl.h
qgspanelwidget.h
Generated on
for QGIS API Documentation by
1.17.0