@@ -474,7 +474,11 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
474
474
continue ;
475
475
476
476
QgsAttributeTableAction *a = new QgsAttributeTableAction ( action.name (), this , action.id (), sourceIndex );
477
+ #if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
477
478
menu->addAction ( action.name (), a, SLOT ( execute () ) );
479
+ #else
480
+ menu->addAction ( action.name (), a, &QgsAttributeTableAction::execute );
481
+ #endif
478
482
}
479
483
}
480
484
@@ -485,17 +489,24 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
485
489
// add a separator between user defined and standard actions
486
490
menu->addSeparator ();
487
491
488
- QList<QgsMapLayerAction *>::iterator actionIt;
489
- for ( actionIt = registeredActions.begin (); actionIt != registeredActions.end (); ++actionIt )
492
+ Q_FOREACH ( QgsMapLayerAction *action, registeredActions )
490
493
{
491
- QgsAttributeTableMapLayerAction *a = new QgsAttributeTableMapLayerAction ( ( *actionIt )->text (), this , ( *actionIt ), sourceIndex );
492
- menu->addAction ( ( *actionIt )->text (), a, SLOT ( execute () ) );
494
+ QgsAttributeTableMapLayerAction *a = new QgsAttributeTableMapLayerAction ( action->text (), this , action, sourceIndex );
495
+ #if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
496
+ menu->addAction ( action->text (), a, SLOT ( execut () ) );
497
+ #else
498
+ menu->addAction ( action->text (), a, &QgsAttributeTableMapLayerAction::execute );
499
+ #endif
493
500
}
494
501
}
495
502
496
503
menu->addSeparator ();
497
504
QgsAttributeTableAction *a = new QgsAttributeTableAction ( tr ( " Open form" ), this , QString (), sourceIndex );
505
+ #if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
498
506
menu->addAction ( tr ( " Open form" ), a, SLOT ( featureForm () ) );
507
+ #else
508
+ menu->addAction ( tr ( " Open form" ), a, &QgsAttributeTableAction::featureForm );
509
+ #endif
499
510
}
500
511
501
512
void QgsDualView::showViewHeaderMenu ( QPoint point )
0 commit comments