@@ -25,11 +25,10 @@ class QgsColorRampButton : QToolButton
25
25
26
26
virtual QSize sizeHint() const;
27
27
28
- /** Return the current color ramp.
29
- * @returns currently selected color
30
- * @see setColor
28
+ /** Return a copy of the current color ramp.
29
+ * @see setColorRamp()
31
30
*/
32
- QgsColorRamp* colorRamp() const;
31
+ QgsColorRamp* colorRamp() const /Factory/ ;
33
32
34
33
/** Set the title for the color ramp dialog window.
35
34
* @param title Title for the color ramp dialog
@@ -72,18 +71,18 @@ class QgsColorRampButton : QToolButton
72
71
/** Sets the default color ramp for the button, which is shown in the button's drop down menu for the
73
72
* "default color ramp" option.
74
73
* @param colorramp default color ramp for the button. Set to a null pointer to disable the default color
75
- * ramp option.
74
+ * ramp option. The ramp will be cloned and ownership is not transferred.
76
75
* @see defaultColorRamp
77
76
*/
78
77
void setDefaultColorRamp( QgsColorRamp* colorramp );
79
78
80
- /** Returns the default color ramp for the button, which is shown in the button's drop down menu for the
79
+ /** Returns a copy of the default color ramp for the button, which is shown in the button's drop down menu for the
81
80
* "default color ramp" option.
82
81
* @returns default color ramp for the button. Returns a null pointer if the default color ramp
83
82
* option is disabled.
84
83
* @see setDefaultColorRamp
85
84
*/
86
- QgsColorRamp* defaultColorRamp() const;
85
+ QgsColorRamp* defaultColorRamp() const /Factory/ ;
87
86
88
87
/** Sets whether a random colors option is shown in the button's drop down menu.
89
88
* @param showNull set to true to show a null option
@@ -152,7 +151,7 @@ class QgsColorRampButton : QToolButton
152
151
153
152
/** Sets the current color ramp for the button. Will emit a colorRampChanged() signal if the color ramp is different
154
153
* to the previous color ramp.
155
- * @param colorramp New color ramp for the button
154
+ * @param colorramp New color ramp for the button. The ramp will be cloned and ownership is not transferred.
156
155
* @see setRandomColorRamp, setColorRampFromName, colorRamp
157
156
*/
158
157
void setColorRamp( QgsColorRamp* colorramp );
@@ -168,7 +167,7 @@ class QgsColorRampButton : QToolButton
168
167
* @param name Name of saved color ramp
169
168
* @see setColorRamp, setRandomColorRamp, colorRamp
170
169
*/
171
- void setColorRampFromName( QString name = QString() );
170
+ void setColorRampFromName( const QString& name = QString() );
172
171
173
172
/** Sets the background pixmap for the button based upon current color ramp.
174
173
* @param colorramp Color ramp for button background. If no color ramp is specified, the button's current
0 commit comments