Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、メニューがあり、そのどこかにアクションを追加します。そしてしばらくすると、アクションが無効になるため、新しいアクションに置き換えたいと思います。それを実装する方法は?
QMenu* menu = new QMenu(this); ... QAction* action = menu->addAction("text"); ... QAction* newAction = new QAction(menu); // how to replace?
// To replace action with yetAnotherAction: menu->insertAction(action,yetAnotherAction); menu->removeAction(action);