Skip to content

Commit

Permalink
m prefix is only for members
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 28, 2017
1 parent 89943e1 commit 67d2dd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
32 changes: 15 additions & 17 deletions src/app/qgsattributesformproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,34 +242,32 @@ QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAt



void QgsAttributesFormProperties::loadAttributeEditorTree( DnDTree *mTree )
void QgsAttributesFormProperties::loadAttributeEditorTree( DnDTree *tree )
{
if ( mTree->type() == DnDTree::Type::Drop )
if ( tree->type() == DnDTree::Type::Drop )
{
// tabs and groups info
mTree->clear();
mTree->setSortingEnabled( false );
mTree->setSelectionBehavior( QAbstractItemView::SelectRows );
mTree->setDragDropMode( QAbstractItemView::InternalMove );
mTree->setAcceptDrops( true );
mTree->setDragDropMode( QAbstractItemView::DragDrop );
tree->clear();
tree->setSortingEnabled( false );
tree->setSelectionBehavior( QAbstractItemView::SelectRows );
tree->setAcceptDrops( true );
tree->setDragDropMode( QAbstractItemView::DragDrop );

Q_FOREACH ( QgsAttributeEditorElement *wdg, mLayer->editFormConfig().tabs() )
{
loadAttributeEditorTreeItem( wdg, mTree->invisibleRootItem(), mTree );
loadAttributeEditorTreeItem( wdg, tree->invisibleRootItem(), tree );
}

}
else
{
mTree->clear();
mTree->setSortingEnabled( false );
mTree->setSelectionBehavior( QAbstractItemView::SelectRows );
mTree->setDragDropMode( QAbstractItemView::InternalMove );
mTree->setAcceptDrops( false );
mTree->setDragDropMode( QAbstractItemView::DragOnly );
tree->clear();
tree->setSortingEnabled( false );
tree->setSelectionBehavior( QAbstractItemView::SelectRows );
tree->setAcceptDrops( false );
tree->setDragDropMode( QAbstractItemView::DragOnly );

mTree->mIndexedWidgets.clear();
tree->mIndexedWidgets.clear();

const QgsFields &fields = mLayer->fields();
for ( int i = 0; i < fields.size(); ++i )
Expand All @@ -283,7 +281,7 @@ void QgsAttributesFormProperties::loadAttributeEditorTree( DnDTree *mTree )

itemData.setData( 0, FieldConfigRole, QVariant::fromValue<FieldConfig>( cfg ) );

mTree->mIndexedWidgets.insert( i, mTree->addItem( mTree->invisibleRootItem(), itemData ) );
tree->mIndexedWidgets.insert( i, tree->addItem( tree->invisibleRootItem(), itemData ) );
}

/*some stuff for containers
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributesformproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt

void loadRelations();

void loadAttributeEditorTree( DnDTree *mTree );
QTreeWidgetItem *loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *mTree );
void loadAttributeEditorTree(DnDTree *tree );
QTreeWidgetItem *loadAttributeEditorTreeItem(QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *tree );

protected:
void updateButtons();
Expand Down

0 comments on commit 67d2dd5

Please sign in to comment.