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 )
54 QSize sizeHint() const override;
67 void setColorRampDialogTitle( const QString &title );
74 QString colorRampDialogTitle() const;
81 bool acceptLiveUpdates()
const {
return mAcceptLiveUpdates; }
97 void setShowMenu(
bool showMenu );
104 bool showMenu()
const;
129 void setShowRandomColorRamp(
bool showRandom ) { mShowRandomColorRamp = showRandom; }
142 bool isRandomColorRamp()
const;
150 void setShowNull(
bool showNull );
157 bool showNull()
const;
173 void setContext(
const QString &context ) { mContext = context; }
229 void setRandomColorRamp();
239 void setColorRampFromName(
const QString &name = QString() );
246 void setButtonBackground(
QgsColorRamp *colorramp =
nullptr );
254 void setToDefaultColorRamp();
272 void rampWidgetUpdated();
275 bool event( QEvent *e )
override;
276 void changeEvent( QEvent *e )
override;
277 void showEvent( QShowEvent *e )
override;
278 void resizeEvent( QResizeEvent *event )
override;
283 void mousePressEvent( QMouseEvent *e )
override;
286 QString mColorRampDialogTitle;
287 bool mShowGradientOnly =
false;
288 std::unique_ptr<QgsColorRamp> mColorRamp;
289 QString mColorRampName;
292 std::unique_ptr<QgsColorRamp> mDefaultColorRamp;
294 bool mAcceptLiveUpdates =
true;
295 bool mShowRandomColorRamp =
false;
296 bool mShowNull =
false;
298 QMenu *mMenu =
nullptr;
299 QMenu *mAllRampsMenu =
nullptr;
311 void buttonClicked();
316 void showColorRampDialog();
321 void createColorRamp();
326 void saveColorRamp();
331 void invertColorRamp();
336 void loadColorRamp();