I donīt know. I havenīt found any docu to erase(). *itr_ml.erase() does not compile, anyway. I donīt even know if my loop is ok and if *itr_ml represents a MenuItem. All I want to do is to delete MenuItem #itemNr from the MenuBar.
void TopMenuBar::removeDataBaseMenu(const int& itemNr) { MenuList& ml = m_dataBase_menu->items(); int i = 0; MenuList::iterator itr_ml; for (itr_ml = ml.begin(); itr_ml != ml.end(); ++itr_ml) { if (i == itemNr)*itr_ml.remove(); // there is no remove or erase. How can I remove^^^^^^^^^^^^^^^^ Wouldn't that rather be ml.erase (itr_ml);?the item? i++; } glTabCnt--; } // removeDataBaseMenu()