Skip to content

Commit

Permalink
Pre-Qt 5.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 28, 2017
1 parent a62b026 commit f43df12
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -474,7 +474,11 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
continue;

QgsAttributeTableAction *a = new QgsAttributeTableAction( action.name(), this, action.id(), sourceIndex );
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
menu->addAction( action.name(), a, SLOT( execute() ) );
#else
menu->addAction( action.name(), a, &QgsAttributeTableAction::execute );
#endif
}
}

Expand All @@ -488,13 +492,21 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
Q_FOREACH ( QgsMapLayerAction *action, registeredActions )
{
QgsAttributeTableMapLayerAction *a = new QgsAttributeTableMapLayerAction( action->text(), this, action, sourceIndex );
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
menu->addAction( action->text(), a, SLOT( execut() ) );
#else
menu->addAction( action->text(), a, &QgsAttributeTableMapLayerAction::execute );
#endif
}
}

menu->addSeparator();
QgsAttributeTableAction *a = new QgsAttributeTableAction( tr( "Open form" ), this, QString(), sourceIndex );
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
menu->addAction( tr( "Open form" ), a, SLOT( featureForm() ) );
#else
menu->addAction( tr( "Open form" ), a, &QgsAttributeTableAction::featureForm );
#endif
}

void QgsDualView::showViewHeaderMenu( QPoint point )
Expand Down

0 comments on commit f43df12

Please sign in to comment.