QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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:
49 QgsDataCollectionItem( QgsDataItem *parent SIP_TRANSFERTHIS, const QString &name, const QString &path = QString(), const QString &providerKey = QString() );
50
51 ~QgsDataCollectionItem() override;
52
53#ifdef SIP_RUN
54 // clang-format off
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// clang-format on
61#endif
62
64 {
65 mChildren.append( item );
66 }
67
76 static QIcon iconDir( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
77
82 static QIcon iconDataCollection();
83
85
86 protected:
95 static QIcon openDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
96
105 static QIcon homeDirIcon( const QColor &fillColor = QColor(), const QColor &strokeColor = QColor() );
106};
107
108
109#endif // QGSDATAITEM_H
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:52
#define SIP_TRANSFER
Definition qgis_sip.h:35