2013-06-22 19:37:41 +02:00
|
|
|
class QgsColorRampComboBox : QComboBox
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgscolorrampcombobox.h>
|
|
|
|
%End
|
|
|
|
public:
|
2015-02-18 17:00:36 +11:00
|
|
|
QgsColorRampComboBox( QWidget *parent /TransferThis/ = 0 );
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
~QgsColorRampComboBox();
|
|
|
|
|
|
|
|
//! initialize the combo box with color ramps from the style
|
|
|
|
void populate( QgsStyleV2* style );
|
|
|
|
|
|
|
|
//! add/select color ramp which was used previously by the renderer
|
|
|
|
void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp );
|
|
|
|
|
|
|
|
//! return new instance of the current color ramp or NULL if there is no active color ramp
|
|
|
|
QgsVectorColorRampV2* currentColorRamp();
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Returns true if the current selection in the combo box is the option for creating
|
2014-11-24 20:03:41 +11:00
|
|
|
* a new color ramp
|
|
|
|
* @note added in QGIS 2.7
|
|
|
|
*/
|
|
|
|
bool createNewColorRampSelected() const;
|
|
|
|
|
2014-01-28 00:26:03 +01:00
|
|
|
//! @note not available in python bindings
|
|
|
|
// static QSize rampIconSize;
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2014-02-14 19:18:10 +07:00
|
|
|
//! @note added in 2.2
|
2014-01-26 18:35:21 +01:00
|
|
|
void setShowGradientOnly( bool gradientOnly );
|
2014-02-14 19:18:10 +07:00
|
|
|
//! @note added in 2.2
|
|
|
|
bool showGradientOnly() const;
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
public slots:
|
|
|
|
void colorRampChanged( int index );
|
2015-08-04 16:23:06 +10:00
|
|
|
|
|
|
|
/** Triggers a dialog which allows users to edit the current source
|
|
|
|
* ramp for the combo box.
|
|
|
|
* @see sourceRampEdited
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
|
|
|
void editSourceRamp();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
/** Emitted when the user has edited the current source ramp.
|
|
|
|
* @see editSourceRamp
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
|
|
|
void sourceRampEdited();
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|