QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgsattributesformtreeviewitemdelegate.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsattributesformtreeviewitemdelegate.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 QGSATTRIBUTESFORMTREEVIEWITEMDELEGATE_H
17#define QGSATTRIBUTESFORMTREEVIEWITEMDELEGATE_H
18
19// We don't want to expose this in the public API
20#define SIP_NO_FILE
21
23
24#include "qgsproxystyle.h"
25
28
29#include <QStyledItemDelegate>
30
37class QgsAttributesFormTreeViewProxyStyle : public QgsProxyStyle
38{
39 Q_OBJECT
40
41 public:
45 explicit QgsAttributesFormTreeViewProxyStyle( QgsAttributesFormBaseView *treeView );
46
47 QRect subElementRect( SubElement element, const QStyleOption *option, const QWidget *widget ) const override;
48
49 static const auto SE_AttributesFormTreeItemIndicator = SE_CustomBase + 1;
50
51 private:
52 QgsAttributesFormBaseView *mAttributesFormTreeView;
53};
54
55
62class QgsAttributesFormTreeViewItemDelegate : public QStyledItemDelegate
63{
64 Q_OBJECT
65 public:
69 explicit QgsAttributesFormTreeViewItemDelegate( QgsAttributesFormBaseView *parent );
70
71 void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
72
73 bool helpEvent( QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index ) override;
74
75 private:
76 QgsAttributesFormBaseView *mAttributesFormTreeView;
77};
78
80
81#endif // QGSATTRIBUTESFORMTREEVIEWITEMDELEGATE_H
Graphical representation for the attribute drag and drop editor.
Indicator that can be used in an Attributes Form tree view to display icons next to field items.
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...