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);