QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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:
42
46 explicit QgsAttributesFormTreeViewProxyStyle( QgsAttributesFormBaseView *treeView );
47
48 QRect subElementRect( SubElement element, const QStyleOption *option, const QWidget *widget ) const override;
49
50 static const auto SE_AttributesFormTreeItemIndicator = SE_CustomBase + 1;
51
52 private:
53 QgsAttributesFormBaseView *mAttributesFormTreeView;
54};
55
56
63class QgsAttributesFormTreeViewItemDelegate : public QStyledItemDelegate
64{
65 Q_OBJECT
66 public:
67
71 explicit QgsAttributesFormTreeViewItemDelegate( QgsAttributesFormBaseView *parent );
72
73 void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
74
75 bool helpEvent( QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index ) override;
76
77 private:
78 QgsAttributesFormBaseView *mAttributesFormTreeView;
79};
80
82
83#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,...