QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgsattributesformtreeviewindicatorprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributesformtreeviewindicatorprovider.h
3 ---------------------
4 begin : June 2025
5 copyright : (C) 2025 by Germán Carrillo
6 email : german at opengis dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSATTRIBUTESFORMTREEVIEWINDICATORPROVIDER_H
17#define QGSATTRIBUTESFORMTREEVIEWINDICATORPROVIDER_H
18
19// We don't want to expose this in the public API
20
23
24#include <QObject>
25
26#define SIP_NO_FILE
27
41{
42 Q_OBJECT
43 public:
50
52 bool isEnabled() const;
53
59 void setEnabled( bool enabled );
60
61 public slots:
62
70
71 protected slots:
73 void onAddedChildren( QgsAttributesFormItem *item, int indexFrom, int indexTo );
74
75 private:
76 // Subclasses MUST override:
78 virtual bool acceptsItem( QgsAttributesFormItem *item ) = 0;
80 virtual QString iconName( QgsAttributesFormItem *item ) = 0;
82 virtual QString tooltipText( QgsAttributesFormItem *item ) = 0;
83 // End MUST overrides
84
86 std::unique_ptr<QgsAttributesFormTreeViewIndicator> newIndicator( QgsAttributesFormItem *item );
87
89 void removeItemIndicator( QgsAttributesFormItem *item );
90
91 protected:
93 QSet<QgsAttributesFormTreeViewIndicator *> mIndicators;
94 bool mEnabled = false;
95};
96
97
105{
106 Q_OBJECT
107
108 public:
113
114 private:
115 bool acceptsItem( QgsAttributesFormItem *item ) override;
116 QString iconName( QgsAttributesFormItem *item ) override;
117 QString tooltipText( QgsAttributesFormItem *item ) override;
118};
119
120
128{
129 Q_OBJECT
130
131 public:
136
137 private:
138 bool acceptsItem( QgsAttributesFormItem *item ) override;
139 QString iconName( QgsAttributesFormItem *item ) override;
140 QString tooltipText( QgsAttributesFormItem *item ) override;
141};
142
143#endif // QGSATTRIBUTESFORMTREEVIEWINDICATORPROVIDER_H
Graphical representation for the attribute drag and drop editor.
Holds parent-child relations as well as item data contained in a QgsAttributesFormModel.
void setEnabled(bool enabled)
Enables or disables the provider.
void updateItemIndicator(QgsAttributesFormItem *item)
Updates the state of a the indicator for the given item.
void onAddedChildren(QgsAttributesFormItem *item, int indexFrom, int indexTo)
Connects to signals of new items added to the tree.
bool isEnabled() const
Returns whether the provider is enabled or not.
QgsAttributesFormTreeViewIndicatorProvider(QgsAttributesFormBaseView *view)
Constructor for QgsAttributesFormTreeViewIndicatorProvider.
QgsFieldConstraintIndicatorProvider(QgsAttributesFormBaseView *view)
Constructor for QgsFieldConstraintIndicatorProvider.
QgsFieldDefaultValueIndicatorProvider(QgsAttributesFormBaseView *view)
Constructor for QgsFieldDefaultValueIndicatorProvider.