QGIS API Documentation 3.99.0-Master (752b475928d)
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:
49
51 bool isEnabled() const;
52
58 void setEnabled( bool enabled );
59
60 public slots:
61
69
70 protected slots:
72 void onAddedChildren( QgsAttributesFormItem *item, int indexFrom, int indexTo );
73
74 private:
75 // Subclasses MUST override:
77 virtual bool acceptsItem( QgsAttributesFormItem *item ) = 0;
79 virtual QString iconName( QgsAttributesFormItem *item ) = 0;
81 virtual QString tooltipText( QgsAttributesFormItem *item ) = 0;
82 // End MUST overrides
83
85 std::unique_ptr<QgsAttributesFormTreeViewIndicator> newIndicator( QgsAttributesFormItem *item );
86
88 void removeItemIndicator( QgsAttributesFormItem *item );
89
90 protected:
92 QSet<QgsAttributesFormTreeViewIndicator *> mIndicators;
93 bool mEnabled = false;
94};
95
96
104{
105 Q_OBJECT
106
107 public:
112
113 private:
114 bool acceptsItem( QgsAttributesFormItem *item ) override;
115 QString iconName( QgsAttributesFormItem *item ) override;
116 QString tooltipText( QgsAttributesFormItem *item ) override;
117};
118
119
127{
128 Q_OBJECT
129
130 public:
135
136 private:
137 bool acceptsItem( QgsAttributesFormItem *item ) override;
138 QString iconName( QgsAttributesFormItem *item ) override;
139 QString tooltipText( QgsAttributesFormItem *item ) override;
140};
141
142#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.