38 Q_PROPERTY( QString colorRampDialogTitle READ colorRampDialogTitle WRITE setColorRampDialogTitle )
39 Q_PROPERTY(
bool acceptLiveUpdates READ acceptLiveUpdates WRITE setAcceptLiveUpdates )
40 Q_PROPERTY(
bool showMenu READ showMenu WRITE setShowMenu )
41 Q_PROPERTY(
QgsColorRamp *defaultColorRamp READ defaultColorRamp WRITE setDefaultColorRamp )
42 Q_PROPERTY( QString context READ context WRITE setContext )
55 QSize sizeHint() const override;
68 void setColorRampDialogTitle( const QString &title );
75 QString colorRampDialogTitle() const;
82 bool acceptLiveUpdates()
const {
return mAcceptLiveUpdates; }
98 void setShowMenu(
bool showMenu );
105 bool showMenu()
const;
130 void setShowRandomColorRamp(
bool showRandom ) { mShowRandomColorRamp = showRandom; }
143 bool isRandomColorRamp()
const;
151 void setShowNull(
bool showNull );
158 bool showNull()
const;
174 void setContext(
const QString &context ) { mContext = context; }
230 void setRandomColorRamp();
240 void setColorRampFromName(
const QString &name = QString() );
247 void setButtonBackground(
QgsColorRamp *colorramp =
nullptr );
255 void setToDefaultColorRamp();
273 void rampWidgetUpdated();
277 bool event( QEvent *e )
override;
278 void changeEvent( QEvent *e )
override;
279 void showEvent( QShowEvent *e )
override;
280 void resizeEvent( QResizeEvent *event )
override;
285 void mousePressEvent( QMouseEvent *e )
override;
289 QString mColorRampDialogTitle;
290 bool mShowGradientOnly =
false;
291 std::unique_ptr< QgsColorRamp > mColorRamp;
292 QString mColorRampName;
295 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
297 bool mAcceptLiveUpdates =
true;
298 bool mShowRandomColorRamp =
false;
299 bool mShowNull =
false;
301 QMenu *mMenu =
nullptr;
302 QMenu *mAllRampsMenu =
nullptr;
314 void buttonClicked();
319 void showColorRampDialog();
324 void createColorRamp();
329 void saveColorRamp();
334 void invertColorRamp();
339 void loadColorRamp();