QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
qgsfielddomainsitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfielddomainsitem.h
3 -------------------
4 begin : 2022-01-27
5 copyright : (C) 2022 Nyall Dawson
6 email : nyall dot dawson 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 QGSFIELDDOMAINSITEM_H
18#define QGSFIELDDOMAINSITEM_H
19
20#include "qgis_sip.h"
21#include "qgis_core.h"
22#include "qgsdataitem.h"
24
30class CORE_EXPORT QgsFieldDomainsItem : public QgsDataItem
31{
32 Q_OBJECT
33
34 public:
35
46 const QString &path,
47 const QString &connectionUri,
48 const QString &providerKey );
49
51
52#ifdef SIP_RUN
53 SIP_PYOBJECT __repr__();
54 % MethodCode
55 QString str = QStringLiteral( "<QgsFieldDomainsItem: %1>" ).arg( sipCpp->path() );
56 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
57 % End
58#endif
59
60 QVector<QgsDataItem *> createChildren() override;
61
62 QIcon icon() override;
63
67 QString connectionUri() const;
68
69 private:
70
71 QString mConnectionUri;
72 QStringList mFieldDomainNames;
73
74};
75
76
82class CORE_EXPORT QgsFieldDomainItem : public QgsDataItem
83{
84 Q_OBJECT
85 public:
86
96
98
99#ifdef SIP_RUN
100 SIP_PYOBJECT __repr__();
101 % MethodCode
102 QString str = QStringLiteral( "<QgsFieldDomainItem: %1>" ).arg( sipCpp->name() );
103 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
104 % End
105#endif
106
107 QIcon icon() override;
108
112 const QgsFieldDomain *fieldDomain();
113
114 private:
115
116 std::unique_ptr< QgsFieldDomain > mDomain;
117
118};
119
120#endif // QGSFIELDDOMAINSITEM_H
121
122
Base class for all items in the model.
Definition qgsdataitem.h:46
virtual QVector< QgsDataItem * > createChildren()
Create children.
virtual QIcon icon()
A browser item representing a field domain.
~QgsFieldDomainItem() override
Base class for field domains.
Contains a collection of field domain items.
~QgsFieldDomainsItem() override
#define str(x)
Definition qgis.cpp:38
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFER
Definition qgis_sip.h:36