QAction *action = new QAction("Save", this); action->setSoftKeyRole(QAction::PositiveSoftKey);
QAction *action = new QAction("Cancel", this); action->setSoftKeyRole(QAction::NegativeSoftKey);This code creates a new QAction object called "Cancel" and sets its soft key role to NegativeSoftKey. This role is typically used for a button that represents a secondary action, such as canceling or dismissing a dialog. These examples were written using the Qt Core package library.