QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
browser
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
26
using namespace
Qt::StringLiterals;
27
34
class
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
63
void
addChild
(
QgsDataItem
*item
SIP_TRANSFER
)
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
84
QgsAbstractDatabaseProviderConnection
*
databaseConnection
()
const override
;
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
QgsAbstractDatabaseProviderConnection
Provides common functionality for database based connections.
Definition
qgsabstractdatabaseproviderconnection.h:50
QgsDataCollectionItem::QgsDataCollectionItem
QgsDataCollectionItem(QgsDataItem *parent, const QString &name, const QString &path=QString(), const QString &providerKey=QString())
Constructor for QgsDataCollectionItem, with the specified parent item.
Definition
qgsdatacollectionitem.cpp:34
QgsDataCollectionItem::addChild
void addChild(QgsDataItem *item)
Definition
qgsdatacollectionitem.h:63
QgsDataItem::mChildren
QVector< QgsDataItem * > mChildren
Definition
qgsdataitem.h:515
QgsDataItem::databaseConnection
virtual QgsAbstractDatabaseProviderConnection * databaseConnection() const
For data items that represent a DB connection or one of its children, this method returns a connectio...
Definition
qgsdataitem.cpp:160
QgsDataItem::QgsDataItem
QgsDataItem(Qgis::BrowserItemType type, QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
Constructor for QgsDataItem, with the specified parent item.
Definition
qgsdataitem.cpp:63
QgsDataItem::name
QString name() const
Returns the name of the item (the displayed text for the item).
Definition
qgsdataitem.h:406
QgsDataItem::path
QString path() const
Definition
qgsdataitem.h:415
QgsDataItem::parent
QgsDataItem * parent() const
Gets item parent.
Definition
qgsdataitem.h:379
QgsDataItem::providerKey
QString providerKey() const
Returns the provider key that created this item (e.g.
Definition
qgsdataitem.cpp:398
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
qgsdataitem.h
Generated on
for QGIS API Documentation by
1.17.0