mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8888 from OPM/8887-fix-reorder-capability
Fix reorder capability
This commit is contained in:
@@ -605,12 +605,12 @@ void PdmUiTreeViewEditor::updateItemDelegateForSubTree( const QModelIndex& subRo
|
||||
|
||||
if ( reorderability && filterIndex.row() >= 0 && selection.size() == 1u && selection.front() == uiItem )
|
||||
{
|
||||
size_t indexInParent = static_cast<size_t>( filterIndex.row() );
|
||||
size_t indexInParentField = reorderability->indexOf( pdmObject );
|
||||
{
|
||||
auto tag = PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = caf::IconProvider( ":/caf/Up16x16.png" );
|
||||
tag->selectedOnly = true;
|
||||
if ( reorderability->canItemBeMovedUp( indexInParent ) )
|
||||
if ( reorderability->canItemBeMovedUp( indexInParentField ) )
|
||||
{
|
||||
tag->clicked.connect( reorderability, &PdmFieldReorderCapability::onMoveItemUp );
|
||||
}
|
||||
@@ -625,7 +625,7 @@ void PdmUiTreeViewEditor::updateItemDelegateForSubTree( const QModelIndex& subRo
|
||||
auto tag = PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = IconProvider( ":/caf/Down16x16.png" );
|
||||
tag->selectedOnly = true;
|
||||
if ( reorderability->canItemBeMovedDown( indexInParent ) )
|
||||
if ( reorderability->canItemBeMovedDown( indexInParentField ) )
|
||||
{
|
||||
tag->clicked.connect( reorderability, &PdmFieldReorderCapability::onMoveItemDown );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user