QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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#define SIP_NO_FILE
21
24
25#include <QObject>
26
40{
41 Q_OBJECT
42 public:
43
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:
109
114
115 private:
116 bool acceptsItem( QgsAttributesFormItem *item ) override;
117 QString iconName( QgsAttributesFormItem *item ) override;
118 QString tooltipText( QgsAttributesFormItem *item ) override;
119};
120
121
129{
130 Q_OBJECT
131
132 public:
133
138
139 private:
140 bool acceptsItem( QgsAttributesFormItem *item ) override;
141 QString iconName( QgsAttributesFormItem *item ) override;
142 QString tooltipText( QgsAttributesFormItem *item ) override;
143};
144
145#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.