58 if ( qobject_cast<QgsLayerItem *>( sipCpp ) )
59 sipType = sipType_QgsLayerItem;
60 else if ( qobject_cast<QgsErrorItem *>( sipCpp ) )
61 sipType = sipType_QgsErrorItem;
62 else if ( qobject_cast<QgsDirectoryItem *>( sipCpp ) )
63 sipType = sipType_QgsDirectoryItem;
64 else if ( qobject_cast<QgsFavoritesItem *>( sipCpp ) )
65 sipType = sipType_QgsFavoritesItem;
66 else if ( qobject_cast<QgsZipItem *>( sipCpp ) )
67 sipType = sipType_QgsZipItem;
68 else if ( qobject_cast<QgsDataCollectionItem *>( sipCpp ) )
69 sipType = sipType_QgsDataCollectionItem;
70 else if ( qobject_cast<QgsProjectItem *>( sipCpp ) )
71 sipType = sipType_QgsProjectItem;
97 SIP_PYOBJECT __repr__();
99 QString
str = QStringLiteral(
"<QgsDataItem: \"%1\" %2>" ).arg( sipCpp->name(), sipCpp->path() );
100 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
111 virtual bool layerCollection()
const;
122 PyObject *sipResObj = sipCallMethod( 0, sipMethod,
"" );
125 sipIsErr = !sipResObj || sipParseResult( 0, sipMethod, sipResObj,
"H5", sipType_QVector_0101QgsDataItem, &sipRes ) < 0;
130 PyObject *pyItem = sipGetPyObject( item, sipType_QgsDataItem );
131 if ( pyItem != NULL )
134 sipTransferTo( pyItem, Py_None );
138 if ( sipResObj != NULL )
140 Py_DECREF( sipResObj );
166 virtual void deleteChildItem(
QgsDataItem *child );
196 virtual QList<QAction *> actions( QWidget *parent );
205 virtual QList<QMenu *> menus( QWidget *parent );
218#pragma clang diagnostic push
219#pragma clang diagnostic ignored "-Woverloaded-virtual"
232#pragma clang diagnostic pop
240 virtual bool handleDoubleClick();
288 Q_DECL_DEPRECATED virtual
bool rename( const QString &name )
SIP_DEPRECATED;
297 virtual
Qgis::BrowserItemCapabilities capabilities2()
const {
return mCapabilities; }
304 virtual void setCapabilities( Qgis::BrowserItemCapabilities capabilities )
SIP_PYNAME( setCapabilitiesV2 ) { mCapabilities = capabilities; }
309 Q_DECL_DEPRECATED
void setCapabilities(
int capabilities )
SIP_DEPRECATED;
314 static int findItem( QVector<QgsDataItem *> items,
QgsDataItem *item );
331 QVector<QgsDataItem *>
children()
const {
return mChildren; }
332 virtual QIcon icon();
339 QString
name()
const {
return mName; }
346 void setName(
const QString &name );
348 QString
path()
const {
return mPath; }
349 void setPath(
const QString &path ) { mPath = path; }
359 QString providerKey()
const;
369 void setProviderKey(
const QString &value );
372 static QString pathComponent(
const QString &component );
383 virtual QVariant sortKey()
const;
389 void setSortKey(
const QVariant &key );
395 void setIcon(
const QIcon &icon ) { mIcon = icon; }
396 void setIconName(
const QString &iconName ) { mIconName = iconName; }
402 static void deleteLater( QVector<QgsDataItem *> &items );
405 void moveToThread( QThread *targetThread );
419 virtual
void populate( const QVector<
QgsDataItem *> &children );
424 virtual
void refresh( const QVector<
QgsDataItem *> &children );
434 bool deferredDelete() {
return mDeferredDelete; }
467 virtual void deleteLater();
471 virtual void populate(
bool foreground =
false );
474 virtual void depopulate();
476 virtual void refresh();
484 virtual void refreshConnections(
const QString &providerKey = QString() );
486 virtual void childrenCreated();
518 static QVector<QgsDataItem *> runCreateChildren(
QgsDataItem *item );
521 bool mDeferredDelete =
false;
522 QFutureWatcher< QVector <QgsDataItem *> > *mFutureWatcher =
nullptr;