QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgscolorrampcombobox.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscolorrampcombobox.h
3  ---------------------
4  begin : October 2010
5  copyright : (C) 2010 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 #ifndef QGSCOLORRAMPCOMBOBOX_H
16 #define QGSCOLORRAMPCOMBOBOX_H
17 
18 #include <QComboBox>
19 
20 class QgsStyleV2;
22 
26 class GUI_EXPORT QgsColorRampComboBox : public QComboBox
27 {
28  Q_OBJECT
29  public:
30  explicit QgsColorRampComboBox( QWidget *parent = nullptr );
31 
33 
35  void populate( QgsStyleV2* style );
36 
38  void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp );
39 
41  QgsVectorColorRampV2* currentColorRamp();
42 
47  bool createNewColorRampSelected() const;
48 
51 
53  void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
55  bool showGradientOnly() const { return mShowGradientOnly; }
56 
57  public slots:
58  void colorRampChanged( int index );
59 
65  void editSourceRamp();
66 
67  signals:
68 
73  void sourceRampEdited();
74 
75  protected:
78 
79  private:
80  bool mShowGradientOnly;
81 
82 };
83 
84 #endif // QGSCOLORRAMPCOMBOBOX_H
static unsigned index
QgsVectorColorRampV2 * mSourceColorRamp
void setShowGradientOnly(bool gradientOnly)
Abstract base class for color ramps.