Details
-
Bug
-
Resolution: Out of scope
-
P1: Critical
-
4.6.2
-
None
-
Linux (openSUSE 11.1)
Qt 4.6.2
GCC 4.3.2
Description
Although the documentation for Q3Action::addTo(QWidget*) states
addTo() returns true if the action was added successfully and false otherwise. (If w is not a Q3ToolBar or Q3PopupMenu the action will not be added and false will be returned.)
calling addTo() with a QMenu returns true, but later in the Q3Action destructor, a crash occurs.
Here is a simple example which crashes upon closing.
main.cpp
#include <QtGui/QApplication> #include <QtGui/QMainWindow> #include <QtCore/QDebug> #include <QtGui/QMenu> #include <QtGui/QMenuBar> #include <Qt3Support/Q3Action> int main(int argc, char *argv[]) { QApplication a(argc, argv); QMainWindow w; QMenu *testMenu = w.menuBar()->addMenu("Test"); Q3Action *action3 = new Q3Action(&w); action3->setText("A Q3Action"); qDebug() << "adding Q3Action to QMenu:" << action3->addTo(testMenu); w.show(); return a.exec(); }