mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-11 00:04:27 -04:00
Add getter/setter for type
This commit is contained in:
parent
02b3865e42
commit
89943e1259
@ -19,7 +19,7 @@ QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer,
|
||||
mDragListWidgetLayout->addWidget( mDragTree );
|
||||
mDragListWidget->setLayout( mDragListWidgetLayout );
|
||||
mDragTree->setHeaderLabels( QStringList() << tr( "Label" ) );
|
||||
mDragTree->type = DnDTree::Type::Drag;
|
||||
mDragTree->setType( DnDTree::Type::Drag );
|
||||
|
||||
// drop tree
|
||||
QGridLayout *mDropListWidgetLayout = new QGridLayout;
|
||||
@ -28,7 +28,7 @@ QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer,
|
||||
mDropListWidgetLayout->setMargin( 0 );
|
||||
mDropListWidget->setLayout( mDropListWidgetLayout );
|
||||
mDropTree->setHeaderLabels( QStringList() << tr( "Label" ) );
|
||||
mDropTree->type = DnDTree::Type::Drop;
|
||||
mDropTree->setType( DnDTree::Type::Drop );
|
||||
|
||||
// AttributeTypeDialog
|
||||
mAttributeTypeDialog = new QgsAttributeTypeDialog( mLayer, 0, mAttributeTypeFrame );
|
||||
@ -244,7 +244,7 @@ QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAt
|
||||
|
||||
void QgsAttributesFormProperties::loadAttributeEditorTree( DnDTree *mTree )
|
||||
{
|
||||
if ( mTree->type == DnDTree::Type::Drop )
|
||||
if ( mTree->type() == DnDTree::Type::Drop )
|
||||
{
|
||||
// tabs and groups info
|
||||
mTree->clear();
|
||||
@ -821,6 +821,16 @@ void DnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int column )
|
||||
}
|
||||
}
|
||||
|
||||
DnDTree::Type DnDTree::type() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
|
||||
void DnDTree::setType( const Type &value )
|
||||
{
|
||||
mType = value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Serialization helpers for DesigerTreeItemData so we can stuff this easily into QMimeData
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <QSpinBox>
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QDropEvent>
|
||||
#include <QPushButton>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
@ -165,7 +164,7 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
|
||||
void loadRelations();
|
||||
|
||||
void loadAttributeEditorTree( DnDTree *mTree );
|
||||
QTreeWidgetItem *loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree* mTree);
|
||||
QTreeWidgetItem *loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *mTree );
|
||||
|
||||
protected:
|
||||
void updateButtons();
|
||||
@ -187,10 +186,10 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
|
||||
signals:
|
||||
|
||||
private slots:
|
||||
void addTabOrGroupButton();
|
||||
void removeTabOrGroupButton();
|
||||
void loadAttributeTypeDialog( );
|
||||
void storeAttributeTypeDialog( );
|
||||
void addTabOrGroupButton();
|
||||
void removeTabOrGroupButton();
|
||||
void loadAttributeTypeDialog( );
|
||||
void storeAttributeTypeDialog( );
|
||||
};
|
||||
|
||||
|
||||
@ -222,9 +221,11 @@ class DnDTree : public QTreeWidget
|
||||
Drop
|
||||
};
|
||||
|
||||
Type type;
|
||||
|
||||
QList<QTreeWidgetItem *> mIndexedWidgets;
|
||||
Type type() const;
|
||||
void setType( const Type &value );
|
||||
|
||||
protected:
|
||||
virtual void dragMoveEvent( QDragMoveEvent *event ) override;
|
||||
virtual void dropEvent( QDropEvent *event ) override;
|
||||
@ -242,6 +243,7 @@ class DnDTree : public QTreeWidget
|
||||
|
||||
private:
|
||||
QgsVectorLayer *mLayer = nullptr;
|
||||
Type mType;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user