QGIS API Documentation  2.6.0-Brighton
 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 
41  static QSize rampIconSize;
42 
44  void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gradientOnly; }
46  bool showGradientOnly() const { return mShowGradientOnly; }
47 
48  public slots:
49  void colorRampChanged( int index );
50 
51  protected:
54 
55  private:
56  bool mShowGradientOnly;
57 
58 };
59 
60 #endif // QGSCOLORRAMPCOMBOBOX_H