QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
attributetable
qgsfeaturelistviewdelegate.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfeaturelistviewdelegate.h
3
---------------------
4
begin : February 2013
5
copyright : (C) 2013 by Matthias Kuhn
6
email : matthias 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
#ifndef QGSATTRIBUTELISTVIEWDELEGATE_H
16
#define QGSATTRIBUTELISTVIEWDELEGATE_H
17
18
#include "qgis_gui.h"
19
20
#include <QItemDelegate>
21
#include <QItemSelectionModel>
22
23
class
QgsVectorLayer
;
24
class
QgsFeatureListModel
;
25
class
QgsFeatureSelectionModel
;
26
class
QPosition;
27
33
class
GUI_EXPORT
QgsFeatureListViewDelegate
:
public
QItemDelegate
34
{
35
Q_OBJECT
36
37
public
:
38
static
const
int
ICON_SIZE
= 24;
39
40
enum
Element
41
{
42
EditElement
,
43
SelectionElement
44
};
45
46
explicit
QgsFeatureListViewDelegate
(
QgsFeatureListModel
*listModel, QObject *parent =
nullptr
);
47
48
void
setEditSelectionModel( QItemSelectionModel *editSelectionModel );
49
50
Element positionToElement( QPoint pos );
51
52
void
setFeatureSelectionModel(
QgsFeatureSelectionModel
*featureSelectionModel );
53
54
void
setCurrentFeatureEdited(
bool
state );
55
56
signals:
57
61
void
editButtonClicked
( QModelIndex &index );
62
63
protected
:
64
QSize
sizeHint
(
const
QStyleOptionViewItem &option,
const
QModelIndex &index )
const override
;
65
void
paint
( QPainter *painter,
const
QStyleOptionViewItem &option,
const
QModelIndex &index )
const override
;
66
67
private
:
68
QgsFeatureSelectionModel
*mFeatureSelectionModel =
nullptr
;
69
QItemSelectionModel *mEditSelectionModel =
nullptr
;
70
QgsFeatureListModel
*mListModel =
nullptr
;
72
bool
mCurrentFeatureEdited =
false
;
73
};
74
75
#endif
// QGSATTRIBUTELISTVIEWDELEGATE_H
QgsFeatureListModel
A proxy model for feature lists.
Definition
qgsfeaturelistmodel.h:42
QgsFeatureListViewDelegate
Custom item delegate for feature list views.
Definition
qgsfeaturelistviewdelegate.h:34
QgsFeatureListViewDelegate::QgsFeatureListViewDelegate
QgsFeatureListViewDelegate(QgsFeatureListModel *listModel, QObject *parent=nullptr)
Definition
qgsfeaturelistviewdelegate.cpp:36
QgsFeatureListViewDelegate::sizeHint
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition
qgsfeaturelistviewdelegate.cpp:68
QgsFeatureListViewDelegate::ICON_SIZE
static const int ICON_SIZE
Definition
qgsfeaturelistviewdelegate.h:38
QgsFeatureListViewDelegate::paint
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition
qgsfeaturelistviewdelegate.cpp:75
QgsFeatureListViewDelegate::Element
Element
Definition
qgsfeaturelistviewdelegate.h:41
QgsFeatureListViewDelegate::SelectionElement
@ SelectionElement
Definition
qgsfeaturelistviewdelegate.h:43
QgsFeatureListViewDelegate::EditElement
@ EditElement
Definition
qgsfeaturelistviewdelegate.h:42
QgsFeatureListViewDelegate::editButtonClicked
void editButtonClicked(QModelIndex &index)
Emitted when the edit button is clicked for the feature with matching index.
QgsFeatureSelectionModel
Item selection model for selecting features.
Definition
qgsfeatureselectionmodel.h:33
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
Generated on
for QGIS API Documentation by
1.17.0