QGIS API Documentation  2.14.0-Essen
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 
23 class GUI_EXPORT QgsColorRampComboBox : public QComboBox
24 {
25  Q_OBJECT
26  public:
27  explicit QgsColorRampComboBox( QWidget *parent = nullptr );
28 
30 
32  void populate( QgsStyleV2* style );
33 
35  void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp );
36 
38  QgsVectorColorRampV2* currentColorRamp();
39 
44  bool createNewColorRampSelected() const;
45 
48 
50  void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
52  bool showGradientOnly() const { return mShowGradientOnly; }
53 
54  public slots:
55  void colorRampChanged( int index );
56 
62  void editSourceRamp();
63 
64  signals:
65 
70  void sourceRampEdited();
71 
72  protected:
75 
76  private:
77  bool mShowGradientOnly;
78 
79 };
80 
81 #endif // QGSCOLORRAMPCOMBOBOX_H
static unsigned index
bool showGradientOnly() const
QgsVectorColorRampV2 * mSourceColorRamp
void setShowGradientOnly(bool gradientOnly)