QGIS API Documentation  2.99.0-Master (37c43df)
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 QgsStyle;
21 class QgsColorRamp;
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( QgsStyle* style );
36 
42  void setSourceColorRamp( QgsColorRamp* sourceRamp );
43 
48  QgsColorRamp* currentColorRamp() const;
49 
54  bool createNewColorRampSelected() const;
55 
57  static QSize rampIconSize;
58 
60  void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
62  bool showGradientOnly() const { return mShowGradientOnly; }
63 
64  public slots:
65  void colorRampChanged( int index );
66 
72  void editSourceRamp();
73 
74  signals:
75 
80  void sourceRampEdited();
81 
82  protected:
84  QgsColorRamp* mSourceColorRamp; // owns the copy
85 
86  private slots:
87 
88  void rampWidgetUpdated();
89 
90  private:
91  bool mShowGradientOnly;
92 
93 };
94 
95 #endif // QGSCOLORRAMPCOMBOBOX_H
static unsigned index
QgsColorRamp * mSourceColorRamp
Abstract base class for color ramps.
Definition: qgscolorramp.h:29
void setShowGradientOnly(bool gradientOnly)