QGIS API Documentation 3.43.0-Master (b60ef06885e)
qgsdatacollectionitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdatacollectionitem.h
3 -------------------
4 begin : 2011-04-01
5 copyright : (C) 2011 Radim Blazek
6 email : radim dot blazek at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSDATACOLLECTIONITEM_H
18#define QGSDATACOLLECTIONITEM_H
19
20#include "qgis_sip.h"
21#include "qgis_core.h"
22#include "qgsdataitem.h"
23
30class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
31{
32 Q_OBJECT
33 public:
34
46 QgsDataCollectionItem( QgsDataItem *parent SIP_TRANSFERTHIS, const QString &name, const QString &path = QString(), const QString &providerKey = QString() );
47
48 ~QgsDataCollectionItem() override;
49
50#ifdef SIP_RUN
51 SIP_PYOBJECT __repr__();
52 % MethodCode
53 QString str = QStringLiteral( "<QgsDataCollectionItem: \"%1\" %2>" ).arg( sipCpp->name(), sipCpp->path() );
54 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
55 % End
56#endif
57
58 void addChild( QgsDataItem *item SIP_TRANSFER ) { mChildren.append( item ); }
59
68 static QIcon iconDir( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
69
74 static QIcon iconDataCollection();
75
77
78 protected:
79
88 static QIcon openDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
89
98 static QIcon homeDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
99
100};
101
102
103#endif // QGSDATAITEM_H
104
105
Provides common functionality for database based connections.
A browser item for collections of data.
void addChild(QgsDataItem *item)
Base class for all items in the model.
Definition qgsdataitem.h:46
virtual QgsAbstractDatabaseProviderConnection * databaseConnection() const
For data items that represent a DB connection or one of its children, this method returns a connectio...
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36