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; }
226 void setRandomColorRamp();
234 void setColorRampFromName(
const QString &name = QString() );
241 void setButtonBackground(
QgsColorRamp *colorramp =
nullptr );
249 void setToDefaultColorRamp();
267 void rampWidgetUpdated();
271 bool event( QEvent *e )
override;
272 void changeEvent( QEvent *e )
override;
273 void showEvent( QShowEvent *e )
override;
274 void resizeEvent( QResizeEvent *event )
override;
279 void mousePressEvent( QMouseEvent *e )
override;
283 QString mColorRampDialogTitle;
284 bool mShowGradientOnly =
false;
285 std::unique_ptr< QgsColorRamp > mColorRamp;
286 QString mColorRampName;
289 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
291 bool mAcceptLiveUpdates =
true;
292 bool mShowRandomColorRamp =
false;
293 bool mShowNull =
false;
295 QMenu *mMenu =
nullptr;
296 QMenu *mAllRampsMenu =
nullptr;
308 void buttonClicked();
313 void showColorRampDialog();
318 void createColorRamp();
323 void saveColorRamp();
328 void invertColorRamp();
333 void loadColorRamp();