QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 = 0 );
28 
30 
32  void populate( QgsStyleV2* style );
33 
35  void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp );
36 
38  QgsVectorColorRampV2* currentColorRamp();
39 
44  bool createNewColorRampSelected() const;
45 
47  static QSize rampIconSize;
48 
50  void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
52  bool showGradientOnly() const { return mShowGradientOnly; }
53 
54  public slots:
55  void colorRampChanged( int index );
56 
57  protected:
60 
61  private:
62  bool mShowGradientOnly;
63 
64 };
65 
66 #endif // QGSCOLORRAMPCOMBOBOX_H