QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
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_core.h"
21#include "qgis_sip.h"
22#include "qgsdataitem.h"
23
24#include <QString>
25
26using namespace Qt::StringLiterals;
27
34class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
35{
36 Q_OBJECT
37 public:
38
50 QgsDataCollectionItem( QgsDataItem *parent SIP_TRANSFERTHIS, const QString &name, const QString &path = QString(), const QString &providerKey = QString() );
51
52 ~QgsDataCollectionItem() override;
53
54#ifdef SIP_RUN
55 SIP_PYOBJECT __repr__();
56 % MethodCode
57 QString str = u"<QgsDataCollectionItem: \"%1\" %2>"_s.arg( sipCpp->name(), sipCpp->path() );
58 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
59 % End
60#endif
61
62 void addChild( QgsDataItem *item SIP_TRANSFER ) { mChildren.append( item ); }
63
72 static QIcon iconDir( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
73
78 static QIcon iconDataCollection();
79
81
82 protected:
83
92 static QIcon openDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
93
102 static QIcon homeDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
103
104};
105
106
107#endif // QGSDATAITEM_H
108
109
Provides common functionality for database based connections.
QgsDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path=QString(), const QString &providerKey=QString())
Constructor for QgsDataCollectionItem, with the specified parent item.
void addChild(QgsDataItem *item)
QVector< QgsDataItem * > mChildren
virtual QgsAbstractDatabaseProviderConnection * databaseConnection() const
For data items that represent a DB connection or one of its children, this method returns a connectio...
QgsDataItem(Qgis::BrowserItemType type, QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
Constructor for QgsDataItem, with the specified parent item.
QString name() const
Returns the name of the item (the displayed text for the item).
QString path() const
QgsDataItem * parent() const
Gets item parent.
QString providerKey() const
Returns the provider key that created this item (e.g.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36