@@ -24,22 +24,22 @@ class QgsDataItem : QObject
24
24
%End
25
25
26
26
%ConvertToSubClassCode
27
- if (qobject_cast<QgsLayerItem*>(sipCpp) )
28
- sipType = sipType_QgsLayerItem;
29
- else if (qobject_cast<QgsErrorItem*>(sipCpp) )
30
- sipType = sipType_QgsErrorItem;
31
- else if (qobject_cast<QgsDirectoryItem*>(sipCpp) )
32
- sipType = sipType_QgsDirectoryItem;
33
- else if (qobject_cast<QgsFavoritesItem*>(sipCpp) )
34
- sipType = sipType_QgsFavoritesItem;
35
- else if (qobject_cast<QgsZipItem*>(sipCpp) )
36
- sipType = sipType_QgsZipItem;
37
- else if (qobject_cast<QgsDataCollectionItem*>(sipCpp) )
38
- sipType = sipType_QgsDataCollectionItem;
39
- else if (qobject_cast<QgsProjectItem*>(sipCpp) )
40
- sipType = sipType_QgsProjectItem;
41
- else
42
- sipType = 0;
27
+ if ( qobject_cast<QgsLayerItem *>( sipCpp ) )
28
+ sipType = sipType_QgsLayerItem;
29
+ else if ( qobject_cast<QgsErrorItem *>( sipCpp ) )
30
+ sipType = sipType_QgsErrorItem;
31
+ else if ( qobject_cast<QgsDirectoryItem *>( sipCpp ) )
32
+ sipType = sipType_QgsDirectoryItem;
33
+ else if ( qobject_cast<QgsFavoritesItem *>( sipCpp ) )
34
+ sipType = sipType_QgsFavoritesItem;
35
+ else if ( qobject_cast<QgsZipItem *>( sipCpp ) )
36
+ sipType = sipType_QgsZipItem;
37
+ else if ( qobject_cast<QgsDataCollectionItem *>( sipCpp ) )
38
+ sipType = sipType_QgsDataCollectionItem;
39
+ else if ( qobject_cast<QgsProjectItem *>( sipCpp ) )
40
+ sipType = sipType_QgsProjectItem;
41
+ else
42
+ sipType = 0;
43
43
%End
44
44
public:
45
45
enum Type
@@ -100,14 +100,14 @@ Create new data item.
100
100
Inserts a new child item. The child will be inserted at a position using an alphabetical order based on mName.
101
101
\param child child item to insert. Ownership is transferred, and item parent will be set and relevant connections made.
102
102
\param refresh - set to true to refresh populated item, emitting relevant signals to the model
103
- \see deleteChildItem()
103
+ .. seealso:: deleteChildItem()
104
104
%End
105
105
106
106
virtual void deleteChildItem( QgsDataItem *child );
107
107
%Docstring
108
108
Removes and deletes a child item, emitting relevant signals to the model.
109
109
\param child child to remove. Item must exist as a current child.
110
- \see addChildItem()
110
+ .. seealso:: addChildItem()
111
111
%End
112
112
113
113
virtual QgsDataItem *removeChildItem( QgsDataItem *child ) /TransferBack/;
@@ -140,15 +140,15 @@ Create new data item.
140
140
%Docstring
141
141
Returns whether the item accepts drag and dropped layers - e.g. for importing a dataset to a provider.
142
142
Subclasses should override this and handleDrop() to accept dropped layers.
143
- \see handleDrop()
143
+ .. seealso:: handleDrop()
144
144
:rtype: bool
145
145
%End
146
146
147
147
virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ );
148
148
%Docstring
149
149
Attempts to process the mime data dropped on this item. Subclasses must override this and acceptDrop() if they
150
150
accept dropped layers.
151
- \see acceptDrop()
151
+ .. seealso:: acceptDrop()
152
152
:rtype: bool
153
153
%End
154
154
@@ -157,7 +157,7 @@ Create new data item.
157
157
Returns true if the item may be dragged.
158
158
Default implementation returns false.
159
159
A draggable item has to implement mimeUri() that will be used to pass data.
160
- \see mimeUri()
160
+ .. seealso:: mimeUri()
161
161
.. versionadded:: 3.0
162
162
:rtype: bool
163
163
%End
@@ -166,7 +166,7 @@ Create new data item.
166
166
%Docstring
167
167
Return mime URI for the data item.
168
168
Items that return valid URI will be returned in mime data when dragging a selection from browser model.
169
- \see hasDragEnabled()
169
+ .. seealso:: hasDragEnabled()
170
170
.. versionadded:: 3.0
171
171
:rtype: QgsMimeDataUtils.Uri
172
172
%End
@@ -190,7 +190,6 @@ Create new data item.
190
190
191
191
virtual Capabilities capabilities2() const;
192
192
%Docstring
193
- ### QGIS 3 - rename to capabilities()
194
193
:rtype: Capabilities
195
194
%End
196
195
@@ -202,14 +201,12 @@ Create new data item.
202
201
203
202
static int findItem( QVector<QgsDataItem *> items, QgsDataItem *item );
204
203
%Docstring
205
- Find child index in vector of items using '==' operator
206
204
:rtype: int
207
205
%End
208
206
209
207
210
208
Type type() const;
211
209
%Docstring
212
- members
213
210
:rtype: Type
214
211
%End
215
212
@@ -250,9 +247,6 @@ Create path component replacing path separators
250
247
%End
251
248
252
249
void setIcon( const QIcon &icon );
253
- %Docstring
254
- or implement icon().
255
- %End
256
250
void setIconName( const QString &iconName );
257
251
258
252
void setToolTip( const QString &msg );
@@ -262,9 +256,6 @@ or implement icon().
262
256
%End
263
257
264
258
static void deleteLater( QVector<QgsDataItem *> &items );
265
- %Docstring
266
- deleteLater() items anc clear the vector
267
- %End
268
259
269
260
void moveToThread( QThread *targetThread );
270
261
%Docstring
@@ -304,9 +295,6 @@ Move object and all its descendants to thread
304
295
%End
305
296
306
297
virtual void populate( bool foreground = false );
307
- %Docstring
308
- \param foreground run createChildren in foreground
309
- %End
310
298
311
299
virtual void depopulate();
312
300
%Docstring
@@ -367,10 +355,6 @@ class QgsLayerItem : QgsDataItem
367
355
368
356
369
357
virtual bool equal( const QgsDataItem *other );
370
- %Docstring
371
- --- reimplemented from QgsDataItem ---
372
- :rtype: bool
373
- %End
374
358
375
359
virtual bool hasDragEnabled() const;
376
360
@@ -471,9 +455,6 @@ class QgsDataCollectionItem : QgsDataItem
471
455
static QIcon iconDir(); // shared icon: open/closed directory
472
456
static QIcon iconDataCollection(); // default icon for data collection
473
457
};
474
- %Docstring
475
- :rtype: QIcon
476
- %End
477
458
478
459
class QgsDirectoryItem : QgsDataCollectionItem
479
460
{
@@ -616,13 +597,13 @@ class QgsFavoritesItem : QgsDataCollectionItem
616
597
void addDirectory( const QString &directory );
617
598
%Docstring
618
599
Adds a new directory to the favorites group.
619
- \see removeDirectory()
600
+ .. seealso:: removeDirectory()
620
601
%End
621
602
622
603
void removeDirectory( QgsDirectoryItem *item );
623
604
%Docstring
624
605
Removes an existing directory from the favorites group.
625
- \see addDirectory()
606
+ .. seealso:: addDirectory()
626
607
%End
627
608
628
609
static QIcon iconFavorites();
@@ -655,12 +636,6 @@ class QgsZipItem : QgsDataCollectionItem
655
636
:rtype: list of str
656
637
%End
657
638
658
- static QVector<dataItem_t *> sDataItemPtr;
659
- %Docstring
660
- .. note::
661
-
662
- not available via Python bindings
663
- %End
664
639
static QStringList sProviderNames;
665
640
666
641
static QString vsiPrefix( const QString &uri );
@@ -674,7 +649,7 @@ class QgsZipItem : QgsDataCollectionItem
674
649
:rtype: QgsDataItem
675
650
%End
676
651
677
- static QgsDataItem *itemFromPath( QgsDataItem *parent, const QString &filePath, const QString &name, const QString &path ) /Factory/, / PyName=itemFromFilePath/;
652
+ static QgsDataItem *itemFromPath( QgsDataItem *parent, const QString &filePath, const QString &name, const QString &path ) /Factory, PyName=itemFromFilePath/;
678
653
%Docstring
679
654
Creates a new data item from the specified path.
680
655
.. note::
0 commit comments