QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Types | Public Slots | Public Member Functions | Protected Member Functions | List of all members
QgsAttributesDnDTree Class Reference

This class overrides mime type handling to be able to work with the drag and drop attribute editor. More...

#include <qgsattributesformproperties.h>

Inheritance diagram for QgsAttributesDnDTree:
Inheritance graph
[legend]

Public Types

enum  Type { Drag , Drop }
 

Public Slots

void selectFirstMatchingItem (const QgsAttributesFormProperties::DnDTreeItemData &data)
 

Public Member Functions

 QgsAttributesDnDTree (QgsVectorLayer *layer, QWidget *parent=nullptr)
 
QTreeWidgetItem * addContainer (QTreeWidgetItem *parent, const QString &title, int columnCount)
 
QTreeWidgetItem * addItem (QTreeWidgetItem *parent, QgsAttributesFormProperties::DnDTreeItemData data, int index=-1, const QIcon &icon=QIcon())
 Adds a new item to a parent. More...
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 
void setType (QgsAttributesDnDTree::Type value)
 
Type type () const
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 
virtual QgsExpressionContext createExpressionContext () const =0
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 

Protected Member Functions

void dragMoveEvent (QDragMoveEvent *event) override
 Is called when mouse is moved over attributes tree before a drop event. More...
 
void dropEvent (QDropEvent *event) override
 
bool dropMimeData (QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) override
 
QMimeData * mimeData (const QList< QTreeWidgetItem * > &items) const override
 
QStringList mimeTypes () const override
 

Detailed Description

This class overrides mime type handling to be able to work with the drag and drop attribute editor.

The mime type is application/x-qgsattributetablefield

Graphical representation for the attribute editor drag and drop editor

Definition at line 383 of file qgsattributesformproperties.h.

Member Enumeration Documentation

◆ Type

Enumerator
Drag 
Drop 

Definition at line 397 of file qgsattributesformproperties.h.

Constructor & Destructor Documentation

◆ QgsAttributesDnDTree()

QgsAttributesDnDTree::QgsAttributesDnDTree ( QgsVectorLayer layer,
QWidget *  parent = nullptr 
)
explicit

Definition at line 1079 of file qgsattributesformproperties.cpp.

Member Function Documentation

◆ addContainer()

QTreeWidgetItem * QgsAttributesDnDTree::addContainer ( QTreeWidgetItem *  parent,
const QString &  title,
int  columnCount 
)

Definition at line 1066 of file qgsattributesformproperties.cpp.

◆ addItem()

QTreeWidgetItem * QgsAttributesDnDTree::addItem ( QTreeWidgetItem *  parent,
QgsAttributesFormProperties::DnDTreeItemData  data,
int  index = -1,
const QIcon &  icon = QIcon() 
)

Adds a new item to a parent.

If index is -1, the item is added to the end of the parent's existing children. Otherwise it is inserted at the specified index.

Definition at line 1086 of file qgsattributesformproperties.cpp.

◆ createExpressionContext()

QgsExpressionContext QgsAttributesDnDTree::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Since
QGIS 3.0

Implements QgsExpressionContextGenerator.

Definition at line 1662 of file qgsattributesformproperties.cpp.

◆ dragMoveEvent()

void QgsAttributesDnDTree::dragMoveEvent ( QDragMoveEvent *  event)
overrideprotected

Is called when mouse is moved over attributes tree before a drop event.

Used to inhibit dropping fields onto the root item.

Definition at line 1128 of file qgsattributesformproperties.cpp.

◆ dropEvent()

void QgsAttributesDnDTree::dropEvent ( QDropEvent *  event)
overrideprotected

Definition at line 1214 of file qgsattributesformproperties.cpp.

◆ dropMimeData()

bool QgsAttributesDnDTree::dropMimeData ( QTreeWidgetItem *  parent,
int  index,
const QMimeData *  data,
Qt::DropAction  action 
)
overrideprotected

Definition at line 1155 of file qgsattributesformproperties.cpp.

◆ mimeData()

QMimeData * QgsAttributesDnDTree::mimeData ( const QList< QTreeWidgetItem * > &  items) const
overrideprotected

Definition at line 1235 of file qgsattributesformproperties.cpp.

◆ mimeTypes()

QStringList QgsAttributesDnDTree::mimeTypes ( ) const
overrideprotected

Definition at line 1227 of file qgsattributesformproperties.cpp.

◆ selectFirstMatchingItem

void QgsAttributesDnDTree::selectFirstMatchingItem ( const QgsAttributesFormProperties::DnDTreeItemData data)
slot

Definition at line 1685 of file qgsattributesformproperties.cpp.

◆ setType()

void QgsAttributesDnDTree::setType ( QgsAttributesDnDTree::Type  value)

Definition at line 1680 of file qgsattributesformproperties.cpp.

◆ type()

QgsAttributesDnDTree::Type QgsAttributesDnDTree::type ( ) const

Definition at line 1675 of file qgsattributesformproperties.cpp.


The documentation for this class was generated from the following files: