Qt-interest Archive, January 2008
Unidentified subject!
Message 1 in thread
I have a problem with QMenu::removeAction(QAction*).
This is a sample of code that creates my menus in a QMainWindow:
QMenu* fileMenu = menuBar()->addMenu("File");
QAction* newAction = new QAction("New", this);
fileMenu->addAction(newAction);
QMenu* recentMenu = fileMenu->addMenu("Recent");
QAction* emptyAction = new QAction("Empty", this);
recentMenu->addAction(emptyAction);
Now, if I want to remove the emptyAction from the recentMenu and I call:
recentMenu->removeAction(emptyAction);
the program crashes. A bug in Qt?
I'm using Qt 4.3.0, Windows.
--
[ signature omitted ]