QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
This class overrides mime type handling to be able to work with the drag and drop attribute editor. More...
#include <qgsattributesformproperties.h>
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, Qgis::AttributeEditorContainerType type) |
Adds a new container to parent. | |
QTreeWidgetItem * | addItem (QTreeWidgetItem *parent, QgsAttributesFormProperties::DnDTreeItemData data, int index=-1, const QIcon &icon=QIcon()) |
Adds a new item to a parent. | |
QgsExpressionContext | createExpressionContext () const override |
This method needs to be reimplemented in all classes which implement this interface and return an expression context. | |
void | setType (QgsAttributesDnDTree::Type value) |
Type | type () const |
Public Member Functions inherited from QgsExpressionContextGenerator | |
virtual | ~QgsExpressionContextGenerator ()=default |
Protected Member Functions | |
void | dragMoveEvent (QDragMoveEvent *event) override |
Is called when mouse is moved over attributes tree before a drop event. | |
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 |
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 445 of file qgsattributesformproperties.h.
Enumerator | |
---|---|
Drag | |
Drop |
Definition at line 465 of file qgsattributesformproperties.h.
|
explicit |
Definition at line 1124 of file qgsattributesformproperties.cpp.
QTreeWidgetItem * QgsAttributesDnDTree::addContainer | ( | QTreeWidgetItem * | parent, |
const QString & | title, | ||
int | columnCount, | ||
Qgis::AttributeEditorContainerType | type | ||
) |
Adds a new container to parent.
If no parent is set then the container will be forced to a tab widget.
Definition at line 1110 of file qgsattributesformproperties.cpp.
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 1131 of file qgsattributesformproperties.cpp.
|
overridevirtual |
This method needs to be reimplemented in all classes which implement this interface and return an expression context.
Implements QgsExpressionContextGenerator.
Definition at line 1782 of file qgsattributesformproperties.cpp.
|
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 1173 of file qgsattributesformproperties.cpp.
|
overrideprotected |
Definition at line 1259 of file qgsattributesformproperties.cpp.
|
overrideprotected |
Definition at line 1200 of file qgsattributesformproperties.cpp.
|
overrideprotected |
Definition at line 1280 of file qgsattributesformproperties.cpp.
|
overrideprotected |
Definition at line 1272 of file qgsattributesformproperties.cpp.
|
slot |
Definition at line 1805 of file qgsattributesformproperties.cpp.
void QgsAttributesDnDTree::setType | ( | QgsAttributesDnDTree::Type | value | ) |
Definition at line 1800 of file qgsattributesformproperties.cpp.
QgsAttributesDnDTree::Type QgsAttributesDnDTree::type | ( | ) | const |
Definition at line 1795 of file qgsattributesformproperties.cpp.