File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -255,11 +255,22 @@ Create new data item.
255
255
%Docstring
256
256
:rtype: QIcon
257
257
%End
258
+
258
259
QString name() const;
259
260
%Docstring
261
+ Returns the name of the item (the displayed text for the item).
262
+
263
+ .. seealso:: :py:func:`setName()`
260
264
:rtype: str
261
265
%End
266
+
262
267
void setName( const QString &name );
268
+ %Docstring
269
+ Sets the ``name`` of the item (the displayed text for the item).
270
+
271
+ .. seealso:: :py:func:`name()`
272
+ %End
273
+
263
274
QString path() const;
264
275
%Docstring
265
276
:rtype: str
Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ QIcon QgsDataItem::icon()
229
229
return mIconMap .value ( mIconName );
230
230
}
231
231
232
+ void QgsDataItem::setName ( const QString &name )
233
+ {
234
+ mName = name;
235
+ emit dataChanged ( this );
236
+ }
237
+
232
238
QVector<QgsDataItem *> QgsDataItem::createChildren ()
233
239
{
234
240
return QVector<QgsDataItem *>();
Original file line number Diff line number Diff line change @@ -248,8 +248,21 @@ class CORE_EXPORT QgsDataItem : public QObject
248
248
void setParent ( QgsDataItem *parent );
249
249
QVector<QgsDataItem *> children () const { return mChildren ; }
250
250
virtual QIcon icon ();
251
+
252
+ /* *
253
+ * Returns the name of the item (the displayed text for the item).
254
+ *
255
+ * \see setName()
256
+ */
251
257
QString name () const { return mName ; }
252
- void setName ( const QString &name ) { mName = name; }
258
+
259
+ /* *
260
+ * Sets the \a name of the item (the displayed text for the item).
261
+ *
262
+ * \see name()
263
+ */
264
+ void setName ( const QString &name );
265
+
253
266
QString path () const { return mPath ; }
254
267
void setPath ( const QString &path ) { mPath = path; }
255
268
// ! Create path component replacing path separators
You can’t perform that action at this time.
0 commit comments