mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Notify model of changes when renaming data items
This commit is contained in:
parent
8df67111cd
commit
12e44b2016
@ -255,11 +255,22 @@ Create new data item.
|
||||
%Docstring
|
||||
:rtype: QIcon
|
||||
%End
|
||||
|
||||
QString name() const;
|
||||
%Docstring
|
||||
Returns the name of the item (the displayed text for the item).
|
||||
|
||||
.. seealso:: :py:func:`setName()`
|
||||
:rtype: str
|
||||
%End
|
||||
|
||||
void setName( const QString &name );
|
||||
%Docstring
|
||||
Sets the ``name`` of the item (the displayed text for the item).
|
||||
|
||||
.. seealso:: :py:func:`name()`
|
||||
%End
|
||||
|
||||
QString path() const;
|
||||
%Docstring
|
||||
:rtype: str
|
||||
|
@ -229,6 +229,12 @@ QIcon QgsDataItem::icon()
|
||||
return mIconMap.value( mIconName );
|
||||
}
|
||||
|
||||
void QgsDataItem::setName( const QString &name )
|
||||
{
|
||||
mName = name;
|
||||
emit dataChanged( this );
|
||||
}
|
||||
|
||||
QVector<QgsDataItem *> QgsDataItem::createChildren()
|
||||
{
|
||||
return QVector<QgsDataItem *>();
|
||||
|
@ -248,8 +248,21 @@ class CORE_EXPORT QgsDataItem : public QObject
|
||||
void setParent( QgsDataItem *parent );
|
||||
QVector<QgsDataItem *> children() const { return mChildren; }
|
||||
virtual QIcon icon();
|
||||
|
||||
/**
|
||||
* Returns the name of the item (the displayed text for the item).
|
||||
*
|
||||
* \see setName()
|
||||
*/
|
||||
QString name() const { return mName; }
|
||||
void setName( const QString &name ) { mName = name; }
|
||||
|
||||
/**
|
||||
* Sets the \a name of the item (the displayed text for the item).
|
||||
*
|
||||
* \see name()
|
||||
*/
|
||||
void setName( const QString &name );
|
||||
|
||||
QString path() const { return mPath; }
|
||||
void setPath( const QString &path ) { mPath = path; }
|
||||
//! Create path component replacing path separators
|
||||
|
Loading…
x
Reference in New Issue
Block a user