@@ -119,28 +119,46 @@ class CORE_EXPORT QgsDataItem : public QObject
119119 // ! @deprecated in 2.8, use state()
120120 Q_DECL_DEPRECATED bool isPopulated () { return state () == Populated; }
121121
122- // Insert new child using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals
123- // refresh - refresh populated item, emit signals to model
122+ /* * Inserts a new child item. The child will be inserted at a position using an alphabetical order based on mName.
123+ * @param child child item to insert. Ownership is transferred, and item parent will be set and relevant connections made.
124+ * @param refresh - set to true to refresh populated item, emitting relevant signals to the model
125+ * @see deleteChildItem()
126+ */
124127 virtual void addChildItem ( QgsDataItem *child, bool refresh = false );
125128
126- // remove and delete child item, signals to browser are emitted
129+ /* * Removes and deletes a child item, emitting relevant signals to the model.
130+ * @param child child to remove. Item must exist as a current child.
131+ * @see addChildItem()
132+ */
127133 virtual void deleteChildItem ( QgsDataItem * child );
128134
129- // remove child item but don't delete it, signals to browser are emitted
130- // returns pointer to the removed item or null if no such item was found
135+ /* * Removes a child item and returns it without deleting it. Emits relevant signals to model as required.
136+ * @param child child to remove
137+ * @returns pointer to the removed item or null if no such item was found
138+ */
131139 virtual QgsDataItem *removeChildItem ( QgsDataItem * child );
132140
141+ /* * Returns true if this item is equal to another item (by testing item type and path).
142+ */
133143 virtual bool equal ( const QgsDataItem *other );
134144
135145 virtual QWidget *paramWidget () { return nullptr ; }
136146
137- // list of actions provided by this item - usually used for popup menu on right-click
147+ /* * Returns the list of actions available for this item. This is usually used for the popup menu on right-clicking
148+ * the item. Subclasses should override this to provide actions.
149+ */
138150 virtual QList<QAction*> actions () { return QList<QAction*>(); }
139151
140- // whether accepts drag&drop'd layers - e.g. for import
152+ /* * Returns whether the item accepts drag and dropped layers - e.g. for importing a dataset to a provider.
153+ * Subclasses should override this and handleDrop() to accept dropped layers.
154+ * @see handleDrop()
155+ */
141156 virtual bool acceptDrop () { return false ; }
142157
143- // try to process the data dropped on this item
158+ /* * Attempts to process the mime data dropped on this item. Subclasses must override this and acceptDrop() if they
159+ * accept dropped layers.
160+ * @see acceptDrop()
161+ */
144162 virtual bool handleDrop ( const QMimeData * /* data*/ , Qt::DropAction /* action*/ ) { return false ; }
145163
146164 enum Capability
0 commit comments